Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/abort_gcm.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/abort_gcm.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/abort_gcm.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE addfi(pdt, leapf, forward,
      S          pucov, pvcov, pteta, pq   , pps ,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/advect.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/advect.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/advect.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE advect(ucov,vcov,teta,w,massebx,masseby,du,dv,dteta)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/advtrac.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/advtrac.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/advtrac.F90	(revision 5099)
@@ -5,10 +5,10 @@
 SUBROUTINE advtrac(pbaru, pbarv, p, masse,q,iapptrac,teta, flxw, pk)
    !     Auteur :  F. Hourdin
-   !
+
    !     Modif. P. Le Van     (20/12/97)
    !            F. Codron     (10/99)
    !            D. Le Croller (07/2001)
    !            M.A Filiberti (04/2002)
-   !
+
    USE infotrac,     ONLY: nqtot, tracers, isoCheck
    USE control_mod,  ONLY: iapp_tracvl, day_step
@@ -16,5 +16,5 @@
 
    IMPLICIT NONE
-   !
+
    include "dimensions.h"
    include "paramet.h"
@@ -96,5 +96,5 @@
 
    !   ..  Modif P.Le Van  ( 20/12/97 )  ....
-   !
+
    !   traitement des flux de masse avant advection.
    !       1. calcul de w
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/bilan_dyn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/bilan_dyn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/bilan_dyn.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE bilan_dyn (ntrac,dt_app,dt_cum,
      s  ps,masse,pk,flux_u,flux_v,teta,phi,ucov,vcov,trac)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE caldyn
      $ (itau,ucov,vcov,teta,ps,masse,pk,pkf,phis ,
@@ -12,12 +12,12 @@
 
 !=======================================================================
-!
+
 !  Auteur :  P. Le Van
-!
+
 !   Objet:
 !   ------
-!
+
 !   Calcul des tendances dynamiques.
-!
+
 ! Modif 04/93 F.Forget
 !=======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/covnat.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/covnat.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/covnat.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE covnat (klevel,ucov, vcov, unat, vnat )
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dissip.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dissip.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dissip.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE dissip( vcov,ucov,teta,p, dv,du,dh )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dteta1.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dteta1.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dteta1.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE dteta1 ( teta, pbaru, pbarv, dteta)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dudv1.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dudv1.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dudv1.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE dudv1 ( vorpot, pbaru, pbarv, du, dv )
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dudv2.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dudv2.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dudv2.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE dudv2 ( teta, pkf, bern, du, dv  )
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE dynetat0(fichnom,vcov,ucov,teta,q,masse,ps,phis,time)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , L.Fairhead
@@ -9,5 +9,5 @@
   USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str
   USE netcdf,      ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_INQ_VARID, &
-                         NF90_CLOSE, NF90_GET_VAR, NF90_NoErr
+                         NF90_CLOSE, nf90_get_var, nf90_noerr
   USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey
   USE control_mod, ONLY: planet_type
@@ -82,10 +82,10 @@
   pa         = tab_cntrl(idecal+13)
   preff      = tab_cntrl(idecal+14)
-!
+
   clon       = tab_cntrl(idecal+15)
   clat       = tab_cntrl(idecal+16)
   grossismx  = tab_cntrl(idecal+17)
   grossismy  = tab_cntrl(idecal+18)
-!
+
   IF ( tab_cntrl(idecal+19)==1. )  THEN
     fxyhypb  = .TRUE.
@@ -116,10 +116,10 @@
   CALL get_var2("aire" ,aire)
   var="temps"
-  IF(NF90_INQ_VARID(fID,var,vID)/=NF90_NoErr) THEN
+  IF(NF90_INQ_VARID(fID,var,vID)/=nf90_noerr) THEN
     CALL msg('missing field <temps> ; trying with <Time>', modname)
     var="Time"
     CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var)
   END IF
-  CALL err(NF90_GET_VAR(fID,vID,time),"get",var)
+  CALL err(nf90_get_var(fID,vID,time),"get",var)
   CALL get_var2("phisinit",phis)
   CALL get_var3("ucov",ucov)
@@ -132,5 +132,5 @@
   ll=.FALSE.
 #ifdef REPROBUS
-  ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= NF90_NoErr                                 !--- DETECT OLD REPRO start.nc FILE
+  ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= nf90_noerr                                 !--- DETECT OLD REPRO start.nc FILE
 #endif
   DO iq=1,nqtot
@@ -145,10 +145,10 @@
     END IF
     !--------------------------------------------------------------------------------------------------------------------------
-    IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr .AND. .NOT.lSkip) THEN                !=== REGULAR CASE: AVAILABLE VARIABLE
-      CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",var)
-    !--------------------------------------------------------------------------------------------------------------------------
-    ELSE IF(NF90_INQ_VARID(fID, oldVar, vID) == NF90_NoErr) THEN                         !=== TRY WITH ALTERNATE NAME
+    IF(NF90_INQ_VARID(fID, var, vID) == nf90_noerr .AND. .NOT.lSkip) THEN                !=== REGULAR CASE: AVAILABLE VARIABLE
+      CALL err(nf90_get_var(fID,vID,q(:,:,:,iq)),"get",var)
+    !--------------------------------------------------------------------------------------------------------------------------
+    ELSE IF(NF90_INQ_VARID(fID, oldVar, vID) == nf90_noerr) THEN                         !=== TRY WITH ALTERNATE NAME
       CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to <'//TRIM(oldVar)//'>', modname)
-      CALL err(NF90_GET_VAR(fID,vID,q(:,:,:,iq)),"get",oldVar)
+      CALL err(nf90_get_var(fID,vID,q(:,:,:,iq)),"get",oldVar)
     !--------------------------------------------------------------------------------------------------------------------------
     ELSE IF(tracers(iq)%iso_iGroup == iH2O .AND. niso > 0) THEN                          !=== WATER ISOTOPES
@@ -209,5 +209,5 @@
   REAL,             INTENT(OUT) :: v(:)
   CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var)
-  CALL err(NF90_GET_VAR(fID,vID,v),"get",var)
+  CALL err(nf90_get_var(fID,vID,v),"get",var)
 END SUBROUTINE get_var1
 
@@ -217,5 +217,5 @@
   REAL,             INTENT(OUT) :: v(:,:)
   CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var)
-  CALL err(NF90_GET_VAR(fID,vID,v),"get",var)
+  CALL err(nf90_get_var(fID,vID,v),"get",var)
 END SUBROUTINE get_var2
 
@@ -225,5 +225,5 @@
   REAL,             INTENT(OUT) :: v(:,:,:)
   CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var)
-  CALL err(NF90_GET_VAR(fID,vID,v),"get",var)
+  CALL err(nf90_get_var(fID,vID,v),"get",var)
 END SUBROUTINE get_var3
 
@@ -233,5 +233,5 @@
   CHARACTER(LEN=*), INTENT(IN) :: typ    !--- TYPE OF OPERATION
   CHARACTER(LEN=*), INTENT(IN) :: nam    !--- FIELD/FILE NAME
-  IF(ierr==NF90_NoERR) RETURN
+  IF(ierr==nf90_noerr) RETURN
   SELECT CASE(typ)
     CASE('inq');   mesg="Field <"//TRIM(nam)//"> is missing"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE dynredem0(fichnom,iday_end,phis)
-!
+
 !-------------------------------------------------------------------------------
 ! Write the NetCDF restart file (initialization).
@@ -82,5 +82,5 @@
   tab_cntrl(22) = grossismx
   tab_cntrl(23) = grossismy
-!
+
   IF ( fxyhypb )   THEN
     tab_cntrl(24) = 1.
@@ -155,12 +155,12 @@
 
 END SUBROUTINE dynredem0
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE dynredem1(fichnom,time,vcov,ucov,teta,q,masse,ps)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Write the NetCDF restart file (append).
@@ -169,6 +169,6 @@
   USE infotrac, ONLY: nqtot, tracers, type_trac
   USE control_mod
-  USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_GET_VAR, NF90_INQ_VARID,  &
-                      NF90_CLOSE, NF90_WRITE,   NF90_PUT_VAR, NF90_NoErr
+  USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, nf90_get_var, NF90_INQ_VARID,  &
+                      NF90_CLOSE, NF90_WRITE,   NF90_PUT_VAR, nf90_noerr
   USE dynredem_mod, ONLY: dynredem_write_u, dynredem_write_v, dynredem_read_u, &
                           err, modname, fil, msg
@@ -214,5 +214,5 @@
   var="controle"
   CALL err(NF90_INQ_VARID(nid,var,vID),"inq",var)
-  CALL err(NF90_GET_VAR(nid,vID,tab_cntrl),"get",var)
+  CALL err(nf90_get_var(nid,vID,tab_cntrl),"get",var)
   tab_cntrl(31)=DBLE(itau_dyn + itaufin)
   CALL err(NF90_INQ_VARID(nid,var,vID),"inq",var)
@@ -236,9 +236,9 @@
       fil="start_trac.nc"
       ierr=NF90_INQ_VARID(nid_trac,var,vID_trac)
-      dum='inq'; IF(ierr==NF90_NoErr) dum='fnd'
+      dum='inq'; IF(ierr==nf90_noerr) dum='fnd'
       WRITE(lunout,*)msg(dum,var)
 
 
-      IF(ierr==NF90_NoErr) CALL dynredem_read_u(nid_trac,var,q(:,:,:,iq),llm)
+      IF(ierr==nf90_noerr) CALL dynredem_read_u(nid_trac,var,q(:,:,:,iq),llm)
     END IF
     fil=fichnom
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dynredem_mod.F90	(revision 5099)
@@ -17,7 +17,7 @@
 
 !===============================================================================
-!
+
 SUBROUTINE dynredem_write_u(ncid,id,var,ll)
-!
+
 !===============================================================================
 ! Arguments:
@@ -35,12 +35,12 @@
   
 END SUBROUTINE dynredem_write_u
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE dynredem_write_v(ncid,id,var,ll)
-!
+
 !===============================================================================
 ! Arguments:
@@ -58,12 +58,12 @@
   
 END SUBROUTINE dynredem_write_v
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE dynredem_read_u(ncid,id,var,ll)
-!
+
 !===============================================================================
 ! Arguments:
@@ -78,15 +78,15 @@
   start(:)=[1,1,1,1]; count(:)=[iip1,jjp1,ll,1]
   CALL err(NF90_INQ_VARID(ncid,id,nvarid),"inq",id)
-  CALL err(NF90_GET_VAR(ncid,nvarid,var,start,count),"get",id)
+  CALL err(nf90_get_var(ncid,nvarid,var,start,count),"get",id)
   
 END SUBROUTINE dynredem_read_u    
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE cre_var(ncid,var,title,did,units)
-!
+
 !===============================================================================
 ! Arguments:
@@ -101,12 +101,12 @@
 
 END SUBROUTINE cre_var
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE put_var1(ncid,var,title,did,v,units)
-!
+
 !===============================================================================
 ! Arguments:
@@ -124,12 +124,12 @@
 
 END SUBROUTINE put_var1
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE put_var2(ncid,var,title,did,v,units)
-!
+
 !===============================================================================
 ! Arguments:
@@ -147,12 +147,12 @@
 
 END SUBROUTINE put_var2
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 FUNCTION msg(typ,nam)
-!
+
 !===============================================================================
 ! Arguments:
@@ -172,12 +172,12 @@
 
 END FUNCTION msg
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE err(ierr,typ,nam)
-!
+
 !===============================================================================
 ! Arguments:
@@ -186,5 +186,5 @@
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: nam    !--- FIELD NAME
 !===============================================================================
-  IF(ierr==NF90_NoERR) RETURN
+  IF(ierr==nf90_noerr) RETURN
   IF(.NOT.PRESENT(typ)) THEN
     CALL ABORT_gcm(modname,NF90_STRERROR(ierr),ierr)
@@ -194,5 +194,5 @@
 
 END SUBROUTINE err
-!
+
 !===============================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/fluxstokenc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/fluxstokenc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/fluxstokenc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE fluxstokenc(pbaru,pbarv,masse,teta,phi,phis,
      . time_step,itau )
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 c=======================================================================
       SUBROUTINE friction(ucov,vcov,pdt)
@@ -16,5 +16,5 @@
 
 !=======================================================================
-!
+
 !   Friction for the Newtonian case:
 !   --------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/gcm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/gcm.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/gcm.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
-!
-!
+
+
+
 PROGRAM gcm
 
@@ -44,15 +44,15 @@
 
   !=======================================================================
-  !
+
   !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
   !   -------
-  !
+
   !   Objet:
   !   ------
-  !
+
   !   GCM LMD nouvelle grille
-  !
+
   !=======================================================================
-  !
+
   !  ... Dans inigeom , nouveaux calculs pour les elongations  cu , cv
   !      et possibilite d'appeler une fonction f(y)  a derivee tangente
@@ -60,8 +60,8 @@
   !  ... Possibilite de choisir le schema pour l'advection de
   !        q  , en modifiant iadv dans traceur.def  (MAF,10/02) .
-  !
+
   !      Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99)
   !      Pour Van-Leer iadv=10
-  !
+
   !-----------------------------------------------------------------------
   !   Declarations:
@@ -140,5 +140,5 @@
   !  lecture des fichiers gcm.def ou run.def
   !  ---------------------------------------
-  !
+
   CALL conf_gcm( 99, .TRUE.)
 
@@ -191,12 +191,11 @@
 #endif
   !-----------------------------------------------------------------------
-  !
-  !
+
+
   !------------------------------------
   !   Initialisation partie parallele
   !------------------------------------
 
-  !
-  !
+
   !-----------------------------------------------------------------------
   !   Initialisation des traceurs
@@ -269,7 +268,6 @@
   ENDIF
 
-  !
   ! on remet le calendrier \`a zero si demande
-  !
+
   IF (start_time /= starttime) then
      WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' &
@@ -370,5 +368,5 @@
      CALL inifilr
   endif ! of if (iflag_phys.eq.1)
-  !
+
   !-----------------------------------------------------------------------
   !   Initialisation de la dissipation :
@@ -453,6 +451,4 @@
   istphy=istdyn/iphysiq     
 
-
-  !
   !-----------------------------------------------------------------------
   !   Integration temporelle du modele :
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE getparam
 #ifdef CPP_IOIPSL
@@ -19,7 +19,7 @@
 CONTAINS
   SUBROUTINE ini_getparam(fichier)
-    !
+
     IMPLICIT NONE
-    !
+
     CHARACTER*(*) :: fichier
     open(out_eff,file=fichier,status='unknown',form='formatted') 
@@ -27,7 +27,7 @@
 
   SUBROUTINE fin_getparam
-    !
+
     IMPLICIT NONE
-    !
+
     close(out_eff)
 
@@ -35,12 +35,12 @@
 
   SUBROUTINE getparamr(TARGET,def_val,ret_val,comment)
-    !
+
     IMPLICIT NONE
-    !
+
     !   Get a real scalar. We first check if we find it
     !   in the database and if not we get it from the run.def
-    !
+
     !   getinr1d and getinr2d are written on the same pattern
-    !
+
     CHARACTER*(*) :: TARGET
     REAL :: def_val
@@ -58,12 +58,12 @@
 
   SUBROUTINE getparami(TARGET,def_val,ret_val,comment)
-    !
+
     IMPLICIT NONE
-    !
+
     !   Get a real scalar. We first check if we find it
     !   in the database and if not we get it from the run.def
-    !
+
     !   getinr1d and getinr2d are written on the same pattern
-    !
+
     CHARACTER*(*) :: TARGET
     INTEGER :: def_val
@@ -82,12 +82,12 @@
 
   SUBROUTINE getparaml(TARGET,def_val,ret_val,comment)
-    !
+
     IMPLICIT NONE
-    !
+
     !   Get a real scalar. We first check if we find it
     !   in the database and if not we get it from the run.def
-    !
+
     !   getinr1d and getinr2d are written on the same pattern
-    !
+
     CHARACTER*(*) :: TARGET
     LOGICAL :: def_val
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       subroutine groupe(pext,pbaru,pbarv,pbarum,pbarvm,wm)
       
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/groupeun.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/groupeun.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/groupeun.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE groupeun(jjmax,llmax,q)
       
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE guide_mod
 
@@ -176,5 +176,5 @@
        if (ncidpl==-99) then
           rcod=nf90_open('apbp.nc',Nf90_NOWRITe, ncidpl)
-          if (rcod/=NF90_NOERR) THEN
+          if (rcod/=nf90_noerr) THEN
              abort_message=' Nudging error -> no file apbp.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -184,5 +184,5 @@
        if (ncidpl==-99) then
           rcod=nf90_open('P.nc',Nf90_NOWRITe,ncidpl)
-          if (rcod/=NF90_NOERR) THEN
+          if (rcod/=nf90_noerr) THEN
              abort_message=' Nudging error -> no file P.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -193,5 +193,5 @@
            if (ncidpl==-99) then
                rcod=nf90_open('u.nc',Nf90_NOWRITe,ncidpl)
-               if (rcod/=NF90_NOERR) THEN
+               if (rcod/=nf90_noerr) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file u.nc',1)
@@ -202,5 +202,5 @@
            if (ncidpl==-99) then
                rcod=nf90_open('v.nc',nf90_nowrite,ncidpl)
-               if (rcod/=NF90_NOERR) THEN
+               if (rcod/=nf90_noerr) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file v.nc',1)
@@ -210,5 +210,5 @@
            if (ncidpl==-99) then
                rcod=nf90_open('T.nc',nf90_nowrite,ncidpl)
-               if (rcod/=NF90_NOERR) THEN
+               if (rcod/=nf90_noerr) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file T.nc',1)
@@ -218,5 +218,5 @@
            if (ncidpl==-99) then
                rcod=nf90_open('hur.nc',nf90_nowrite, ncidpl)
-               if (rcod/=NF90_NOERR) THEN
+               if (rcod/=nf90_noerr) THEN
                   CALL abort_gcm(modname, &
                        ' Nudging error -> no file hur.nc',1)
@@ -227,6 +227,6 @@
     endif 
     error=nf90_inq_dimid(ncidpl,'LEVEL',rid)
-    IF (error/=NF90_NOERR) error=nf90_inq_dimid(ncidpl,'PRESSURE',rid)
-    IF (error/=NF90_NOERR) THEN
+    IF (error/=nf90_noerr) error=nf90_inq_dimid(ncidpl,'PRESSURE',rid)
+    IF (error/=nf90_noerr) THEN
         CALL abort_gcm(modname,'Nudging: error reading pressure levels',1)
     ENDIF
@@ -1120,15 +1120,15 @@
              write(*,*) trim(modname)//' Reading nudging on model levels'
              rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file apbp.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no AP variable in file apbp.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no BP variable in file apbp.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1140,10 +1140,10 @@
          if (guide_plevs==2) then
              rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file P.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no PRES variable in file P.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1156,10 +1156,10 @@
          if (guide_u) then
              rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file u.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no UWND variable in file u.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1169,5 +1169,5 @@
 
              status=nf90_inq_dimid(ncidu, "LONU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidu,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidu,dimid,namedim,lendim)
              IF (lendim /= iip1) THEN
                 abort_message='dimension LONU different from iip1 in u.nc'
@@ -1176,5 +1176,5 @@
 
              status=nf90_inq_dimid(ncidu, "LATU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidu,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidu,dimid,namedim,lendim)
              IF (lendim /= jjp1) THEN
                 abort_message='dimension LATU different from jjp1 in u.nc'
@@ -1187,10 +1187,10 @@
          if (guide_v) then
              rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file v.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no VWND variable in file v.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1200,5 +1200,5 @@
              
              status=nf90_inq_dimid(ncidv, "LONV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidv,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidv,dimid,namedim,lendim)
              
                 IF (lendim /= iip1) THEN
@@ -1209,5 +1209,5 @@
 
              status=nf90_inq_dimid(ncidv, "LATV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidv,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidv,dimid,namedim,lendim)
              IF (lendim /= jjm) THEN
                 abort_message='dimension LATV different from jjm in v.nc'
@@ -1220,10 +1220,10 @@
          if (guide_T) then
              rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file T.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no AIR variable in file T.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1233,5 +1233,5 @@
 
              status=nf90_inq_dimid(ncidt, "LONV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidt,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidt,dimid,namedim,lendim)
              IF (lendim /= iip1) THEN
                 abort_message='dimension LONV different from iip1 in T.nc'
@@ -1240,5 +1240,5 @@
 
              status=nf90_inq_dimid(ncidt, "LATU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidt,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidt,dimid,namedim,lendim)
              IF (lendim /= jjp1) THEN
                 abort_message='dimension LATU different from jjp1 in T.nc'
@@ -1251,10 +1251,10 @@
          if (guide_Q) then
              rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file hur.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no RH variable in file hur.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1264,5 +1264,5 @@
 
              status=nf90_inq_dimid(ncidQ, "LONV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidQ,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidQ,dimid,namedim,lendim)
              IF (lendim /= iip1) THEN
                 abort_message='dimension LONV different from iip1 in hur.nc'
@@ -1271,5 +1271,5 @@
 
              status=nf90_inq_dimid(ncidQ, "LATU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidQ,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidQ,dimid,namedim,lendim)
              IF (lendim /= jjp1) THEN
                 abort_message='dimension LATU different from jjp1 in hur.nc'
@@ -1282,10 +1282,10 @@
          if ((guide_P).OR.(guide_modele)) then
              rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no file ps.nc'
               CALL abort_gcm(modname,abort_message,1)
              ENDIF
              rcode = nf90_inq_varid(ncidps, 'SP', varidps)
-             IF (rcode/=NF90_NOERR) THEN
+             IF (rcode/=nf90_noerr) THEN
               abort_message='Nudging: error -> no SP variable in file ps.nc'
               CALL abort_gcm(modname,abort_message,1)
@@ -1301,8 +1301,8 @@
 ! Coefs ap, bp pour calcul de la pression aux differents niveaux
          if (guide_plevs==1) then
-             status=NF90_GET_VAR(ncidpl,varidap,apnc,[1],[nlevnc])
-             status=NF90_GET_VAR(ncidpl,varidbp,bpnc,[1],[nlevnc])
+             status=nf90_get_var(ncidpl,varidap,apnc,[1],[nlevnc])
+             status=nf90_get_var(ncidpl,varidbp,bpnc,[1],[nlevnc])
          ELSEIF (guide_plevs==0) THEN
-             status=NF90_GET_VAR(ncidpl,varidpl,apnc,[1],[nlevnc])
+             status=nf90_get_var(ncidpl,varidpl,apnc,[1],[nlevnc])
 !FC Pour les corrections la pression est deja en Pascals on commente la ligne ci-dessous
              IF(convert_Pa) apnc=apnc*100.! conversion en Pascals
@@ -1329,5 +1329,5 @@
 ! Pression 
      if (guide_plevs==2) then
-         status=NF90_GET_VAR(ncidp,varidp,pnat2,start,count)
+         status=nf90_get_var(ncidp,varidp,pnat2,start,count)
          IF (invert_y) THEN
 !           PRINT*,"Invertion impossible actuellement"
@@ -1339,5 +1339,5 @@
 !  Vent zonal
      if (guide_u) then
-         status=NF90_GET_VAR(ncidu,varidu,unat2,start,count)
+         status=nf90_get_var(ncidu,varidu,unat2,start,count)
          IF (invert_y) THEN
            CALL invert_lat(iip1,jjp1,nlevnc,unat2)
@@ -1347,5 +1347,5 @@
 !  Temperature
      if (guide_T) then
-         status=NF90_GET_VAR(ncidt,varidt,tnat2,start,count)
+         status=nf90_get_var(ncidt,varidt,tnat2,start,count)
          IF (invert_y) THEN
            CALL invert_lat(iip1,jjp1,nlevnc,tnat2)
@@ -1355,5 +1355,5 @@
 !  Humidite
      if (guide_Q) then
-         status=NF90_GET_VAR(ncidQ,varidQ,qnat2,start,count)
+         status=nf90_get_var(ncidQ,varidQ,qnat2,start,count)
          IF (invert_y) THEN
            CALL invert_lat(iip1,jjp1,nlevnc,qnat2)
@@ -1365,5 +1365,5 @@
      if (guide_v) then
          count(2)=jjm
-         status=NF90_GET_VAR(ncidv,varidv,vnat2,start,count)
+         status=nf90_get_var(ncidv,varidv,vnat2,start,count)
          IF (invert_y) THEN
            CALL invert_lat(iip1,jjm,nlevnc,vnat2)
@@ -1378,5 +1378,5 @@
          count(3)=1
          count(4)=0
-         status=NF90_GET_VAR(ncidps,varidps,psnat2,start,count)
+         status=nf90_get_var(ncidps,varidps,psnat2,start,count)
          IF (invert_y) THEN
            CALL invert_lat(iip1,jjp1,1,psnat2)
@@ -1420,15 +1420,15 @@
            write(*,*)trim(modname)//' Reading nudging on model levels'
            rcode = nf90_open('apbp.nc', nf90_nowrite, ncidpl)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file apbp.nc'
            CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidpl, 'AP', varidap)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no AP variable in file apbp.nc'
            CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidpl, 'BP', varidbp)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no BP variable in file apbp.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1439,10 +1439,10 @@
          if (guide_plevs==2) then
            rcode = nf90_open('P.nc', nf90_nowrite, ncidp)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file P.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidp, 'PRES', varidp)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no PRES variable in file P.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1454,10 +1454,10 @@
          if (guide_u) then
            rcode = nf90_open('u.nc', nf90_nowrite, ncidu)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file u.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidu, 'UWND', varidu)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no UWND variable in file u.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1469,10 +1469,10 @@
          if (guide_v) then
            rcode = nf90_open('v.nc', nf90_nowrite, ncidv)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file v.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidv, 'VWND', varidv)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no VWND variable in file v.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1484,10 +1484,10 @@
          if (guide_T) then
            rcode = nf90_open('T.nc', nf90_nowrite, ncidt)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file T.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidt, 'AIR', varidt)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no AIR variable in file T.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1499,10 +1499,10 @@
          if (guide_Q) then
            rcode = nf90_open('hur.nc', nf90_nowrite, ncidQ)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file hur.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidQ, 'RH', varidQ)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no RH,variable in file hur.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1514,10 +1514,10 @@
          if ((guide_P).OR.(guide_modele)) then
            rcode = nf90_open('ps.nc', nf90_nowrite, ncidps)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no file ps.nc'
              CALL abort_gcm(modname,abort_message,1)
            ENDIF
            rcode = nf90_inq_varid(ncidps, 'SP', varidps)
-           IF (rcode/=NF90_NOERR) THEN
+           IF (rcode/=nf90_noerr) THEN
              abort_message='Nudging: error -> no SP variable in file ps.nc'
              CALL abort_gcm(modname,abort_message,1)
@@ -1533,8 +1533,8 @@
 ! Coefs ap, bp pour calcul de la pression aux differents niveaux
          if (guide_plevs==1) then
-             status=NF90_GET_VAR(ncidpl,varidap,apnc,[1],[nlevnc])
-             status=NF90_GET_VAR(ncidpl,varidbp,bpnc,[1],[nlevnc])
+             status=nf90_get_var(ncidpl,varidap,apnc,[1],[nlevnc])
+             status=nf90_get_var(ncidpl,varidbp,bpnc,[1],[nlevnc])
          elseif (guide_plevs==0) THEN
-             status=NF90_GET_VAR(ncidpl,varidpl,apnc,[1],[nlevnc])
+             status=nf90_get_var(ncidpl,varidpl,apnc,[1],[nlevnc])
              apnc=apnc*100.! conversion en Pascals
              bpnc(:)=0.
@@ -1560,5 +1560,5 @@
 !  Pression
      if (guide_plevs==2) then
-         status=NF90_GET_VAR(ncidp,varidp,zu,start,count)
+         status=nf90_get_var(ncidp,varidp,zu,start,count)
          DO i=1,iip1
              pnat2(i,:,:)=zu(:,:)
@@ -1573,5 +1573,5 @@
 !  Vent zonal
      if (guide_u) then
-         status=NF90_GET_VAR(ncidu,varidu,zu,start,count)
+         status=nf90_get_var(ncidu,varidu,zu,start,count)
          DO i=1,iip1
              unat2(i,:,:)=zu(:,:)
@@ -1586,5 +1586,5 @@
 !  Temperature
      if (guide_T) then
-         status=NF90_GET_VAR(ncidt,varidt,zu,start,count)
+         status=nf90_get_var(ncidt,varidt,zu,start,count)
          DO i=1,iip1
              tnat2(i,:,:)=zu(:,:)
@@ -1599,5 +1599,5 @@
 !  Humidite
      if (guide_Q) then
-         status=NF90_GET_VAR(ncidQ,varidQ,zu,start,count)
+         status=nf90_get_var(ncidQ,varidQ,zu,start,count)
          DO i=1,iip1
              qnat2(i,:,:)=zu(:,:)
@@ -1613,5 +1613,5 @@
      if (guide_v) then
          count(2)=jjm
-         status=NF90_GET_VAR(ncidv,varidv,zv,start,count)
+         status=nf90_get_var(ncidv,varidv,zv,start,count)
          DO i=1,iip1
              vnat2(i,:,:)=zv(:,:)
@@ -1631,5 +1631,5 @@
          count(3)=1
          count(4)=0
-         status=NF90_GET_VAR(ncidps,varidps,zu(:,1),start,count)
+         status=nf90_get_var(ncidps,varidps,zu(:,1),start,count)
          DO i=1,iip1
              psnat2(i,:)=zu(:,1)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/iniacademic.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
 
@@ -22,5 +22,5 @@
   USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
   USE readTracFiles_mod, ONLY: addPhase
-  use netcdf, only : NF90_NOWRITE,NF90_OPEN,NF90_NOERR,NF90_INQ_VARID,NF90_CLOSE,NF90_GET_VAR
+  use netcdf, only : NF90_NOWRITE,NF90_OPEN,nf90_noerr,NF90_INQ_VARID,NF90_CLOSE,nf90_get_var
 
   !   Author:    Frederic Hourdin      original: 15/01/93
@@ -95,5 +95,5 @@
   ! 1. Initializations for Earth-like case
   ! --------------------------------------
-  !
+
   ! initialize planet radius, rotation rate,...
   call conf_planete
@@ -141,8 +141,8 @@
      relief=0.
      ierr = NF90_OPEN ('relief_in.nc', NF90_NOWRITE,nid_relief)
-     if (ierr==NF90_NOERR) THEN
+     if (ierr==nf90_noerr) THEN
          ierr=NF90_INQ_VARID(nid_relief,'RELIEF',varid)
-         if (ierr==NF90_NOERR) THEN
-              ierr=NF90_GET_VAR(nid_relief,varid,relief(1:iim,1:jjp1))
+         if (ierr==nf90_noerr) THEN
+              ierr=nf90_get_var(nid_relief,varid,relief(1:iim,1:jjp1))
               relief(iip1,:)=relief(1,:)
          else
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE integrd
      $  (  nq,vcovm1,ucovm1,tetam1,psm1,massem1,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/logic_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/logic_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/logic_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE logic_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/paramet.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/paramet.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/paramet.h	(revision 5099)
@@ -1,12 +1,12 @@
-!
+
 ! $Header$
-!
-!
+
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez  n'utiliser que des ! pour les commentaires
 !                 et  bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
-!
+
+
 !-----------------------------------------------------------------------
 !   INCLUDE 'paramet.h'
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE qminimum( q,nqtot,deltap )
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/replay3d.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/replay3d.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/replay3d.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id: gcm.F90 3579 2019-10-09 13:11:07Z fairhead $
-!
-!
-!
+
+
+
 PROGRAM replay3d
 
@@ -30,15 +30,15 @@
 
   !=======================================================================
-  !
+
   !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
   !   -------
-  !
+
   !   Objet:
   !   ------
-  !
+
   !   GCM LMD nouvelle grille
-  !
+
   !=======================================================================
-  !
+
   !  ... Dans inigeom , nouveaux calculs pour les elongations  cu , cv
   !      et possibilite d'appeler une fonction f(y)  a derivee tangente
@@ -46,8 +46,8 @@
   !  ... Possibilite de choisir le schema pour l'advection de
   !        q  , en modifiant iadv dans traceur.def  (MAF,10/02) .
-  !
+
   !      Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99)
   !      Pour Van-Leer iadv=10
-  !
+
   !-----------------------------------------------------------------------
   !   Declarations:
@@ -85,5 +85,5 @@
   !  lecture des fichiers gcm.def ou run.def
   !  ---------------------------------------
-  !
+
 preff=101325.
  pa=50000.
@@ -128,7 +128,6 @@
   zdtvr    = daysec/REAL(day_step)
 
-  !
   ! on remet le calendrier \`a zero si demande
-  !
+
      annee_ref = anneeref
      day_ref = dayref
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/sw_case_williamson91_6.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/sw_case_williamson91_6.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/sw_case_williamson91_6.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
       SUBROUTINE sw_case_williamson91_6(vcov,ucov,teta,masse,ps)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/temps_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/temps_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/temps_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE temps_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE top_bound(vcov,ucov,teta,masse,dt)
       
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       subroutine wrgrads(if,nl,field,name,titlevar)
       implicit none
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/write_paramLMDZ_dyn.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/write_paramLMDZ_dyn.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/write_paramLMDZ_dyn.h	(revision 5099)
@@ -136,5 +136,5 @@
 !     CALL histwrite(nid_ctesGCM, "cycle_diurne", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     IF(soil_model) THEN
 !      zx_tmp_2d(1:iip1,1:jjp1)=1.
@@ -144,5 +144,5 @@
 !     CALL histwrite(nid_ctesGCM, "soil_model", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     IF(new_oliq) THEN
 !      zx_tmp_2d(1:iip1,1:jjp1)=1.
@@ -152,5 +152,5 @@
 !     CALL histwrite(nid_ctesGCM, "new_oliq", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     IF(ok_orodr) THEN
 !      zx_tmp_2d(1:iip1,1:jjp1)=1.
@@ -160,5 +160,5 @@
 !     CALL histwrite(nid_ctesGCM, "ok_orodr", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     IF(ok_orolf) THEN
 !      zx_tmp_2d(1:iip1,1:jjp1)=1.
@@ -168,5 +168,5 @@
 !     CALL histwrite(nid_ctesGCM, "ok_orolf", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     IF(ok_limitvrai) THEN
 !      zx_tmp_2d(1:iip1,1:jjp1)=1.
@@ -176,9 +176,9 @@
 !     CALL histwrite(nid_ctesGCM, "ok_limitvrai", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     zx_tmp_2d(1:iip1,1:jjp1)=nbapp_rad
 !     CALL histwrite(nid_ctesGCM, "nbapp_rad", itau_w,
 !    .               zx_tmp_2d,iip1*jjp1,ndex2d)
-!
+
 !     zx_tmp_2d(1:iip1,1:jjp1)=iflag_con
 !     CALL histwrite(nid_ctesGCM, "iflag_con", itau_w,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/academic.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/academic.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/academic.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       common/academic/tetarappel,knewt_t,kfrict,knewt_g,clat4
       real :: tetarappel(ip1jmp1,llm)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/adaptdt.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/adaptdt.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/adaptdt.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       subroutine adaptdt(nadv,dtbon,n,pbaru,
      c                   masse)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advn.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE advn(q,masse,w,pbaru,pbarv,pdt,mode)
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advx.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advx.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advx.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE  advx(limit,dtx,pbaru,sm,s0,
      $     sx,sy,sz,lati,latf)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advxp.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advxp.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advxp.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
        SUBROUTINE ADVXP(LIMIT,DTX,PBARU,SM,S0,SSX,SY,SZ
      .                ,SSXX,SSXY,SSXZ,SYY,SYZ,SZZ,ntra)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advy.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advy.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advy.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE advy(limit,dty,pbarv,sm,s0,sx,sy,sz)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advyp.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advyp.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advyp.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE ADVYP(LIMIT,DTY,PBARV,SM,S0,SSX,SY,SZ
      .                 ,SSXX,SSXY,SSXZ,SYY,SYZ,SZZ,ntra )
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advz.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advz.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advz.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE advz(limit,dtz,w,sm,s0,sx,sy,sz)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advzp.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advzp.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/advzp.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE ADVZP(LIMIT,DTZ,W,SM,S0,SSX,SY,SZ
      .                 ,SSXX,SSXY,SSXZ,SYY,SYZ,SZZ,ntra )
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/bernoui.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/bernoui.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/bernoui.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE bernoui (ngrid,nlay,pphi,pecin,pbern)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/caldyn0.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/caldyn0.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/caldyn0.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE caldyn0(itau,ucov,vcov,teta,ps,masse,pk,phis,phi,w,pbaru,pbarv,time)
-!
+
 !-------------------------------------------------------------------------------
 ! Author: P. Le Van ; modif. 04/93: F.Forget.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/clesph0.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/clesph0.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/clesph0.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 c..include clesph0.h
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/com_io_dyn_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/com_io_dyn_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/com_io_dyn_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 module com_io_dyn_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comconst_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comconst_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comconst_mod.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 MODULE comconst_mod
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissip.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissip.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissip.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !-----------------------------------------------------------------------
 ! INCLUDE comdissip.h
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissipn.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissipn.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissipn.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !  Attention : ce fichier include est compatible format fixe/format libre
 !                 veillez à n'utiliser que des ! pour les commentaires
@@ -10,11 +10,10 @@
 
       REAL  tetaudiv, tetaurot, tetah, cdivu, crot, cdivh
-!
+
       COMMON/comdissipn/ tetaudiv(llm),tetaurot(llm),tetah(llm)   ,     &
      &                        cdivu,      crot,         cdivh
 
-!
 !    Les parametres de ce common proviennent des calculs effectues dans 
 !             Inidissip  .
-!
+
 !-----------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissnew.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissnew.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comdissnew.h	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Id$
-!
-!
+
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez à n'utiliser que des ! pour les commentaires
 !                 et à bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
+
 !-----------------------------------------------------------------------
 ! INCLUDE 'comdissnew.h'
@@ -24,7 +24,6 @@
       REAL     tetagdiv, tetagrot,  tetatemp, coefdis
 
-!
 ! ... Les parametres de ce common comdissnew sont  lues par defrun_new 
 !              sur le fichier  run.def    ....
-!
+
 !-----------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comgeom.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comgeom.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comgeom.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !CDK comgeom
       COMMON/comgeom/                                                   &
@@ -21,5 +21,4 @@
      & aivscu2gam(ip1jm),aiuscv2gam(ip1jm),xprimu(iip1),xprimv(iip1)
 
-!
         REAL                                                            &
      & cu,cv,unscu2,unscv2,aire,airesurg,aireu,airev,unsaire,apoln     ,&
@@ -31,3 +30,2 @@
      & aivscu2gam ,aiuscv2gam,cuvsurcv,cvsurcuv,cvusurcu,cusurcvu,xprimu&
      & , xprimv
-!
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comgeom2.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comgeom2.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comgeom2.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !CDK comgeom2
       COMMON/comgeom/                                                   &
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comvert_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comvert_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/comvert_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE comvert_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_dat_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_dat_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_dat_m.F90	(revision 5099)
@@ -1,4 +1,4 @@
 MODULE conf_dat_m
-!
+
 !*******************************************************************************
 
@@ -11,7 +11,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE conf_dat2d(title, xd, yd, xf, yf, champd, interbar)
-!
+
 !-------------------------------------------------------------------------------
 ! Author: P. Le Van
@@ -108,12 +108,12 @@
 
 END SUBROUTINE conf_dat2d
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE conf_dat3d(title, xd, yd, zd, xf, yf, zf, champd, interbar)
-!
+
 !-------------------------------------------------------------------------------
 ! Author: P. Le Van
@@ -229,5 +229,5 @@
 
 END SUBROUTINE conf_dat3d
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_planete.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_planete.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_planete.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE conf_planete
-!
+
 #ifdef CPP_IOIPSL
 USE IOIPSL
@@ -14,10 +14,9 @@
 USE comvert_mod, ONLY: preff, pa
 IMPLICIT NONE
-!
-!
+
+
 !   Declarations :
 !   --------------
 
-!
 !   local:
 !   ------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/control_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/control_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/control_mod.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id $
-!
 
 MODULE control_mod
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/convflu.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/convflu.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/convflu.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE convflu( xflu,yflu,nbniv,convfl )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/convmas.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/convmas.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/convmas.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE convmas (pbaru, pbarv, convm)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/coordij.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/coordij.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/coordij.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE coordij(lon,lat,ilon,jlat)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/covcont.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/covcont.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/covcont.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE covcont (klevel,ucov, vcov, ucont, vcont )
-!
+
 !-------------------------------------------------------------------------------
 ! Author: P. Le Van
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diagedyn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diagedyn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diagedyn.F	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 C======================================================================
@@ -73,5 +72,5 @@
       REAL,PARAMETER :: RLSTT=2.8345E+6
       REAL,PARAMETER :: RLVTT=2.5008E+6
-!
+
 C
       INTEGER imjmp1
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert.F90	(revision 5099)
@@ -367,7 +367,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 FUNCTION ridders(sig) RESULT(sg)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -413,5 +413,5 @@
 
 FUNCTION racinesig(sig) RESULT(sg)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -451,5 +451,5 @@
 
 FUNCTION distrib(x,c1,c2,x0) RESULT(res)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE diverg(klevel,x,y,div)
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg_gam.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg_gam.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/diverg_gam.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE diverg_gam(klevel,cuvscvgam,cvuscugam,unsairegam ,
      *                       unsapolnga,unsapolsga,  x, y,  div )
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divergf.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divergf.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divergf.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE divergf(klevel,x,y,div)
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divergst.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divergst.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divergst.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE divergst(klevel,x,y,div)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divgrad.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divgrad.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divgrad.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE divgrad (klevel,h, lh, divgra )
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divgrad2.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divgrad2.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/divgrad2.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE divgrad2 ( klevel, h, deltapres, lh, divgra )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/dump2d.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/dump2d.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/dump2d.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE dump2d(im,jm,z,nom_z)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ener_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ener_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ener_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE ener_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/enercin.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/enercin.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/enercin.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE enercin ( vcov, ucov, vcont, ucont, ecin )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van.
@@ -20,17 +20,17 @@
 !                 . V
 !                i,j-1
-!
+
 !      alpha4 .       . alpha1
-!
-!
+
+
 !        U .      . P     . U
 !       i-1,j    i,j      i,j
-!
+
 !      alpha3 .       . alpha2
-!
-!
+
+
 !                 . V
 !                i,j
-!
+
 ! Kinetic energy at scalar point P(i,j) (excluding poles) is:
 !       Ecin = 0.5 * U(i-1,j)**2 *( alpha3 + alpha4 )  +
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/exner_hyb_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/exner_hyb_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/exner_hyb_m.F90	(revision 5099)
@@ -9,8 +9,8 @@
     !     Auteurs :  P.Le Van  , Fr. Hourdin  .
     !    ..........
-    !
+
     !    ....  ngrid, ps,p             sont des argum.d'entree  au sous-prog ...
     !    ....  pks,pk,pkf   sont des argum.de sortie au sous-prog ...
-    !
+
     !   ************************************************************************
     !    Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 
@@ -20,17 +20,17 @@
     !  .. N.B : Au sommet de l'atmosphere,  p(llm+1) = 0. , et ps et pks sont
     !    la pression et la fonction d'Exner  au  sol  .
-    !
+
     !                                 -------- z
     !    A partir des relations  ( 1 ) p*dz(pk) = kappa *pk*dz(p)      et
     !                            ( 2 ) pk(l) = alpha(l)+ beta(l)*pk(l-1)
     !    ( voir note de Fr.Hourdin )  ,
-    !
+
     !    on determine successivement , du haut vers le bas des couches, les 
     !    coef. alpha(llm),beta(llm) .,.,alpha(l),beta(l),,,alpha(2),beta(2), 
     !    puis pk(ij,1). Ensuite ,on calcule,du bas vers le haut des couches,  
     !     pk(ij,l)  donne  par la relation (2),  pour l = 2 a l = llm .
-    !
-    !
-    !
+
+
+
     USE comconst_mod, ONLY: jmp1, cpp, kappa, r
     USE comvert_mod, ONLY: preff
@@ -104,14 +104,14 @@
 
     !    .... Calcul des coeff. alpha et beta  pour la couche l = llm ..
-    !
+
     DO     ij      = 1, ngrid
        alpha(ij,llm) = 0.
        beta (ij,llm) = 1./ unpl2k
     ENDDO
-    !
+
     !     ... Calcul des coeff. alpha et beta  pour l = llm-1  a l = 2 ...
-    !
+
     DO l = llm -1 , 2 , -1
-       !
+
        DO ij = 1, ngrid
           dellta = p(ij,l)* unpl2k + p(ij,l+1)* ( beta(ij,l+1)-unpl2k )
@@ -123,12 +123,12 @@
     !  ***********************************************************************
     !     .....  Calcul de pk pour la couche 1 , pres du sol  ....
-    !
+
     DO   ij   = 1, ngrid
        pk(ij,1) = ( p(ij,1)*pks(ij) - 0.5*alpha(ij,2)*p(ij,2) )  / &
             (  p(ij,1)* (1.+kappa) + 0.5*( beta(ij,2)-unpl2k )* p(ij,2) )
     ENDDO
-    !
+
     !    ..... Calcul de pk(ij,l) , pour l = 2 a l = llm  ........
-    !
+
     DO l = 2, llm
        DO   ij   = 1, ngrid
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/exner_milieu_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/exner_milieu_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/exner_milieu_m.F90	(revision 5099)
@@ -6,12 +6,12 @@
 
   SUBROUTINE  exner_milieu ( ngrid, ps, p, pks, pk, pkf )
-    !
+
     !     Auteurs :  F. Forget , Y. Wanherdrick
     ! P.Le Van  , Fr. Hourdin  .
     !    ..........
-    !
+
     !    ....  ngrid, ps,p             sont des argum.d'entree  au sous-prog ...
     !    ....  pks,pk,pkf   sont des argum.de sortie au sous-prog ...
-    !
+
     !   ************************************************************************
     !    Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 
@@ -21,5 +21,5 @@
     !  .. N.B : Au sommet de l'atmosphere,  p(llm+1) = 0. , et ps et pks sont
     !    la pression et la fonction d'Exner  au  sol  .
-    !
+
     !     WARNING : CECI est une version speciale de exner_hyb originale
     !               Utilise dans la version martienne pour pouvoir 
@@ -28,6 +28,6 @@
     !              energie totale/ interne / potentielle (F.Forget 2001)
     !    ( voir note de Fr.Hourdin )  ,
-    !
-    !
+
+
     USE comconst_mod, ONLY: jmp1, cpp, kappa, r
     USE comvert_mod, ONLY: preff
@@ -100,5 +100,5 @@
     !    .... Calcul de pk  pour la couche l 
     !    --------------------------------------------
-    !
+
     dum1 = cpp * (2*preff)**(-kappa) 
     DO l = 1, llm-1
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/extrapol.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/extrapol.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/extrapol.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 C
 C
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/flumass.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/flumass.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/flumass.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE flumass (massebx,masseby, vcont, ucont, pbaru, pbarv )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE fxy (rlatu,yprimu,rlatv,yprimv,rlatu1,yprimu1,
      ,                    rlatu2,yprimu2,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE fxysinus (rlatu,yprimu,rlatv,yprimv,rlatu1,yprimu1,
      ,                    rlatu2,yprimu2,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/geopot.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/geopot.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/geopot.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE geopot (ngrid, teta, pk, pks, phis, phi )
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_ecrit_fi.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_ecrit_fi.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_ecrit_fi.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 	SUBROUTINE gr_ecrit_fi(nfield,nlon,iim,jjmp1,ecrit,fi)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_int_dyn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_int_dyn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_int_dyn.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       subroutine gr_int_dyn(champin,champdyn,iim,jp1)
       implicit none
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_u_scal.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_u_scal.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_u_scal.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gr_u_scal(nx,x_u,x_scal)
 c%W%    %G%
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_v_scal.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_v_scal.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_v_scal.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gr_v_scal(nx,x_v,x_scal)
 c%W%    %G%
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/grad.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/grad.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/grad.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE  grad(klevel, pg,pgx,pgy )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradiv.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradiv.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradiv.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gradiv(klevel, xcov, ycov, ld, gdx, gdy )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradiv2.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradiv2.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradiv2.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gradiv2(klevel, xcov, ycov, ld, gdx, gdy )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradsdef.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradsdef.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gradsdef.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       integer nfmx,imx,jmx,lmx,nvarmx
       parameter(nfmx=10,imx=200,jmx=150,lmx=200,nvarmx=1000)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/grilles_gcm_netcdf_sub.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/grilles_gcm_netcdf_sub.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/grilles_gcm_netcdf_sub.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 ! This subroutine creates the grilles_gcm.nc file, containing:
 ! -> longitudes and latitudes in degrees for dynamical grids u, v and scalaire,
@@ -7,5 +7,5 @@
 ! -> vertical levels "presnivs"
 ! -> mask (land/sea), area (grid), phis=surface geopotential height = phis/g
-!
+
 ! The subroutine is called in dynphy_lonlat/phylmd/ce0l.F90.
 
@@ -37,8 +37,8 @@
   INTEGER out_latudim,out_latvdim,out_dim(2)
   INTEGER out_levdim
-  !
+
   INTEGER :: presnivs_id
   INTEGER :: mask_id,area_id,phis_id
-  !
+
   INTEGER start(2),COUNT(2)
 
@@ -47,5 +47,5 @@
   REAL rlonudeg(iip1),rlonvdeg(iip1)
   REAL uwnd(iip1,jjp1),vwnd(iip1,jjm),temp(iip1,jjp1) 
-  !
+
   INTEGER masque_int(iip1,jjp1)
   REAL :: phis_loc(iip1,jjp1)
@@ -115,5 +115,5 @@
   status=nf90_def_dim(ncid_out,'latv',jjm,out_latvdim)
   CALL handle_err(status)
-  !
+
   status=nf90_def_dim(ncid_out,'lev',llm,out_levdim)
   CALL handle_err(status)
@@ -162,5 +162,5 @@
   status=nf90_put_att(ncid_out,out_tempid,'units','Kelvin')
   status=nf90_put_att(ncid_out,out_tempid,'long_name','scalar dynamical grid')
-  !
+
   ! for INCA :
   ! vertical levels "presnivs"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/heavyside.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/heavyside.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/heavyside.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/infotrac.F90	(revision 5099)
@@ -1,4 +1,4 @@
 !$Id$
-!
+
 MODULE infotrac
 
@@ -54,5 +54,5 @@
   !  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
   !  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
-  !
+
   !=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
   !    Each entry is accessible using "%" sign.
@@ -81,5 +81,5 @@
   !  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
   !  +-------------+------------------------------------------------------+-------------+------------------------+
-  !
+
   !=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
   !    Each entry is accessible using "%" sign.
@@ -120,8 +120,8 @@
     IMPLICIT NONE
     !==============================================================================================================================
-    !
+
     !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
     !   -------
-    !
+
     !   Modifications:
     !   --------------
@@ -129,9 +129,9 @@
     !   02/02: M-A Filiberti Lecture de traceur.def
     !   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types trac_type et isot_type)
-    !
+
     !   Objet:
     !   ------
     !   GCM LMD nouvelle grille
-    !
+
     !==============================================================================================================================
     !   ... modification de l'integration de q ( 26/04/94 ) ....
@@ -315,5 +315,5 @@
     !     iadv = 20   Slopes                                                       SLP
     !     iadv = 30   Prather                                                      PRA
-    !
+
     !        In array q(ij,l,iq) : iq = 1/2[/3]    for vapour/liquid[/ice] water
     !        And optionaly:        iq = 3[4],nqtot for other tracers
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/iniconst.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/iniconst.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/iniconst.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE iniconst
 
@@ -16,10 +16,10 @@
   
   IMPLICIT NONE
-  !
+
   !      P. Le Van
-  !
+
   !   Declarations:
   !   -------------
-  !
+
   include "dimensions.h"
   include "paramet.h"
@@ -28,7 +28,7 @@
   character(len=*),parameter :: modname="iniconst"
   character(len=80) :: abort_message
-  !
-  !
-  !
+
+
+
   !-----------------------------------------------------------------------
   !   dimension des boucles:
@@ -50,10 +50,9 @@
 
   !-----------------------------------------------------------------------
-  !
 
   r       = cpp * kappa
 
   write(lunout,*) trim(modname),': R  CP  Kappa ',r,cpp,kappa
-  !
+
   !-----------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inidissip.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inidissip.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inidissip.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE inidissip ( lstardis,nitergdiv,nitergrot,niterh  , &
      tetagdiv,tetagrot,tetatemp, vert_prof_dissip)
@@ -48,5 +48,5 @@
 
   !-----------------------------------------------------------------------
-  !
+
   !   calcul des valeurs propres des operateurs par methode iterrative:
   !   -----------------------------------------------------------------
@@ -105,5 +105,5 @@
 
   DO    ii = 1, 2
-     !
+
      DO ij = 1, ip1jmp1
         zu(ij)  = RAN1(idum) -.5
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigeom.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigeom.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigeom.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigrads.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigrads.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigrads.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       subroutine inigrads(if,im
      s  ,x,fx,xmin,xmax,jm,y,ymin,ymax,fy,lm,z,fz
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initfluxsto.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initfluxsto.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initfluxsto.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       subroutine initfluxsto
      .  (infile,tstep,t_ops,t_wrt,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       subroutine inithist(day0,anne0,tstep,t_ops,t_wrt)
 
@@ -155,5 +155,5 @@
 C  Traceurs
 C
-!
+
 !        DO iq=1,nqtot
 !          call histdef(histid, tracers(iq)%name, 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 module inter_barxy_m
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpost.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpost.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpost.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
         subroutine interpost(q,qppm)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpre.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpre.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpre.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
        subroutine interpre(q,qppm,w,fluxwppm,masse,
      s            apppm,bpppm,massebx,masseby,pbaru,pbarv,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE laplacien ( klevel, teta, divgra )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_gam.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_gam.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_gam.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE laplacien_gam ( klevel, cuvsga, cvusga, unsaigam ,
      *                        unsapolnga, unsapolsga, teta, divgra )
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_rot.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_rot.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_rot.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE laplacien_rot ( klevel, rotin, rotout,ghx,ghy )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_rotgam.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_rotgam.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/laplacien_rotgam.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE laplacien_rotgam ( klevel, rotin, rotout )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limx.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limx.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limx.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE limx(s0,sx,sm,pente_max)
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limz.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limz.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/limz.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE limz(s0,sz,sm,pente_max)
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbar.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbar.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbar.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE massbar(masse,massebx,masseby)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
@@ -22,28 +22,28 @@
 !    * alpha4(i,j) at point ( i-1/4,j-1/4 )
 ! where alpha1(i,j) = aire(i+1/4,j-1/4)/ aire(i,j)
-!
+
 !   alpha4 .         . alpha1    . alpha4
 !    (i,j)             (i,j)       (i+1,j)
-!
+
 !             P .        U .          . P
 !           (i,j)       (i,j)         (i+1,j)
-!
+
 !   alpha3 .         . alpha2    .alpha3 
 !    (i,j)              (i,j)     (i+1,j)
-!
+
 !             V .        Z .          . V
 !           (i,j)
-!
+
 !   alpha4 .         . alpha1    .alpha4
 !   (i,j+1)            (i,j+1)   (i+1,j+1) 
-!
+
 !             P .        U .          . P
 !          (i,j+1)                    (i+1,j+1)
-!
-!
+
+
 !    massebx(i,j) = masse(i  ,j) * ( alpha1(i  ,j) + alpha2(i,j))   +
 !                   masse(i+1,j) * ( alpha3(i+1,j) + alpha4(i+1,j) )
 !     localized at point  ... U (i,j) ...
-!
+
 !    masseby(i,j) = masse(i,j  ) * ( alpha2(i,j  ) + alpha3(i,j  )  +
 !                   masse(i,j+1) * ( alpha1(i,j+1) + alpha4(i,j+1)  
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbarxy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbarxy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massbarxy.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE massbarxy(masse,massebxy)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massdair.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massdair.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/massdair.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE massdair( p, masse )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrad.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrad.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrad.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE nxgrad (klevel, rot, x, y )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrad_gam.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrad_gam.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrad_gam.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE nxgrad_gam( klevel, rot, x, y )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgradst.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgradst.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgradst.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE nxgradst (klevel,rot, x, y )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgraro2.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgraro2.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgraro2.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
        SUBROUTINE nxgraro2 (klevel,xcov, ycov, lr, grx, gry )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrarot.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrarot.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/nxgrarot.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE nxgrarot (klevel,xcov, ycov, lr, grx, gry )
 c   ***********************************************************
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pbar.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pbar.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pbar.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE pbar ( pext, pbarx, pbary, pbarxy )
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pentes_ini.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pentes_ini.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pentes_ini.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE pentes_ini (q,w,masse,pbaru,pbarv,mode)
       
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.F	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 cFrom lin@explorer.gsfc.nasa.gov Wed Apr 15 17:44:44 1998
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/prather.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/prather.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/prather.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE prather (q,w,masse,pbaru,pbarv,nt,dt)
       
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pression.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pression.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/pression.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE pression( ngrid, ap, bp, ps, p )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr.Hourdin 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/psextbar.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/psextbar.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/psextbar.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE psextbar ( ps, psexbarxy )
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotat.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotat.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotat.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE rotat (klevel, x, y, rot )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotat_nfil.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotat_nfil.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotat_nfil.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE rotat_nfil (klevel, x, y, rot )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotatf.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotatf.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotatf.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE rotatf (klevel, x, y, rot )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotatst.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotatst.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/rotatst.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE rotatst (klevel,x, y, rot )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/serre_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/serre_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/serre_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE serre_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/sortvarc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/sortvarc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/sortvarc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE sortvarc
      $(itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time ,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/test_period.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/test_period.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/test_period.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE test_period ( ucov, vcov, teta, q, p, phis )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/tourpot.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/tourpot.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/tourpot.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE tourpot ( vcov, ucov, massebxy, vorpot )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/traceurpole.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/traceurpole.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/traceurpole.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
           subroutine traceurpole(q,masse)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/tracstoke.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/tracstoke.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/tracstoke.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       common /tracstoke/istdyn,istphy,unittrac
       integer istdyn,istphy,unittrac
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 subroutine ugeostr(phi,ucov)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/vitvert.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/vitvert.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/vitvert.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE vitvert (convm, w)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/write_grads_dyn.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/write_grads_dyn.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/write_grads_dyn.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       if (callinigrads) then
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writehist.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writehist.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writehist.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       subroutine writehist(time,vcov,ucov,teta,phi,q,masse,ps,phis)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/abort_gcm.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/abort_gcm.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/abort_gcm.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: abort_gcm.F 1747 2013-04-23 14:06:30Z lguez $
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/addfi_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/addfi_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/addfi_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE addfi_loc(pdt, leapf, forward,
      S          pucov, pvcov, pteta, pq   , pps ,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advect_new_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advect_new_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advect_new_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE advect_new_loc(ucov,vcov,teta,w,massebx,masseby,
      &                        du,dv,dteta)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advtrac_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advtrac_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advtrac_loc.F90	(revision 5099)
@@ -4,10 +4,10 @@
 SUBROUTINE advtrac_loc(pbarug, pbarvg, wg, p, massem, q, teta, pk)
    !     Auteur :  F. Hourdin
-   !
+
    !     Modif. P. Le Van     (20/12/97)
    !            F. Codron     (10/99)
    !            D. Le Croller (07/2001)
    !            M.A Filiberti (04/2002)
-   !
+
    USE infotrac,     ONLY: nqtot, tracers
    USE control_mod,  ONLY: iapp_tracvl, day_step, planet_type
@@ -23,5 +23,5 @@
 
    IMPLICIT NONE
-   !
+
    include "dimensions.h"
    include "paramet.h"
@@ -122,5 +122,4 @@
 #endif
 
-!          
 !  CALL Register_Hallo_v(pbarvg,llm,1,1,1,1,TestRequest)
 !  CALL SendRequest(TestRequest)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
   module Bands
   USE parallel_lmdz
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bilan_dyn_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bilan_dyn_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bilan_dyn_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: bilan_dyn_p.F 1299 2010-01-20 14:27:21Z fairhead $
-!
+
       SUBROUTINE bilan_dyn_loc (ntrac,dt_app,dt_cum,
      s  ps,masse,pk,flux_u,flux_v,teta,phi,ucov,vcov,trac)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caladvtrac_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caladvtrac_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caladvtrac_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: caladvtrac_p.F 1299 2010-01-20 14:27:21Z fairhead $
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caldyn_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caldyn_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caldyn_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 #undef DEBUG_IO
 !#define DEBUG_IO
@@ -17,12 +17,12 @@
 
 !=======================================================================
-!
+
 !  Auteur :  P. Le Van
-!
+
 !   Objet:
 !   ------
-!
+
 !   Calcul des tendances dynamiques.
-!
+
 ! Modif 04/93 F.Forget
 !=======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/call_dissip_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/call_dissip_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/call_dissip_mod.F90	(revision 5099)
@@ -222,5 +222,4 @@
 !    .......        P. Le Van (  ajout  le 17/04/96  )   ...........
 !   ...      Calcul de la valeur moyenne, unique de h aux poles  .....
-!
 
     ijb=ij_begin
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas1_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas1_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas1_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE convmas1_loc (pbaru, pbarv, convm)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas2_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas2_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas2_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE convmas2_loc (convm)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/convmas_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE convmas_loc (pbaru, pbarv, convm)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/covnat_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/covnat_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/covnat_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE covnat_loc(klevel,ucov, vcov, unat, vnat )
       USE parallel_lmdz
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dissip_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dissip_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dissip_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
       SUBROUTINE dissip_loc( vcov,ucov,teta,p, dv,du,dh )
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE dynetat0_loc(fichnom,vcov,ucov,teta,q,masse,ps,phis,time)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , L.Fairhead
@@ -9,6 +9,6 @@
   USE infotrac,    ONLY: nqtot, tracers, niso, iqIsoPha, iH2O, isoName
   USE strings_mod, ONLY: maxlen, msg, strStack, real2str, int2str, strIdx
-  USE netcdf,      ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_INQUIRE_DIMENSION, NF90_INQ_VARID, &
-                         NF90_CLOSE, NF90_GET_VAR, NF90_INQUIRE_VARIABLE,  NF90_NoErr
+  USE netcdf,      ONLY: NF90_OPEN,  NF90_NOWRITE, nf90_inquire_dimension, NF90_INQ_VARID, &
+                         NF90_CLOSE, nf90_get_var, NF90_INQUIRE_VARIABLE,  nf90_noerr
   USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey
   USE control_mod, ONLY: planet_type
@@ -87,10 +87,10 @@
   pa         = tab_cntrl(idecal+13)
   preff      = tab_cntrl(idecal+14)
-!
+
   clon       = tab_cntrl(idecal+15)
   clat       = tab_cntrl(idecal+16)
   grossismx  = tab_cntrl(idecal+17)
   grossismy  = tab_cntrl(idecal+18)
-!
+
   IF ( tab_cntrl(idecal+19)==1. )  THEN
     fxyhypb  = .TRUE.
@@ -122,10 +122,10 @@
 
   var="temps"
-  IF(NF90_INQ_VARID(fID,var,vID)/=NF90_NoErr) THEN
+  IF(NF90_INQ_VARID(fID,var,vID)/=nf90_noerr) THEN
     CALL msg('missing field <temps> ; trying with <Time>', modname)
     var="Time"
     CALL err(NF90_INQ_VARID(fID,var,vID),"inq",var)
   END IF
-  CALL err(NF90_GET_VAR(fID,vID,time),"get",var)
+  CALL err(nf90_get_var(fID,vID,time),"get",var)
 
   ALLOCATE(phis_glo(ip1jmp1))
@@ -157,5 +157,5 @@
   ll = .FALSE.
 #ifdef REPROBUS
-  ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= NF90_NoErr                                 !--- DETECT OLD REPRO start.nc FILE
+  ll = NF90_INQ_VARID(fID, 'HNO3tot', vID) /= nf90_noerr                                 !--- DETECT OLD REPRO start.nc FILE
 #endif
   DO iq=1,nqtot
@@ -170,8 +170,8 @@
     END IF
     !--------------------------------------------------------------------------------------------------------------------------
-    IF(NF90_INQ_VARID(fID, var, vID) == NF90_NoErr .AND. .NOT.lSkip) THEN                !=== REGULAR CASE: AVAILABLE VARIABLE
+    IF(NF90_INQ_VARID(fID, var, vID) == nf90_noerr .AND. .NOT.lSkip) THEN                !=== REGULAR CASE: AVAILABLE VARIABLE
       CALL get_var2(var,q_glo); q(ijb_u:ije_u,:,iq)=q_glo(ijb_u:ije_u,:)
     !--------------------------------------------------------------------------------------------------------------------------
-    ELSE IF(NF90_INQ_VARID(fID, oldVar, vID) == NF90_NoErr) THEN                         !=== TRY WITH ALTERNATE NAME
+    ELSE IF(NF90_INQ_VARID(fID, oldVar, vID) == nf90_noerr) THEN                         !=== TRY WITH ALTERNATE NAME
       CALL msg('Tracer <'//TRIM(var)//'> is missing => initialized to <'//TRIM(oldVar)//'>', modname)
       CALL get_var2(oldVar, q_glo); q(ijb_u:ije_u,:,iq)=q_glo(ijb_u:ije_u,:)
@@ -241,15 +241,15 @@
   ierr=NF90_INQUIRE_VARIABLE(fID,vID,ndims=nd)
   IF(nd==1) THEN
-    CALL err(NF90_GET_VAR(fID,vID,v),"get",var); RETURN
+    CALL err(nf90_get_var(fID,vID,v),"get",var); RETURN
   END IF
   ierr=NF90_INQUIRE_VARIABLE(fID,vID,dimids=dids)
-  DO k=1,nd; ierr=NF90_INQUIRE_DIMENSION(fID,dids(k),len=nn(k)); END DO
+  DO k=1,nd; ierr=nf90_inquire_dimension(fID,dids(k),len=nn(k)); END DO
   ntot=PRODUCT(nn(1:nd))
   SELECT CASE(nd)
     CASE(2); ALLOCATE(w2(nn(1),nn(2)))
-      CALL err(NF90_GET_VAR(fID,vID,w2),"get",var)
+      CALL err(nf90_get_var(fID,vID,w2),"get",var)
       v=RESHAPE(w2,[ntot]); DEALLOCATE(w2)
     CASE(3); ALLOCATE(w3(nn(1),nn(2),nn(3)))
-      CALL err(NF90_GET_VAR(fID,vID,w3),"get",var)
+      CALL err(nf90_get_var(fID,vID,w3),"get",var)
       v=RESHAPE(w3,[ntot]); DEALLOCATE(w3)
   END SELECT
@@ -267,16 +267,16 @@
 
   IF(nd==1) THEN
-    CALL err(NF90_GET_VAR(fID,vID,v),"get",var); RETURN
+    CALL err(nf90_get_var(fID,vID,v),"get",var); RETURN
   END IF
   ierr=NF90_INQUIRE_VARIABLE(fID,vID,dimids=dids)
 
-  DO k=1,nd; ierr=NF90_INQUIRE_DIMENSION(fID,dids(k),len=nn(k)); END DO
+  DO k=1,nd; ierr=nf90_inquire_dimension(fID,dids(k),len=nn(k)); END DO
 
   SELECT CASE(nd)
   CASE(3); ALLOCATE(w3(nn(1),nn(2),nn(3)))
-     CALL err(NF90_GET_VAR(fID,vID,w3),"get",var)
+     CALL err(nf90_get_var(fID,vID,w3),"get",var)
      v=RESHAPE(w3,[nn(1)*nn(2),nn(3)]); DEALLOCATE(w3)
   CASE(4);  ALLOCATE(w4(nn(1),nn(2),nn(3),nn(4)))
-     CALL err(NF90_GET_VAR(fID,vID,w4),"get",var)
+     CALL err(nf90_get_var(fID,vID,w4),"get",var)
      v=RESHAPE(w4,[nn(1)*nn(2),nn(3)]); DEALLOCATE(w4)
   END SELECT
@@ -288,5 +288,5 @@
   CHARACTER(LEN=*), INTENT(IN) :: typ    !--- TYPE OF OPERATION
   CHARACTER(LEN=*), INTENT(IN) :: nam    !--- FIELD/FILE NAME
-  IF(ierr==NF90_NoERR) RETURN
+  IF(ierr==nf90_noerr) RETURN
   SELECT CASE(typ)
     CASE('inq');   mesg="Field <"//TRIM(nam)//"> is missing"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE dynredem0_loc(fichnom,iday_end,phis)
-!
+
 !-------------------------------------------------------------------------------
 ! Write the NetCDF restart file (initialization).
@@ -89,5 +89,5 @@
   tab_cntrl(22) = grossismx
   tab_cntrl(23) = grossismy
-!
+
   IF ( fxyhypb )   THEN
     tab_cntrl(24) = 1.
@@ -162,12 +162,12 @@
 
 END SUBROUTINE dynredem0_loc
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE dynredem1_loc(fichnom,time,vcov,ucov,teta,q,masse,ps)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Write the NetCDF restart file (append).
@@ -178,6 +178,6 @@
   USE infotrac, ONLY: nqtot, tracers, type_trac
   USE control_mod
-  USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, NF90_GET_VAR, NF90_INQ_VARID,  &
-                      NF90_CLOSE, NF90_WRITE,   NF90_PUT_VAR, NF90_NoErr
+  USE netcdf,   ONLY: NF90_OPEN,  NF90_NOWRITE, nf90_get_var, NF90_INQ_VARID,  &
+                      NF90_CLOSE, NF90_WRITE,   NF90_PUT_VAR, nf90_noerr
   USE dynredem_mod, ONLY: dynredem_write_u, dynredem_write_v, dynredem_read_u, &
                           err, modname, fil, msg
@@ -225,5 +225,5 @@
   var="controle"
   CALL err(NF90_INQ_VARID(nid,var,vID),"inq",var)
-  CALL err(NF90_GET_VAR(nid,vID,tab_cntrl),"get",var)
+  CALL err(nf90_get_var(nid,vID,tab_cntrl),"get",var)
   tab_cntrl(31)=DBLE(itau_dyn + itaufin)
   CALL err(NF90_INQ_VARID(nid,var,vID),"inq",var)
@@ -254,9 +254,9 @@
       fil="start_trac.nc"
       ierr=NF90_INQ_VARID(nid_trac,var,vID_trac)
-      dum='inq'; IF(ierr==NF90_NoErr) dum='fnd'
+      dum='inq'; IF(ierr==nf90_noerr) dum='fnd'
       WRITE(lunout,*)msg(dum,var)
 !$OMP END MASTER
 !$OMP BARRIER
-      IF(ierr==NF90_NoErr) CALL dynredem_read_u(nid_trac,var,q(:,:,iq),llm)
+      IF(ierr==nf90_noerr) CALL dynredem_read_u(nid_trac,var,q(:,:,iq),llm)
     END IF
     fil=fichnom
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_mod.F90	(revision 5099)
@@ -18,7 +18,7 @@
 
 !===============================================================================
-!
+
 SUBROUTINE dynredem_write_u(ncid,id,var,ll)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -63,12 +63,12 @@
   
 END SUBROUTINE dynredem_write_u
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE dynredem_write_v(ncid,id,var,ll)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -113,12 +113,12 @@
   
 END SUBROUTINE dynredem_write_v
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE dynredem_read_u(ncid,id,var,ll)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -149,5 +149,5 @@
     !$OMP MASTER
       start(3)=l
-      CALL err(NF90_GET_VAR(ncid,nvarid,var_glo,start,count),"get",id)
+      CALL err(nf90_get_var(ncid,nvarid,var_glo,start,count),"get",id)
     !$OMP END MASTER
     END IF
@@ -165,12 +165,12 @@
   
 END SUBROUTINE dynredem_read_u    
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE cre_var(ncid,var,title,did,units)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -187,12 +187,12 @@
 
 END SUBROUTINE cre_var
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE put_var(ncid,var,title,did,v,units)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -210,17 +210,17 @@
   CALL err(NF90_ENDDEF(ncid))
   nd=SIZE(did)
-  DO k=1,nd; CALL err(NF90_INQUIRE_DIMENSION(ncid,did(k),len=nn(k))); END DO
+  DO k=1,nd; CALL err(nf90_inquire_dimension(ncid,did(k),len=nn(k))); END DO
   IF(nd==1) CALL err(NF90_PUT_VAR(ncid,nvarid,RESHAPE(v,nn(1:1))),var)
   IF(nd==2) CALL err(NF90_PUT_VAR(ncid,nvarid,RESHAPE(v,nn(1:2))),var)
   CALL err(NF90_REDEF(ncid))
 END SUBROUTINE put_var
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 FUNCTION msg(typ,nam)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -242,12 +242,12 @@
 
 END FUNCTION msg
-!
-!===============================================================================
-
-
-!===============================================================================
-!
+
+!===============================================================================
+
+
+!===============================================================================
+
 SUBROUTINE err(ierr,typ,nam)
-!
+
 !===============================================================================
   IMPLICIT NONE
@@ -258,5 +258,5 @@
   CHARACTER(LEN=*), OPTIONAL, INTENT(IN) :: nam    !--- FIELD NAME
 !===============================================================================
-  IF(ierr==NF90_NoERR) RETURN
+  IF(ierr==nf90_noerr) RETURN
   IF(.NOT.PRESENT(typ)) THEN
     CALL ABORT_gcm(modname,NF90_STRERROR(ierr),ierr)
@@ -266,5 +266,5 @@
 
 END SUBROUTINE err
-!
+
 !===============================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/enercin_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/enercin_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/enercin_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE enercin_loc ( vcov, ucov, vcont, ucont, ecin )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van.
@@ -21,17 +21,17 @@
 !                 . V
 !                i,j-1
-!
+
 !      alpha4 .       . alpha1
-!
-!
+
+
 !        U .      . P     . U
 !       i-1,j    i,j      i,j
-!
+
 !      alpha3 .       . alpha2
-!
-!
+
+
 !                 . V
 !                i,j
-!
+
 ! Kinetic energy at scalar point P(i,j) (excluding poles) is:
 !       Ecin = 0.5 * U(i-1,j)**2 *( alpha3 + alpha4 )  +
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/exner_hyb_loc_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/exner_hyb_loc_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/exner_hyb_loc_m.F90	(revision 5099)
@@ -9,8 +9,8 @@
     !     Auteurs :  P.Le Van  , Fr. Hourdin  .
     !    ..........
-    !
+
     !    ....  ngrid, ps,p             sont des argum.d'entree  au sous-prog ...
     !    ....  pks,pk,pkf   sont des argum.de sortie au sous-prog ...
-    !
+
     !   ************************************************************************
     !    Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 
@@ -20,16 +20,16 @@
     !  .. N.B : Au sommet de l'atmosphere,  p(llm+1) = 0. , et ps et pks sont
     !    la pression et la fonction d'Exner  au  sol  .
-    !
+
     !                                 -------- z
     !    A partir des relations  ( 1 ) p*dz(pk) = kappa *pk*dz(p)      et
     !                            ( 2 ) pk(l) = alpha(l)+ beta(l)*pk(l-1)
     !    ( voir note de Fr.Hourdin )  ,
-    !
+
     !    on determine successivement , du haut vers le bas des couches, les 
     !    coef. alpha(llm),beta(llm) .,.,alpha(l),beta(l),,,alpha(2),beta(2), 
     !    puis pk(ij,1). Ensuite ,on calcule,du bas vers le haut des couches,  
     !     pk(ij,l)  donne  par la relation (2),  pour l = 2 a l = llm .
-    !
-    !
+
+
     USE parallel_lmdz
     USE mod_filtreg_p
@@ -39,5 +39,5 @@
     
     IMPLICIT NONE
-    !
+
     include "dimensions.h"
     include "paramet.h"
@@ -59,5 +59,5 @@
     !$OMP THREADPRIVATE(firstcall) 
     character(len=*),parameter :: modname="exner_hyb_loc"
-    !
+
     !$OMP BARRIER           
 
@@ -126,8 +126,8 @@
 
     !$OMP BARRIER
-    !
-    !
+
+
     !    .... Calcul des coeff. alpha et beta  pour la couche l = llm ..
-    !
+
     !$OMP DO SCHEDULE(STATIC)
     DO     ij      = ijb,ije
@@ -136,9 +136,9 @@
     ENDDO
     !$OMP ENDDO NOWAIT
-    !
+
     !     ... Calcul des coeff. alpha et beta  pour l = llm-1  a l = 2 ...
-    !
+
     DO l = llm -1 , 2 , -1
-       !
+
        !$OMP DO SCHEDULE(STATIC)
        DO ij = ijb, ije
@@ -152,5 +152,5 @@
     !  ***********************************************************************
     !     .....  Calcul de pk pour la couche 1 , pres du sol  ....
-    !
+
     !$OMP DO SCHEDULE(STATIC)
     DO   ij   = ijb, ije
@@ -159,7 +159,7 @@
     ENDDO
     !$OMP ENDDO NOWAIT
-    !
+
     !    ..... Calcul de pk(ij,l) , pour l = 2 a l = llm  ........
-    !
+
     DO l = 2, llm
        !$OMP DO SCHEDULE(STATIC)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/exner_milieu_loc_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/exner_milieu_loc_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/exner_milieu_loc_m.F90	(revision 5099)
@@ -6,12 +6,12 @@
 
   SUBROUTINE  exner_milieu_loc ( ngrid, ps, p, pks, pk, pkf )
-    !
+
     !     Auteurs :  F. Forget , Y. Wanherdrick
     ! P.Le Van  , Fr. Hourdin  .
     !    ..........
-    !
+
     !    ....  ngrid, ps,p             sont des argum.d'entree  au sous-prog ...
     !    ....  pks,pk,pkf   sont des argum.de sortie au sous-prog ...
-    !
+
     !   ************************************************************************
     !    Calcule la fonction d'Exner pk = Cp * (p/preff) ** kappa , aux milieux des 
@@ -21,5 +21,5 @@
     !  .. N.B : Au sommet de l'atmosphere,  p(llm+1) = 0. , et ps et pks sont
     !    la pression et la fonction d'Exner  au  sol  .
-    !
+
     !     WARNING : CECI est une version speciale de exner_hyb originale
     !               Utilise dans la version martienne pour pouvoir 
@@ -28,5 +28,5 @@
     !              energie totale/ interne / potentielle (F.Forget 2001)
     !    ( voir note de Fr.Hourdin )  ,
-    !
+
     USE parallel_lmdz
     USE mod_filtreg_p
@@ -35,5 +35,5 @@
     
     IMPLICIT NONE
-    !
+
     include "dimensions.h"
     include "paramet.h"
@@ -117,9 +117,9 @@
 
     !$OMP BARRIER
-    !
-    !
+
+
     !    .... Calcul de pk  pour la couche l 
     !    --------------------------------------------
-    !
+
     dum1 = cpp * (2*preff)**(-kappa) 
     DO l = 1, llm-1
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F	(revision 5099)
@@ -411,5 +411,5 @@
 
 !      DO j=1,nlat
-!     
+
 !          PRINT *,"check FFT ----> Delta(",j,")=",
 !     &            sum(champ(:,j,:)-champ_fft(:,j,:))/sum(champ(:,j,:)),
@@ -419,6 +419,5 @@
 !          PRINT *,"check FFT ----> Delta(",j,")=",
 !     &            sum(champ-champ_fft)/sum(champ)
-!      
-      
+
 c
  1111 FORMAT(//20x,'ERREUR dans le dimensionnement du tableau  CHAMP a 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/flumass_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/flumass_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/flumass_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE flumass_loc(massebx,masseby, vcont, ucont, pbaru, pbarv )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/fluxstokenc_p.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/fluxstokenc_p.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/fluxstokenc_p.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: caladvtrac_p.F 1299 2010-01-20 14:27:21Z fairhead $
-!
+
 c
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/friction_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/friction_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/friction_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: friction_p.F 1299 2010-01-20 14:27:21Z fairhead $
-!
+
 c=======================================================================
       SUBROUTINE friction_loc(ucov,vcov,pdt)
@@ -16,5 +16,5 @@
 
 !=======================================================================
-!
+
 !   Friction for the Newtonian case:
 !   --------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gcm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gcm.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gcm.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 PROGRAM gcm
@@ -36,15 +35,15 @@
 
   !=======================================================================
-  !
+
   !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
   !   -------
-  !
+
   !   Objet:
   !   ------
-  !
+
   !   GCM LMD nouvelle grille
-  !
+
   !=======================================================================
-  !
+
   !  ... Dans inigeom , nouveaux calculs pour les elongations  cu , cv
   !      et possibilite d'appeler une fonction f(y)  a derivee tangente
@@ -52,8 +51,8 @@
   !  ... Possibilite de choisir le schema pour l'advection de
   !        q  , en modifiant iadv dans traceur.def  (MAF,10/02) .
-  !
+
   !      Pour Van-Leer + Vapeur d'eau saturee, iadv(1)=4. (F.Codron,10/99)
   !      Pour Van-Leer iadv=10
-  !
+
   !-----------------------------------------------------------------------
   !   Declarations:
@@ -133,10 +132,10 @@
   !  lecture des fichiers gcm.def ou run.def
   !  ---------------------------------------
-  !
+
   CALL conf_gcm( 99, .TRUE. )
   if (mod(iphysiq, iperiod) /= 0) call abort_gcm("conf_gcm", &
        "iphysiq must be a multiple of iperiod", 1)
-  !
-  !
+
+
   !------------------------------------
   !   Initialisation partie parallele
@@ -270,7 +269,6 @@
   ENDIF
 
-  !
   ! on remet le calendrier \`a zero si demande
-  !
+
   IF (start_time /= starttime) then
      WRITE(lunout,*)' GCM: Attention l''heure de depart lue dans le' &
@@ -370,5 +368,5 @@
      CALL inifilr
   endif ! of if (iflag_phys.eq.1)
-  !
+
   !-----------------------------------------------------------------------
   !   Initialisation de la dissipation :
@@ -459,5 +457,5 @@
 
   ! #endif of #ifdef CPP_IOIPSL
-  !
+
   !-----------------------------------------------------------------------
   !   Integration temporelle du modele :
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/getparam.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/getparam.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/getparam.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: getparam.F90 1279 2009-12-10 09:02:56Z fairhead $
-!
+
 MODULE getparam
 #ifdef CPP_IOIPSL
@@ -20,7 +20,7 @@
   SUBROUTINE ini_getparam(fichier)
   USE parallel_lmdz
-    !
+
     IMPLICIT NONE
-    !
+
     CHARACTER*(*) :: fichier
     IF (mpi_rank==0) OPEN(out_eff,file=fichier,status='unknown',form='formatted')
@@ -30,7 +30,7 @@
   SUBROUTINE fin_getparam
   USE parallel_lmdz
-    !
+
     IMPLICIT NONE
-    !
+
       IF (mpi_rank==0) CLOSE(out_eff)
 
@@ -39,12 +39,12 @@
   SUBROUTINE getparamr(TARGET,def_val,ret_val,comment)
   USE parallel_lmdz
-    !
+
     IMPLICIT NONE
-    !
+
     !   Get a real scalar. We first check if we find it
     !   in the database and if not we get it from the run.def
-    !
+
     !   getinr1d and getinr2d are written on the same pattern
-    !
+
     CHARACTER*(*) :: TARGET
     REAL :: def_val
@@ -65,12 +65,12 @@
   SUBROUTINE getparami(TARGET,def_val,ret_val,comment)
   USE parallel_lmdz
-    !
+
     IMPLICIT NONE
-    !
+
     !   Get a real scalar. We first check if we find it
     !   in the database and if not we get it from the run.def
-    !
+
     !   getinr1d and getinr2d are written on the same pattern
-    !
+
     CHARACTER*(*) :: TARGET
     INTEGER :: def_val
@@ -92,12 +92,12 @@
   SUBROUTINE getparaml(TARGET,def_val,ret_val,comment)
   USE parallel_lmdz
-    !
+
     IMPLICIT NONE
-    !
+
     !   Get a real scalar. We first check if we find it
     !   in the database and if not we get it from the run.def
-    !
+
     !   getinr1d and getinr2d are written on the same pattern
-    !
+
     CHARACTER*(*) :: TARGET
     LOGICAL :: def_val
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gr_u_scal_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gr_u_scal_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gr_u_scal_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gr_u_scal_loc(nx,x_u,x_scal)
 c%W%    %G%
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gr_v_scal_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gr_v_scal_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gr_v_scal_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gr_v_scal_loc(nx,x_v,x_scal)
 c%W%    %G%
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/guide_loc_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/guide_loc_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/guide_loc_mod.F90	(revision 5099)
@@ -1653,5 +1653,5 @@
     
              status=nf90_inq_dimid(ncidu, "LONU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidu,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidu,dimid,namedim,lendim)
              IF (lendim /= iip1) THEN
                 abort_message='dimension LONU different from iip1 in u.nc'
@@ -1660,5 +1660,5 @@
 
              status=nf90_inq_dimid(ncidu, "LATU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidu,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidu,dimid,namedim,lendim)
              IF (lendim /= jjp1) THEN
                 abort_message='dimension LATU different from jjp1 in u.nc'
@@ -1684,5 +1684,5 @@
              
              status=nf90_inq_dimid(ncidv, "LONV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidv,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidv,dimid,namedim,lendim)
              
                 IF (lendim /= iip1) THEN
@@ -1693,5 +1693,5 @@
 
              status=nf90_inq_dimid(ncidv, "LATV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidv,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidv,dimid,namedim,lendim)
              IF (lendim /= jjm) THEN
                 abort_message='dimension LATV different from jjm in v.nc'
@@ -1717,5 +1717,5 @@
 
              status=nf90_inq_dimid(ncidt, "LONV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidt,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidt,dimid,namedim,lendim)
              IF (lendim /= iip1) THEN
                 abort_message='dimension LONV different from iip1 in T.nc'
@@ -1724,5 +1724,5 @@
 
              status=nf90_inq_dimid(ncidt, "LATU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidt,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidt,dimid,namedim,lendim)
              IF (lendim /= jjp1) THEN
                 abort_message='dimension LATU different from jjp1 in T.nc'
@@ -1749,5 +1749,5 @@
 
              status=nf90_inq_dimid(ncidQ, "LONV", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidQ,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidQ,dimid,namedim,lendim)
              IF (lendim /= iip1) THEN
                 abort_message='dimension LONV different from iip1 in hur.nc'
@@ -1756,5 +1756,5 @@
 
              status=nf90_inq_dimid(ncidQ, "LATU", dimid)
-             status=NF90_INQUIRE_DIMENSION(ncidQ,dimid,namedim,lendim)
+             status=nf90_inquire_dimension(ncidQ,dimid,namedim,lendim)
              IF (lendim /= jjp1) THEN
                 abort_message='dimension LATU different from jjp1 in hur.nc'
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/iniacademic_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/iniacademic_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/iniacademic_loc.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: iniacademic.F90 1625 2012-05-09 13:14:48Z lguez $
-!
+
 SUBROUTINE iniacademic_loc(vcov,ucov,teta,q,masse,ps,phis,time_0)
 
@@ -23,5 +23,5 @@
   USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
   USE readTracFiles_mod, ONLY: addPhase
-  use netcdf, only : NF90_NOWRITE,NF90_OPEN,NF90_NOERR,NF90_INQ_VARID,NF90_CLOSE, NF90_GET_VAR
+  use netcdf, only : NF90_NOWRITE,NF90_OPEN,nf90_noerr,NF90_INQ_VARID,NF90_CLOSE, nf90_get_var
 
   !   Author:    Frederic Hourdin      original: 15/01/93
@@ -100,5 +100,5 @@
   ! 1. Initializations for Earth-like case
   ! --------------------------------------
-  !
+
   ! initialize planet radius, rotation rate,...
   call conf_planete
@@ -153,8 +153,8 @@
      relief=0.
      ierr = NF90_OPEN ('relief_in.nc', NF90_NOWRITE,nid_relief)
-     if (ierr==NF90_NOERR) THEN
+     if (ierr==nf90_noerr) THEN
          ierr=NF90_INQ_VARID(nid_relief,'RELIEF',varid)
-         if (ierr==NF90_NOERR) THEN
-              ierr=NF90_GET_VAR(nid_relief,varid,relief(1:iim,1:jjp1))
+         if (ierr==nf90_noerr) THEN
+              ierr=nf90_get_var(nid_relief,varid,relief(1:iim,1:jjp1))
               relief(iip1,:)=relief(1,:)
          else
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: initdynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
-!
+
       subroutine initdynav_loc(day0,anne0,tstep,t_ops,t_wrt)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       subroutine initfluxsto_p
      .  (infile,tstep,t_ops,t_wrt,
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: initdynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
-!
+
       subroutine inithist_loc(day0,anne0,tstep,t_ops,t_wrt)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/integrd_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/integrd_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/integrd_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: integrd_p.F 1299 2010-01-20 14:27:21Z fairhead $
-!
+
       SUBROUTINE integrd_loc
      $  (  nq,vcovm1,ucovm1,tetam1,psm1,massem1,
@@ -234,5 +234,5 @@
 !      ijb=ij_begin
 !      ije=ij_end
-!      
+
 !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK) 
 !      DO  l = 1,llm
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-! 
+
 ! $Id$
-!
+
 c
 c
@@ -256,5 +256,5 @@
 !$OMP MASTER
       if (firstcall) then
-!      
+
 !      ALLOCATE(p(ijb_u:ije_u,llmp1))
 !      ALLOCATE(pks(ijb_u:ije_u))
@@ -579,10 +579,10 @@
 !         call Register_SwapFieldHallo(finvmaold,finvmaold,ip1jmp1,llm,
 !     &                                jj_Nb_caldyn,0,0,TestRequest)
-! 
+
 !        do j=1,nqtot
 !         call Register_SwapFieldHallo(q(:,:,j),q(:,:,j),ip1jmp1,llm,
 !     &                                jj_nb_caldyn,0,0,TestRequest)
 !        enddo
-!
+
 !         call Set_Distrib(distrib_caldyn)
 !         call SendRequest(TestRequest)
@@ -864,5 +864,5 @@
 
 ! c  Diagnostique de conservation de l'energie : initialisation
-!  
+
 ! c-jld
 ! c$OMP BARRIER
@@ -879,8 +879,8 @@
 ! #endif
 !         call SetTag(Request_physic,800)
-!         
+
 !         call Register_SwapField_u(ucov,ucov,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_v(vcov,vcov,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
@@ -888,5 +888,5 @@
 !         call Register_SwapField_u(teta,teta,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_u(masse,masse,distrib_physic,
 !      *                            Request_physic,up=1,down=2)
@@ -894,17 +894,17 @@
 !         call Register_SwapField_u(p,p,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_u(pk,pk,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_u(phis,phis,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_u(phi,phi,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_u(w,w,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call Register_SwapField_u(q,q,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
@@ -912,5 +912,5 @@
 !         call Register_SwapField_u(flxw,flxw,distrib_physic,
 !      *                            Request_physic,up=2,down=2)
-!         
+
 !         call SendRequest(Request_Physic)
 ! c$OMP BARRIER
@@ -921,5 +921,5 @@
 !         call Set_Distrib(distrib_Physic)
 !         call VTe(VThallo)
-!         
+
 !         call VTb(VTphysiq)
 ! c$OMP END MASTER
@@ -1080,11 +1080,11 @@
 !         call Register_SwapField_u(ucov,ucov,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_v(vcov,vcov,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_u(teta,teta,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_u(masse,masse,
 !      *                               distrib_caldyn,Request_physic)
@@ -1092,14 +1092,14 @@
 !         call Register_SwapField_u(p,p,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_u(pk,pk,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_u(phis,phis,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_u(phi,phi,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call Register_SwapField_u(w,w,
 !      *                               distrib_caldyn,Request_physic)
@@ -1107,5 +1107,5 @@
 !         call Register_SwapField_u(q,q,
 !      *                               distrib_caldyn,Request_physic)
-!         
+
 !         call SendRequest(Request_Physic)
 ! c$OMP BARRIER
@@ -1226,5 +1226,5 @@
 !c$OMP MASTER
 !        call suspend_timer(timer_caldyn)
-!        
+
 !c       print*,'Entree dans la dissipation : Iteration No ',true_itau
 !c   calcul de l'energie cinetique avant dissipation
@@ -1277,7 +1277,7 @@
 !        call WriteField_u('dtetadis',dtetadis)
 !#endif
-! 
+
 !!      CALL FTRACE_REGION_END("dissip")
-!         
+
 !        ijb=ij_begin
 !        ije=ij_end
@@ -1318,5 +1318,5 @@
 !            call covcont_loc(llm,ucov,vcov,ucont,vcont)
 !            call enercin_loc(vcov,ucov,vcont,ucont,ecin)
-!            
+
 !            ijb=ij_begin
 !            ije=ij_end
@@ -1349,5 +1349,5 @@
 !        ijb=ij_begin
 !        ije=ij_end
-!         
+
 !        if (pole_nord) then
 !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -1369,5 +1369,5 @@
 !          ENDDO
 !            tpn  = SSUM(iim,tppn,1)/apoln
-!  
+
 !          DO ij = 1, iip1
 !            ps(  ij    ) = tpn
@@ -1375,5 +1375,5 @@
 !c$OMP END MASTER
 !        endif
-!        
+
 !        if (pole_sud) then
 !c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -1395,5 +1395,5 @@
 !          ENDDO
 !            tps  = SSUM(iim,tpps,1)/apols
-!  
+
 !          DO ij = 1, iip1
 !            ps(ij+ip1jm) = tps
@@ -1408,5 +1408,5 @@
 
 !        call stop_timer(timer_dissip)
-!        
+
 !        call VTb(VThallo)
 !c$OMP END MASTER
@@ -1738,5 +1738,5 @@
 !             iday = day_ini+itau/day_step
 !             time = REAL(itau-(iday-day_ini)*day_step)/day_step+time_0
-!
+
 !                  IF(time.GT.1.) THEN
 !                   time = time-1.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/lmdz_call_calfis.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/lmdz_call_calfis.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/lmdz_call_calfis.F90	(revision 5099)
@@ -129,8 +129,5 @@
 #endif
 
-!
 !     .......   Ajout   P.Le Van ( 17/04/96 )   ...........
-!
-
 
   !$OMP MASTER
@@ -390,5 +387,4 @@
   !$OMP BARRIER
 
-!
 !  Diagnostique de conservation de l'energie : difference
     IF (ip_ebil_dyn>=1 ) THEN
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/logic_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/logic_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/logic_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 MODULE logic_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbar_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbar_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbar_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE massbar_loc(masse,massebx,masseby)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
@@ -23,28 +23,28 @@
 !    * alpha4(i,j) at point ( i-1/4,j-1/4 )
 ! where alpha1(i,j) = aire(i+1/4,j-1/4)/ aire(i,j)
-!
+
 !   alpha4 .         . alpha1    . alpha4
 !    (i,j)             (i,j)       (i+1,j)
-!
+
 !             P .        U .          . P
 !           (i,j)       (i,j)         (i+1,j)
-!
+
 !   alpha3 .         . alpha2    .alpha3 
 !    (i,j)              (i,j)     (i+1,j)
-!
+
 !             V .        Z .          . V
 !           (i,j)
-!
+
 !   alpha4 .         . alpha1    .alpha4
 !   (i,j+1)            (i,j+1)   (i+1,j+1) 
-!
+
 !             P .        U .          . P
 !          (i,j+1)                    (i+1,j+1)
-!
-!
+
+
 !    massebx(i,j) = masse(i  ,j) * ( alpha1(i  ,j) + alpha2(i,j))   +
 !                   masse(i+1,j) * ( alpha3(i+1,j) + alpha4(i+1,j) )
 !     localized at point  ... U (i,j) ...
-!
+
 !    masseby(i,j) = masse(i,j  ) * ( alpha2(i,j  ) + alpha3(i,j  )  +
 !                   masse(i,j+1) * ( alpha1(i,j+1) + alpha4(i,j+1)  
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbarxy_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbarxy_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/massbarxy_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE massbarxy_loc(masse,massebxy)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_const_mpi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_const_mpi.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_const_mpi.F90	(revision 5099)
@@ -1,5 +1,5 @@
-! 
+
 ! $Id: mod_const_para.F90 1279 2009-12-10 09:02:56Z fairhead $
-!
+
 MODULE mod_const_mpi
   IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_filtreg_p.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_filtreg_p.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_filtreg_p.F	(revision 5099)
@@ -420,5 +420,5 @@
 
 !      DO j=1,nlat
-!     
+
 !          PRINT *,"check FFT ----> Delta(",j,")=",
 !     &            sum(champ(:,j,:)-champ_fft(:,j,:))/sum(champ(:,j,:)),
@@ -428,6 +428,5 @@
 !          PRINT *,"check FFT ----> Delta(",j,")=",
 !     &            sum(champ-champ_fft)/sum(champ)
-!      
-      
+
 c
  1111 FORMAT(//20x,'ERREUR dans le dimensionnement du tableau  CHAMP a 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_xios_dyn3dmem.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_xios_dyn3dmem.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_xios_dyn3dmem.F90	(revision 5099)
@@ -1,15 +1,14 @@
-!
+
 ! $Id$
-!
+
 ! This module contains the interface between the LMDZ dynamics dyn3dmem module and XIOS.
-! 
+
 ! Lists of subroutines
 !      xios_dyn3dmem_init : context / calendar / domain / axis initialisations
-!
+
 ! Initialisation of communicator between LMDZ and XIOS is done elsewhere: wxios_init called by init_const_mpi 
 !                                                                         (one of the first calls in gcm.F90)
 ! L. Fairhead 11/2017
-!
-!
+
 
 MODULE mod_xios_dyn3dmem
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/parallel_lmdz.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/parallel_lmdz.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/parallel_lmdz.F90	(revision 5099)
@@ -1,5 +1,5 @@
-! 
+
 ! $Id$
-!
+
   MODULE parallel_lmdz
   USE mod_const_mpi
@@ -742,13 +742,13 @@
 !      INCLUDE "dimensions.h"
 !      INCLUDE "paramet.h"    
-!    
+
 !      INTEGER :: ij,ll
 !      REAL, dimension(ij,ll) :: Field
 !      INTEGER :: up,down 
-!      
+
 !      REAL,dimension(ij,ll): NewField
-!      
+
 !      NewField=0
-!      
+
 !      ijb=ij_begin
 !      ije=ij_end
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/paramet.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/paramet.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/paramet.h	(revision 5099)
@@ -1,12 +1,12 @@
-!
+
 ! $Id$
-!
-!
+
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez  n'utiliser que des ! pour les commentaires
 !                 et  bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
-!
+
+
 !-----------------------------------------------------------------------
 !   INCLUDE 'paramet.h'
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/qminimum_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/qminimum_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/qminimum_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !     $Id$
-!
+
       SUBROUTINE qminimum_loc( q,nqtot,deltap )
       USE parallel_lmdz
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/sw_case_williamson91_6_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/sw_case_williamson91_6_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/sw_case_williamson91_6_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
       SUBROUTINE sw_case_williamson91_6_loc(vcov,ucov,teta,masse,ps)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/temps_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/temps_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/temps_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: temps_mod.F90 -1   $
-!
+
 MODULE temps_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/top_bound_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/top_bound_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/top_bound_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
       SUBROUTINE top_bound_loc(vcov,ucov,teta,masse,dt)
       USE parallel_lmdz
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/tourpot_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/tourpot_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/tourpot_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE tourpot_loc ( vcov, ucov, massebxy, vorpot )
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vitvert_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vitvert_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vitvert_loc.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE vitvert_loc(convm, w)
-!
+
 !-------------------------------------------------------------------------------
 ! Authors: P. Le Van , Fr. Hourdin.
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       RECURSIVE SUBROUTINE vlx_loc(q,pente_max,masse,u_m,ijb_x,ije_x,iq)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F	(revision 5099)
@@ -1,6 +1,5 @@
 
-!     
 ! $Header$
-!
+
        SUBROUTINE vlspltgen_loc( q,pente_max,masse,w,pbaru,pbarv,
      &                           pdt, p,pk,teta                 )
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !     $Id$
-!
+
       SUBROUTINE vlxqs_loc(q,pente_max,masse,u_m,qsat,ijb_x,ije_x,iq)
 c
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/wrgrads.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/wrgrads.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/wrgrads.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       subroutine wrgrads(if,nl,field,name,titlevar)
       implicit none
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90	(revision 5099)
@@ -1,5 +1,5 @@
 
 ! $Id$
-!
+
       SUBROUTINE writedyn_xios( vcov, ucov,teta,ppk,phi,q, &
                              masse,ps,phis)
@@ -15,8 +15,8 @@
       
       implicit none
-!
+
 !   Ecriture du fichier histoire au format xios
-!
-!
+
+
 !   Entree:
 !      vcov: vents v covariants
@@ -28,9 +28,9 @@
 !      ps   :pression au sol
 !      phis : geopotentiel au sol
-!      
+
 !   L. Fairhead, LMD, 03/21
-!
+
 ! =====================================================================
-!
+
 !   Declarations
       include "dimensions.h"
@@ -40,7 +40,5 @@
       include "iniprint.h"
 
-!
 !   Arguments
-!
 
       REAL vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm) 
@@ -54,5 +52,5 @@
 
 !   Variables locales
-!
+
       INTEGER,SAVE,ALLOCATABLE :: ndex2d(:),ndexu(:),ndexv(:)
       INTEGER :: iq, ii, ll
@@ -68,7 +66,5 @@
 !$OMP THREADPRIVATE(first)
 
-!
 !  Initialisations
-!
 
 !      WRITE(*,*)'IN WRITEDYN_XIOS'
@@ -103,9 +99,8 @@
       call covnat_loc(llm, ucov, vcov, unat, vnat)
 
-!
 !  Appels a histwrite pour l'ecriture des variables a sauvegarder
-!
+
 !  Vents U
-!
+
       ijb=ij_begin
       ije=ij_end
@@ -114,7 +109,6 @@
       CALL writefield_dyn_u('U', unat(ijb:ije,:))
 
-!
 !  Vents V
-!
+
       ije=ij_end
       IF (pole_sud) THEN
@@ -130,10 +124,7 @@
          CALL writefield_dyn_v('V', vbuffer(ijb:ije,:))
       ENDIF
-      
 
-      
-!
 !  Temperature potentielle moyennee
-!
+
       ijb=ij_begin
       ije=ij_end
@@ -141,7 +132,5 @@
      CALL writefield_dyn_u('THETA', teta(ijb:ije,:))
 
-!
 !  Temperature moyennee
-!
 
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)       
@@ -154,27 +143,19 @@
       CALL writefield_dyn_u('TEMP', tm(ijb:ije,:))
 
+!  Geopotentiel
 
-!
-!  Geopotentiel
-!
       CALL writefield_dyn_u('PHI', phi(ijb:ije,:))
 
+! Tracers?
 
-!
-! Tracers?
-!
 !        DO iq=1,nqtot
 !        ENDDO
 
+!  Masse
 
-!
-!  Masse
-!
       CALL writefield_dyn_u('MASSE', masse(ijb:ije,:))
 
+!  Pression au sol
 
-!
-!  Pression au sol
-!
       CALL writefield_dyn_u('PS', ps(ijb:ije))
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: writedynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
-!
+
       subroutine writedynav_loc( time, vcov, ucov,teta,ppk,phi,q,
      .                           masse,ps,phis)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: writedynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
-!
+
       subroutine writehist_loc( time, vcov, ucov,teta,ppk,phi,q,
      .                          masse,ps,phis)
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 C
 C
@@ -492,7 +492,7 @@
      &                   flxwfi,pducov,
      &                   zdufi,zdvfi,zdtfi,zdqfi,zdpsrf)
-!
+
 !      else if ( planet_type=="generic" ) then
-!
+
 !         CALL physiq (ngridmx,     !! ngrid
 !     .             llm,            !! nlayer
@@ -518,5 +518,5 @@
 !     .             zdpsrf,         !! pdpsrf
 !     .             tracerdyn)      !! tracerdyn <-- utilite ???
-!
+
 !      endif ! of if (planet_type=="earth")
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/gr_dyn_fi.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/gr_dyn_fi.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/gr_dyn_fi.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gr_dyn_fi(nfield,im,jm,ngrid,pdyn,pfi)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/gr_fi_dyn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/gr_fi_dyn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/gr_fi_dyn.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE gr_fi_dyn(nfield,ngrid,im,jm,pfi,pdyn)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90	(revision 5099)
@@ -1,6 +1,6 @@
 !*******************************************************************************
-!
+
 MODULE grid_atob_m
-!
+
 !*******************************************************************************
 
@@ -13,7 +13,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE fine2coarse(x_i, y_i, x_o, y_o, d_o1, d_i, msk, d_o2)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -103,12 +103,12 @@
 
 END SUBROUTINE fine2coarse
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE grille_m(xdata, ydata, entree, x, y, sortie)
-!
+
 !-------------------------------------------------------------------------------
 ! Author:  Z.X. Li (april 1st 1994) (see also A. Harzallah and L. Fairhead)
@@ -118,5 +118,5 @@
 !   surrounding the considered new point.
 !   No ponderation is used (see grille_p)
-!
+
 !           (c)
 !        ----d-----
@@ -128,5 +128,5 @@
 !        ----c-----
 !           (d)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -141,12 +141,12 @@
 
 END SUBROUTINE grille_m
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE rugosite(xdata, ydata, entree, x, y, sortie, mask)
-!
+
 !-------------------------------------------------------------------------------
 ! Author:  Z.X. Li (april 1st 1994)
@@ -172,12 +172,12 @@
 
 END SUBROUTINE rugosite
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE sea_ice(xdata, ydata, glace01, x, y, frac_ice)
-!
+
 !-------------------------------------------------------------------------------
 ! Author:  Z.X. Li (april 1st 1994)
@@ -197,12 +197,12 @@
 
 END SUBROUTINE sea_ice
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE rugsoro(xrel, yrel, relief, xmod, ymod, rugs)
-!
+
 !-------------------------------------------------------------------------------
 ! Author:  Z.X. Li (april 1st 1994) ; Modifications: august 23rd 1995.
@@ -253,9 +253,9 @@
 
 END SUBROUTINE rugsoro
-!
+
 !-------------------------------------------------------------------------------
 
 END MODULE grid_atob_m
-!
+
 !*******************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/inigeomphy_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/inigeomphy_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/inigeomphy_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 MODULE inigeomphy_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90	(revision 5099)
@@ -52,13 +52,13 @@
 
     !=======================================================================
-    !
+
     !   1. rearrangement des tableaux et transformation
     !  variables dynamiques  >  variables physiques
     !   2. calcul des termes physiques
     !   3. retransformation des tendances physiques en tendances dynamiques
-    !
+
     !   remarques:
     !   ----------
-    !
+
     !    - les vents sont donnes dans la physique par leurs composantes
     !  naturelles.
@@ -76,5 +76,5 @@
     !      ngridmx pour le pole sud
     !  ---> ngridmx=2+(jjm-1)*iim
-    !
+
     ! Input :
     ! -------
@@ -87,5 +87,5 @@
     !   pts             surface temperature  (K)
     !   callrad         clef d'appel au rayonnement
-    !
+
     !    Output :
     !    --------
@@ -94,12 +94,12 @@
     !    pdhfi          tendency for the potential temperature
     !    pdtsfi         tendency for the surface temperature
-    !
+
     !    pdtrad         radiative tendencies  \  both input
     !    pfluxrad       radiative fluxes      /  and output
-    !
+
     !=======================================================================
-    !
+
     !-----------------------------------------------------------------------
-    !
+
     !    0.  Declarations :
     !    ------------------
@@ -151,13 +151,13 @@
   REAL,ALLOCATABLE,SAVE :: zplev(:,:),zplay(:,:)
   REAL,ALLOCATABLE,SAVE :: zphi(:,:),zphis(:)
-  !
+
   REAL :: zrot(iip1,jjb_v:jje_v,llm) ! AdlC May 2014
   REAL,ALLOCATABLE,SAVE :: zufi(:,:), zvfi(:,:), zrfi(:,:)
   REAL,ALLOCATABLE,SAVE :: ztfi(:,:),zqfi(:,:,:)
   REAL,ALLOCATABLE,SAVE ::  zpk(:,:)
-  !
+
   REAL,ALLOCATABLE,SAVE :: pcvgu(:,:), pcvgv(:,:)
   REAL,ALLOCATABLE,SAVE :: pcvgt(:,:), pcvgq(:,:,:)
-  !
+
   REAL,ALLOCATABLE,SAVE :: zdufi(:,:),zdvfi(:,:)
   REAL,ALLOCATABLE,SAVE :: zdtfi(:,:),zdqfi(:,:,:)
@@ -165,5 +165,4 @@
   REAL,SAVE,ALLOCATABLE ::  flxwfi(:,:)     ! Flux de masse verticale sur la grille physiq
 
-  !
   REAL,ALLOCATABLE,SAVE :: zplev_omp(:,:)
   REAL,ALLOCATABLE,SAVE :: zplay_omp(:,:)
@@ -195,5 +194,4 @@
   ! J'ai suivi le même principe pour les zdufic_omp
   ! Mais c'est surement bien que tu controles.
-  !
 
   REAL,ALLOCATABLE,SAVE :: zdufic_omp(:,:)
@@ -218,5 +216,5 @@
   REAL :: zsinbis(iim),zcosbis(iim),z1bis(iim)
   REAL :: unskap, pksurcp
-  !
+
   REAL :: SSUM
 
@@ -235,14 +233,11 @@
     IF (CPPKEY_PHYS) THEN
 
-  !
   !-----------------------------------------------------------------------
-  !
+
   !    1. Initialisations :
   !    --------------------
-  !
 
   klon=klon_mpi
 
-  !
   IF ( firstcal )  THEN
     debut = .TRUE.
@@ -275,6 +270,5 @@
   ENDIF
 
-  !
-  !
+
   !-----------------------------------------------------------------------
   !   40. transformation des variables dynamiques en variables physiques:
@@ -300,5 +294,5 @@
 
   !   42. pression intercouches :
-  !
+
   !   -----------------------------------------------------------------
   ! .... zplev  definis aux (llm +1) interfaces des couches  ....
@@ -307,7 +301,7 @@
 
   !    ...    Exner = cp * ( p(l) / preff ) ** kappa     ....
-  !
+
    unskap   = 1./ kappa
-  !
+
   !  print *,omp_rank,'klon--->',klon
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -333,6 +327,4 @@
 !$OMP END DO NOWAIT
 
-  !
-  !
 
   !   43. temperature naturelle (en K) et pressions milieux couches .
@@ -355,5 +347,4 @@
   !   43.bis traceurs
   !   ---------------
-  !
 
   itr = 0
@@ -415,6 +406,4 @@
 !$OMP END DO NOWAIT
 
-
-  !
   !   45. champ u:
   !   ------------
@@ -445,5 +434,4 @@
 !$OMP END DO NOWAIT
 
-  !
   !  Alvaro de la Camara (May 2014)
   !  46.1 Calcul de la vorticite et passage sur la grille physique
@@ -977,5 +965,4 @@
   !c$OMP BARRIER
 
-  !
   !   62. enthalpie potentielle
   !   ---------------------
@@ -1027,5 +1014,5 @@
    !        if (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,iq)
    !      enddo
-  !
+
   !       if (is_north_pole_dyn) then
   !         do i=1,iip1
@@ -1033,5 +1020,5 @@
   !         enddo
   !       endif
-  !
+
   !       if (is_south_pole_dyn) then
   !         do i=1,iip1
@@ -1053,5 +1040,4 @@
 !$OMP END DO NOWAIT
 
-  !
   !cdir NODEP
   itr = 0
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/mod_interface_dyn_phys.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/mod_interface_dyn_phys.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/mod_interface_dyn_phys.F90	(revision 5099)
@@ -1,5 +1,5 @@
-! 
+
 ! $Id$
-!
+
 MODULE mod_interface_dyn_phys
   INTEGER,SAVE,dimension(:),allocatable :: index_i
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/callphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/callphysiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/callphysiq_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 MODULE callphysiq_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: iniphysiq.F 1403 2010-07-01 09:02:53Z fairhead $
-!
+
 MODULE iniphysiq_mod
 
@@ -20,5 +20,5 @@
   USE nrtype, ONLY: pi
   IMPLICIT NONE
-  !
+
   !=======================================================================
   !   Initialisation of the physical constants and some positional and 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 MODULE callphysiq_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/ce0l.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 5099)
@@ -1,4 +1,4 @@
 PROGRAM ce0l
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Initial states and boundary conditions files creation:
@@ -21,6 +21,6 @@
   USE etat0phys,      ONLY: etat0phys_netcdf
   USE limit,          ONLY: limit_netcdf
-  USE netcdf,         ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR,    &
-         NF90_INQUIRE_DIMENSION, nf90_inq_dimid, NF90_INQ_VARID, NF90_GET_VAR
+  USE netcdf,         ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, nf90_noerr,    &
+         nf90_inquire_dimension, nf90_inq_dimid, NF90_INQ_VARID, nf90_get_var
   USE infotrac,       ONLY: init_infotrac
   USE dimphy,         ONLY: klon
@@ -154,5 +154,5 @@
 ! weights to ensure ocean fractions are the same for atmosphere and ocean.
 !*******************************************************************************
-  IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)==NF90_NOERR) THEN
+  IF(NF90_OPEN("o2a.nc", NF90_NOWRITE, nid_o2a)==nf90_noerr) THEN
     iret=NF90_CLOSE(nid_o2a)
     WRITE(lunout,*)'BEWARE !! Ocean mask "o2a.nc" file found'
@@ -188,9 +188,9 @@
     masque(iip1 ,:)=masque(1,:)
     DEALLOCATE(ocemask)
-  ELSE IF(NF90_OPEN("startphy0.nc", NF90_NOWRITE, nid_sta)==NF90_NOERR) THEN
+  ELSE IF(NF90_OPEN("startphy0.nc", NF90_NOWRITE, nid_sta)==nf90_noerr) THEN
     WRITE(lunout,*)'BEWARE !! File "startphy0.nc" found.'
     WRITE(lunout,*)'Getting the land mask from a previous run.'
     iret=nf90_inq_dimid(nid_sta,'points_physiques',nid_nph)
-    iret=NF90_INQUIRE_DIMENSION(nid_sta,nid_nph,len=nphys)
+    iret=nf90_inquire_dimension(nid_sta,nid_nph,len=nphys)
     IF(nphys/=klon) THEN
       WRITE(lunout,*)'Mismatching dimensions for land mask'
@@ -201,5 +201,5 @@
     ALLOCATE(masktmp(klon))
     iret=NF90_INQ_VARID(nid_sta,'masque',nid_msk)
-    iret=NF90_GET_VAR(nid_sta,nid_msk,masktmp)
+    iret=nf90_get_var(nid_sta,nid_msk,masktmp)
     iret=NF90_CLOSE(nid_sta)
     CALL gr_fi_dyn(1,klon,iip1,jjp1,masktmp,masque)
@@ -253,4 +253,4 @@
 
 END PROGRAM ce0l
-!
-!-------------------------------------------------------------------------------
+
+!-------------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90	(revision 5099)
@@ -1,4 +1,4 @@
 MODULE etat0dyn
-!
+
 !*******************************************************************************
 ! Purpose: Create dynamical initial state using atmospheric fields from a
@@ -6,12 +6,12 @@
 !-------------------------------------------------------------------------------
 ! Comments:
-!
+
 !    *  This module is designed to work for Earth (and with ioipsl)
-!
+
 !    *  etat0dyn_netcdf routine can access to NetCDF data through the following
 !  routine (to be called after restget):
 !    CALL startget_dyn3d(varname, lon_in,  lat_in, pls, workvar,&
 !                          champ, lon_in2, lat_in2)
-!
+
 !    *  Variables should have the following names in the NetCDF files:
 !            'U'      : East ward wind              (in "ECDYN.nc")
@@ -20,5 +20,5 @@
 !            'R'      : Relative humidity           (in "ECDYN.nc")
 !            'RELIEF' : High resolution orography   (in "Relief.nc") 
-!
+
 !    * The land mask and corresponding weights can be:
 !      1) already known (in particular if etat0dyn has been called before) ;
@@ -28,5 +28,5 @@
 !         File name: "o2a.nc"  ;  variable name: "OceMask"
 !      3) computed from topography file "Relief.nc" for forced runs.
-!
+
 !   *   There is a big mess with the longitude size. Should it be iml or iml+1 ?
 !  I have chosen to use the iml+1 as an argument to this routine and we declare
@@ -59,7 +59,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE etat0dyn_netcdf(masque, phis)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Create dynamical initial states.
@@ -194,10 +194,10 @@
 
 END SUBROUTINE etat0dyn_netcdf
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE startget_dyn3d(var, lon_in,  lat_in,  pls,  workvar,&
                         champ, lon_in2, lat_in2)
@@ -279,12 +279,12 @@
 
 END SUBROUTINE startget_dyn3d
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE start_init_dyn(lon_in,lat_in,lon_in2,lat_in2,zs,psol)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -343,7 +343,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE get_var_dyn(title,field)
-!
+
 !-------------------------------------------------------------------------------
   USE conf_dat_m, ONLY: conf_dat2d
@@ -375,16 +375,16 @@
 
 END SUBROUTINE get_var_dyn
-!
+
 !-------------------------------------------------------------------------------
 
 END SUBROUTINE start_init_dyn
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE start_inter_3d(var,lon_in,lat_in,lon_in2,lat_in2,pls_in,var3d)
-!
+
 !-------------------------------------------------------------------------------
   USE conf_dat_m, ONLY: conf_dat3d
@@ -461,12 +461,12 @@
 
 END SUBROUTINE start_inter_3d
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE interp_startvar(nam,ibeg,lon,lat,vari,lon1,lat1,lon2,lat2,varo)
-!
+
 !-------------------------------------------------------------------------------
   USE inter_barxy_m, ONLY: inter_barxy
@@ -502,8 +502,8 @@
 
 END SUBROUTINE interp_startvar
-!
+
 !-------------------------------------------------------------------------------
 
 END MODULE etat0dyn
-!
-!*******************************************************************************
+
+!*******************************************************************************
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 MODULE etat0phys
-!
+
 !*******************************************************************************
 ! Purpose: Create physical initial state using atmospheric fields from a
@@ -9,7 +9,7 @@
 !-------------------------------------------------------------------------------
 ! Comments:
-!
+
 !    *  This module is designed to work for Earth (and with ioipsl)
-!
+
 !    *  etat0phys_netcdf routine can access to NetCDF data through subroutines:
 !         "start_init_phys" for variables contained in file "ECPHY.nc":
@@ -18,5 +18,5 @@
 !         "start_init_orog" for variables contained in file "Relief.nc":
 !            'RELIEF' : High resolution orography 
-!
+
 !    * The land mask and corresponding weights can be:
 !      1) computed using the ocean mask from the ocean model (to ensure ocean
@@ -24,5 +24,5 @@
 !         File name: "o2a.nc"  ;  variable name: "OceMask"
 !      2) computed from topography file "Relief.nc" for forced runs.
-!
+
 !    * Allowed values for read_climoz flag are 0, 1 and 2:
 !      0: do not read an ozone climatology
@@ -76,7 +76,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE etat0phys_netcdf(masque, phis)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Creates initial states
@@ -295,12 +295,12 @@
 
 END SUBROUTINE etat0phys_netcdf
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE start_init_orog(lon_in,lat_in,phis,masque)
-!
+
 !===============================================================================
 ! Comment:
@@ -391,12 +391,12 @@
 
 END SUBROUTINE start_init_orog
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE start_init_phys(lon_in,lat_in,phis)
-!
+
 !===============================================================================
 ! Purpose:   Compute tsol and qsol, knowing phis.
@@ -449,7 +449,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE get_var_phys(title,field)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -474,16 +474,16 @@
 
 END SUBROUTINE get_var_phys
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 END SUBROUTINE start_init_phys
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE interp_startvar(nam,ibeg,lon,lat,vari,lon2,lat2,varo)
-!
+
 !-------------------------------------------------------------------------------
   USE inter_barxy_m, ONLY: inter_barxy
@@ -518,7 +518,7 @@
 
 END SUBROUTINE interp_startvar
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !*******************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE iniphysiq_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/init_ssrf_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/init_ssrf_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/init_ssrf_m.F90	(revision 5099)
@@ -1,4 +1,4 @@
 MODULE init_ssrf_m
-!
+
 !*******************************************************************************
 
@@ -24,7 +24,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE start_init_subsurf(known_mask)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Subsurfaces initialization.
@@ -141,8 +141,8 @@
 
 END SUBROUTINE start_init_subsurf
-!
+
 !-------------------------------------------------------------------------------
 
 END MODULE init_ssrf_m
-!
+
 !*******************************************************************************
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.F90	(revision 5099)
@@ -1,4 +1,4 @@
 MODULE limit
-!
+
 !*******************************************************************************
 ! Author : L. Fairhead, 27/01/94
@@ -49,7 +49,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE limit_netcdf(masque, phis, extrap)
-!
+
 !-------------------------------------------------------------------------------
 ! Author : L. Fairhead, 27/01/94
@@ -73,5 +73,5 @@
   USE netcdf,             ONLY: NF90_OPEN,    NF90_CREATE,  NF90_CLOSE,        &
                   NF90_DEF_DIM, NF90_DEF_VAR, NF90_PUT_VAR, NF90_PUT_ATT,      &
-                  NF90_NOERR,   NF90_NOWRITE,  NF90_GLOBAL,       &
+                  nf90_noerr,   NF90_NOWRITE,  NF90_GLOBAL,       &
                   NF90_CLOBBER, NF90_ENDDEF,  NF90_UNLIMITED, NF90_FLOAT,      &
                   NF90_64BIT_OFFSET
@@ -138,5 +138,5 @@
 ! Open file only to test if available
   DO ix_sic=1,SIZE(fsic)
-     IF ( NF90_OPEN(TRIM(fsic(ix_sic)),NF90_NOWRITE,nid)==NF90_NOERR ) THEN
+     IF ( NF90_OPEN(TRIM(fsic(ix_sic)),NF90_NOWRITE,nid)==nf90_noerr ) THEN
         icefile=fsic(ix_sic); varname=vsic(ix_sic); EXIT
      END IF
@@ -197,5 +197,5 @@
 ! Open file only to test if available
   DO ix_sst=1,SIZE(fsst)
-     IF ( NF90_OPEN(TRIM(fsst(ix_sst)),NF90_NOWRITE,nid)==NF90_NOERR ) THEN
+     IF ( NF90_OPEN(TRIM(fsst(ix_sst)),NF90_NOWRITE,nid)==nf90_noerr ) THEN
        sstfile=fsst(ix_sst); varname=vsst(ix_sst); EXIT
      END IF
@@ -305,14 +305,14 @@
 
 !===============================================================================
-!
+
   CONTAINS
-!
+
 !===============================================================================
 
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE get_2Dfield(fnam, varname, mode, ndays, champo, flag, mask)
-!
+
 !-----------------------------------------------------------------------------
 ! Comments:
@@ -323,5 +323,5 @@
 !-----------------------------------------------------------------------------
   USE netcdf, ONLY: NF90_OPEN, NF90_INQ_VARID, NF90_INQUIRE_VARIABLE, &
-       NF90_CLOSE, nf90_inq_dimid, NF90_INQUIRE_DIMENSION, NF90_GET_VAR, &
+       NF90_CLOSE, nf90_inq_dimid, nf90_inquire_dimension, nf90_get_var, &
        NF90_GET_ATT
   USE pchsp_95_m, only: pchsp_95
@@ -399,23 +399,23 @@
 
 !--- Longitude
-  CALL ncerr(NF90_INQUIRE_DIMENSION(ncid, dids(1), name=dnam, len=imdep),fnam)
+  CALL ncerr(nf90_inquire_dimension(ncid, dids(1), name=dnam, len=imdep),fnam)
   ALLOCATE(dlon_ini(imdep), dlon(imdep))
   CALL ncerr(NF90_INQ_VARID(ncid, dnam, varid), fnam)
-  CALL ncerr(NF90_GET_VAR(ncid, varid, dlon_ini), fnam)
+  CALL ncerr(nf90_get_var(ncid, varid, dlon_ini), fnam)
   CALL msg(5,'variable '//TRIM(dnam)//' dimension ', imdep)
 
 !--- Latitude
-  CALL ncerr(NF90_INQUIRE_DIMENSION(ncid, dids(2), name=dnam, len=jmdep),fnam)
+  CALL ncerr(nf90_inquire_dimension(ncid, dids(2), name=dnam, len=jmdep),fnam)
   ALLOCATE(dlat_ini(jmdep), dlat(jmdep))
   CALL ncerr(NF90_INQ_VARID(ncid, dnam, varid), fnam)
-  CALL ncerr(NF90_GET_VAR(ncid, varid, dlat_ini), fnam)
+  CALL ncerr(nf90_get_var(ncid, varid, dlat_ini), fnam)
   CALL msg(5,'variable '//TRIM(dnam)//' dimension ', jmdep)
 
 !--- Time (variable is not needed - it is rebuilt - but calendar is)
-  CALL ncerr(NF90_INQUIRE_DIMENSION(ncid, dids(3), name=dnam, len=lmdep), fnam)
+  CALL ncerr(nf90_inquire_dimension(ncid, dids(3), name=dnam, len=lmdep), fnam)
   ALLOCATE(timeyear(lmdep+2))
   CALL ncerr(NF90_INQ_VARID(ncid, dnam, varid), fnam)
   cal_in=' '
-  IF(NF90_GET_ATT(ncid, varid, 'calendar', cal_in)/=NF90_NOERR) THEN
+  IF(NF90_GET_ATT(ncid, varid, 'calendar', cal_in)/=nf90_noerr) THEN
     SELECT CASE(mode)
       CASE('RUG', 'ALB'); cal_in='360_day'
@@ -451,5 +451,5 @@
   CALL ncerr(NF90_INQ_VARID(ncid, varname, varid), fnam)
   DO l=1, lmdep
-    CALL ncerr(NF90_GET_VAR(ncid,varid,champ,[1,1,l],[imdep,jmdep,1]),fnam)
+    CALL ncerr(nf90_get_var(ncid,varid,champ,[1,1,l],[imdep,jmdep,1]),fnam)
     CALL conf_dat2d(title, dlon_ini, dlat_ini, dlon, dlat, champ, .TRUE.)
 
@@ -459,5 +459,5 @@
       !--- DETERMINE THE UNIT: READ FROM FILE OR ASSUMED USING FIELD VALUES
       ierr=NF90_GET_ATT(ncid, varid, 'units', units)
-      IF(ierr==NF90_NOERR) THEN !--- ATTRIBUTE "units" FOUND IN THE FILE
+      IF(ierr==nf90_noerr) THEN !--- ATTRIBUTE "units" FOUND IN THE FILE
         CALL strclean(units)
         IF(mode=='SIC'.AND.is_in(units,Perc)) units="%"
@@ -472,5 +472,5 @@
       END IF
       CALL msg(0,'INPUT FILE '//TRIM(title)//' UNIT IS: "'//TRIM(units)//'".')
-      IF(ierr/=NF90_NOERR) CALL msg(0,'WARNING ! UNIT TO BE CHECKED ! '      &
+      IF(ierr/=nf90_noerr) CALL msg(0,'WARNING ! UNIT TO BE CHECKED ! '      &
         //'No "units" attribute, so only based on the fields values.')
 
@@ -509,10 +509,10 @@
 !--- FIRST RECORD: LAST ONE OF PREVIOUS YEAR (CURRENT YEAR IF UNAVAILABLE)
   fnam_m=fnam(1:idx)//'_m.nc'
-  IF(NF90_OPEN(fnam_m,NF90_NOWRITE,ncid)==NF90_NOERR) THEN
+  IF(NF90_OPEN(fnam_m,NF90_NOWRITE,ncid)==nf90_noerr) THEN
     CALL msg(0,'Reading previous year file ("'//TRIM(fnam_m)//'") last record for '//TRIM(title))
     CALL ncerr(NF90_INQ_VARID(ncid, varname, varid),fnam_m)
     CALL ncerr(NF90_INQUIRE_VARIABLE(ncid, varid, dimids=dids),fnam_m)
-    CALL ncerr(NF90_INQUIRE_DIMENSION(ncid, dids(3), len=l), fnam_m)
-    CALL ncerr(NF90_GET_VAR(ncid,varid,champ,[1,1,l],[imdep,jmdep,1]),fnam_m)
+    CALL ncerr(nf90_inquire_dimension(ncid, dids(3), len=l), fnam_m)
+    CALL ncerr(nf90_get_var(ncid,varid,champ,[1,1,l],[imdep,jmdep,1]),fnam_m)
     CALL ncerr(NF90_CLOSE(ncid), fnam_m)
     CALL conf_dat2d(title, dlon_ini, dlat_ini, dlon, dlat, champ, .TRUE.)
@@ -532,8 +532,8 @@
 !--- LAST RECORD: FIRST ONE OF NEXT YEAR (CURRENT YEAR IF UNAVAILABLE)
   fnam_p=fnam(1:idx)//'_p.nc'
-  IF(NF90_OPEN(fnam_p,NF90_NOWRITE,ncid)==NF90_NOERR) THEN
+  IF(NF90_OPEN(fnam_p,NF90_NOWRITE,ncid)==nf90_noerr) THEN
     CALL msg(0,'Reading next year file ("'//TRIM(fnam_p)//'") first record for '//TRIM(title))
     CALL ncerr(NF90_INQ_VARID(ncid, varname, varid),fnam_p)
-    CALL ncerr(NF90_GET_VAR(ncid,varid,champ,[1,1,1],[imdep,jmdep,1]),fnam_p)
+    CALL ncerr(nf90_get_var(ncid,varid,champ,[1,1,1],[imdep,jmdep,1]),fnam_p)
     CALL ncerr(NF90_CLOSE(ncid), fnam_p)
     CALL conf_dat2d(title, dlon_ini, dlat_ini, dlon, dlat, champ, .TRUE.)
@@ -641,12 +641,12 @@
 
 END SUBROUTINE get_2Dfield
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE start_init_orog0(lon_in,lat_in,phis,masque)
-!
+
 !-------------------------------------------------------------------------------
   USE grid_noro_m, ONLY: grid_noro0
@@ -704,12 +704,12 @@
 
 END SUBROUTINE start_init_orog0
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE msg(lev,str1,i,str2)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -730,16 +730,16 @@
 
 END SUBROUTINE msg
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE ncerr(ncres,fnam)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: NetCDF errors handling.
 !-------------------------------------------------------------------------------
-  USE netcdf, ONLY : NF90_NOERR, NF90_STRERROR
+  USE netcdf, ONLY : nf90_noerr, NF90_STRERROR
   IMPLICIT NONE
 !-------------------------------------------------------------------------------
@@ -748,5 +748,5 @@
   CHARACTER(LEN=*), INTENT(IN) :: fnam
 !-------------------------------------------------------------------------------
-  IF(ncres/=NF90_NOERR) THEN
+  IF(ncres/=nf90_noerr) THEN
     WRITE(lunout,*)'Problem with file '//TRIM(fnam)//' in routine limit_netcdf.'
     CALL abort_physic('limit_netcdf',NF90_STRERROR(ncres),1)
@@ -754,12 +754,12 @@
 
 END SUBROUTINE ncerr
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE strclean(s)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -776,12 +776,12 @@
 
 END SUBROUTINE strclean
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 FUNCTION is_in(s1,s2) RESULT(res)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -796,12 +796,12 @@
 
 END FUNCTION is_in
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 ELEMENTAL FUNCTION strLow(s) RESULT(res)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -822,5 +822,5 @@
 
 END FUNCTION strLow
-!
+
 !-------------------------------------------------------------------------------
 
@@ -830,5 +830,5 @@
 
 END MODULE limit
-!
+
 !*******************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/acc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/acc.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/acc.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
         subroutine acc(vec,d,im)
         implicit none
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/coefils.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/coefils.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/coefils.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
       COMMON/coefils/jfiltnu,jfiltsu,jfiltnv,jfiltsv,sddu(iim),sddv(iim)&
      & ,unsddu(iim),unsddv(iim),coefilu(iim,jjm),coefilv(iim,jjm),      &
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/eigen.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/eigen.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/eigen.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE eigen( e,d)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/eigen_sort.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/eigen_sort.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/eigen_sort.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
           SUBROUTINE eigen_sort(d,v,n,np)
           INTEGER n,np
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE filtreg ( champ, nlat, nbniv, ifiltre,iaire,
      &     griscal ,iter)
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/filtreg_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE filtreg_mod
 
@@ -19,7 +19,7 @@
 
     !    ... H. Upadhyaya, O.Sharma   ...
-    !
+
     IMPLICIT NONE
-    !
+
     !     version 3 .....
 
@@ -34,5 +34,4 @@
     REAL  dlonu(iim),dlatu(jjm)
     REAL  rlamda( iim ),  eignvl( iim )
-    !
 
     REAL    lamdamax,pi,cof
@@ -47,9 +46,9 @@
     INTEGER iymin 
     INTEGER ixmineq
-    !
+
     ! ------------------------------------------------------------
     !   This routine computes the eigenfunctions of the laplacien
     !   on the stretched grid, and the filtering coefficients
-    !      
+
     !  We designate:
     !   eignfn   eigenfunctions of the discrete laplacien
@@ -61,9 +60,9 @@
     !   coefil   filtering coefficients ( lamda_max*COS(rlat)/lamda )
     !   sdd      SQRT( dx )
-    !      
+
     !     the modes are filtered from modfrst to modemax
-    !      
+
     !-----------------------------------------------------------
-    !
+
     if ( iim == 1 ) return ! No filtre in 2D y-z
 
@@ -73,33 +72,32 @@
        dlonu(i) = xprimu( i )
     ENDDO
-    !
+
     CALL inifgn(eignvl)
-    !
+
     PRINT *,'inifilr: EIGNVL '
     PRINT 250,eignvl
 250 FORMAT( 1x,5e14.6)
-    !
+
     ! compute eigenvalues and eigenfunctions
-    !
-    !
+
+
     !.................................................................
-    !
+
     !  compute the filtering coefficients for scalar lines and 
     !  meridional wind v-lines
-    !
+
     !  we filter all those latitude lines WHERE coefil < 1
     !  NO FILTERING AT POLES
-    !
+
     !  colat0 is to be used  when alpha (stretching coefficient)
     !  is set equal to zero for the regular grid CASE 
-    !
+
     !    .......   Calcul  de  colat0   .........
     !     .....  colat0 = minimum de ( 0.5, min dy/ min dx )   ...
-    !
-    !
+
+
     DO j = 1,jjm
        dlatu( j ) = rlatu( j ) - rlatu( j+1 )
     ENDDO
-    !
 
     dxmin   =  dlonu(1)
@@ -111,5 +109,5 @@
        dymin = MIN( dymin,dlatu(j) )
     ENDDO
-    !
+
     ! For a regular grid, we want the filter to start at latitudes
     ! corresponding to lengths dx of the same size as dy (in terms
@@ -118,5 +116,5 @@
     ! Same idea for the zoomed grid: start filtering polewards as soon
     ! as length dx becomes of the same size as dy 
-    !
+
     ! if maxlatfilter >0, prescribe the colat0 value from the .def files
    
@@ -125,5 +123,5 @@
     colat0  =  MIN( 0.5, dymin/dxmin )
     ! colat0  =  1.
-    !
+
     IF( .NOT.fxyhypb.AND.ysinus )  THEN
        colat0 = 0.6
@@ -137,24 +135,20 @@
 
     ENDIF
-    
-    
-    
-    !
+
     PRINT 50, colat0,alphax
 50  FORMAT(/15x,' Inifilr colat0 alphax ',2e16.7)
-    !
+
     IF(alphax==1. )  THEN
        PRINT *,' Inifilr  alphax doit etre  <  a 1.  Corriger '
        STOP
     ENDIF
-    !
+
     lamdamax = iim / ( pi * colat0 * ( 1. - alphax ) )
 
     !                        ... Correction  le 28/10/97  ( P.Le Van ) ..
-    !
+
     DO i = 2,iim
        rlamda( i ) = lamdamax/ SQRT( ABS( eignvl(i) ) )
     ENDDO
-    !
 
     DO j = 1,jjm
@@ -167,8 +161,7 @@
     ENDDO
 
-    !
     !    ... Determination de jfiltnu,jfiltnv,jfiltsu,jfiltsv ....
     !    .........................................................
-    !
+
     modemax = iim
 
@@ -176,7 +169,7 @@
 
     imx  = iim
-    !
+
     PRINT *,'inifilr: TRUNCATION AT ',imx
-    !
+
 ! Ehouarn: set up some defaults
     jfiltnu=2 ! avoid north pole
@@ -200,5 +193,5 @@
        ENDIF
     ENDDO
-    !
+
     DO j = 1, jjm/2
        cof = COS( rlatv(j) )/ colat0
@@ -216,5 +209,4 @@
        ENDIF
     ENDDO
-    !                                 
 
     IF( jfiltnu> jjm/2 +1 )  THEN
@@ -251,9 +243,8 @@
     ENDIF
 
-    !                                 
     !   ... Determination de coefilu,coefilv,n=modfrstu,modfrstv ....
     !................................................................
-    !
-    !
+
+
     DO j = 1,jjm
     !default initialization: all modes are retained (i.e. no filtering)
@@ -261,5 +252,5 @@
        modfrstv( j ) = iim
     ENDDO
-    !
+
     DO j = 2,jfiltnu
        DO k = 2,modemax
@@ -269,5 +260,5 @@
        GOTO 84
 82     modfrstu( j ) = k
-       !
+
        kf = modfrstu( j )
        DO k = kf , modemax
@@ -278,8 +269,8 @@
 84     CONTINUE
     ENDDO
-    !                                 
-    !
+
+
     DO j = 1,jfiltnv
-       !
+
        DO k = 2,modemax
           cof = rlamda(k) * COS( rlatv(j) )
@@ -288,5 +279,5 @@
        GOTO 89
 87     modfrstv( j ) = k
-       !
+
        kf = modfrstv( j )
        DO k = kf , modemax
@@ -297,5 +288,5 @@
 89     CONTINUE
     ENDDO
-    !
+
     DO j = jfiltsu,jjm
        DO k = 2,modemax
@@ -305,5 +296,5 @@
        GOTO 94
 92     modfrstu( j ) = k
-       !
+
        kf = modfrstu( j )
        DO k = kf , modemax
@@ -314,5 +305,5 @@
 94     CONTINUE
     ENDDO
-    !                                 
+
     DO j = jfiltsv,jjm
        DO k = 2,modemax
@@ -322,5 +313,5 @@
        GOTO 99
 97     modfrstv( j ) = k
-       !
+
        kf = modfrstv( j )
        DO k = kf , modemax
@@ -331,5 +322,4 @@
 99     CONTINUE
     ENDDO
-    !
 
     IF(jfiltnv>=jjm/2 .OR. jfiltnu>=jjm/2)THEN
@@ -348,11 +338,10 @@
     PRINT 334,modfrstu
 
-    !  
-    !   ...................................................................
-    !
+    !   ...................................................................
+
     !   ... Calcul de la matrice filtre 'matriceu'  pour les champs situes
     !                       sur la grille scalaire                 ........
     !   ...................................................................
-    !
+
     DO j = 2, jfiltnu
 
@@ -410,9 +399,9 @@
 
     !   ...................................................................
-    !
+
     !   ... Calcul de la matrice filtre 'matricev'  pour les champs situes
     !                       sur la grille   de V ou de Z           ........
     !   ...................................................................
-    !
+
     DO j = 1, jfiltnv
 
@@ -471,9 +460,9 @@
 
     !   ...................................................................
-    !
+
     !   ... Calcul de la matrice filtre 'matrinv'  pour les champs situes
     !              sur la grille scalaire , pour le filtre inverse ........
     !   ...................................................................
-    !
+
     DO j = 2, jfiltnu
 
@@ -539,5 +528,4 @@
     !   ...................................................................
 
-    !
 334 FORMAT(1x,24i3)
 
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/inifgn.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header: /home/cvsroot/LMDZ4/libf/filtrez/inifgn.F,v 1.1.1.1 2004-05-19 12:53:09 lmdzadmin Exp $
-!
+
       SUBROUTINE inifgn(dv)
 c  
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/jacobi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/jacobi.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/jacobi.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE JACOBI(A,N,NP,D,V,NROT)
       implicit none
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dft_type.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dft_type.f90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dft_type.f90	(revision 5099)
@@ -1,5 +1,5 @@
 !*****************************************************************************
 ! Copyright(C) 2002-2011 Intel Corporation. All Rights Reserved.
-!
+
 ! The source code, information  and  material ("Material") contained herein is
 ! owned  by Intel Corporation or its suppliers or licensors, and title to such
@@ -15,11 +15,11 @@
 ! intellectual  property  rights must  be express  and  approved  by  Intel in
 ! writing.
-!
+
 ! *Third Party trademarks are the property of their respective owners.
-!
+
 ! Unless otherwise  agreed  by Intel  in writing, you may not remove  or alter
 ! this  notice or  any other notice embedded  in Materials by Intel or Intel's
 ! suppliers or licensors in any way.
-!
+
 !*****************************************************************************
 ! Content:
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dfti.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dfti.f90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mkl_dfti.f90	(revision 5099)
@@ -1,5 +1,5 @@
 !*****************************************************************************
 ! Copyright(C) 2002-2011 Intel Corporation. All Rights Reserved.
-!
+
 ! The source code, information  and  material ("Material") contained herein is
 ! owned  by Intel Corporation or its suppliers or licensors, and title to such
@@ -15,11 +15,11 @@
 ! intellectual  property  rights must  be express  and  approved  by  Intel in
 ! writing.
-!
+
 ! *Third Party trademarks are the property of their respective owners.
-!
+
 ! Unless otherwise  agreed  by Intel  in writing, you may not remove  or alter
 ! this  notice or  any other notice embedded  in Materials by Intel or Intel's
 ! suppliers or licensors in any way.
-!
+
 !*****************************************************************************
 ! Content:
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_fftw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_fftw.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_fftw.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 MODULE mod_fft_fftw
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mkl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mkl.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mod_fft_mkl.F90	(revision 5099)
@@ -39,7 +39,7 @@
 !    ALLOCATE(Table_forward(2*vsize+64))
 !    ALLOCATE(Table_backward(2*vsize+64))
-!    
+
 !    CALL DZFFTM(isign,vsize,itmp,scale_factor,rtmp,vsize+inc,ctmp,vsize/2+1,table_forward,rtmp,ierr)
-!    
+
 !    CALL ZDFFTM(isign,vsize,itmp,scale_factor,ctmp,vsize/2+1,rtmp,vsize+inc,table_backward,rtmp,ierr)
 
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 MODULE mod_filtre_fft
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft_loc.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/mod_filtre_fft_loc.F90	(revision 5099)
@@ -313,5 +313,5 @@
 !    INTEGER,INTENT(OUT) :: ll_index(nbniv)
 !    INTEGER,INTENT(OUT) :: ll_nb
-!
+
 !    INTEGER :: l,ll_begin, ll_end
 !   INTEGER :: omp_rank,omp_size
@@ -321,10 +321,10 @@
 !   INTEGER :: OMP_GET_THREAD_NUM
 !   EXTERNAL OMP_GET_THREAD_NUM
-!
-!   
+
+
 !   omp_size=OMP_GET_NUM_THREADS()
 !   omp_rank=OMP_GET_THREAD_NUM()    
 !   omp_chunk=nbniv/omp_size+min(1,MOD(nbniv,omp_size))
-!   
+
 !   ll_begin=omp_rank*OMP_CHUNK+1
 !   ll_nb=0
@@ -337,5 +337,5 @@
 !     ll_begin=ll_begin+omp_size*OMP_CHUNK
 !   ENDDO
-!  
+
 !  END SUBROUTINE get_ll_index
    
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h	(revision 5099)
@@ -1,4 +1,4 @@
-!
+
 ! $Header$
-!
+
         INTEGER nfilun, nfilus, nfilvn, nfilvs
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h_192x142x29
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h_192x142x29	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h_192x142x29	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
         INTEGER nfilun, nfilus, nfilvn, nfilvs
 c
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h_96x71x19
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h_96x71x19	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/parafilt.h_96x71x19	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
         INTEGER nfilun, nfilus, nfilvn, nfilvs
 c
Index: LMDZ6/branches/Amaury_dev/libf/grid/dimension/makdim
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/dimension/makdim	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/grid/dimension/makdim	(revision 5099)
@@ -55,5 +55,5 @@
 !-----------------------------------------------------------------------
 !   INCLUDE 'dimensions.h'
-!
+
 !   dimensions.h contient les dimensions du modele
 !   ndm est tel que iim=2**ndm
Index: LMDZ6/branches/Amaury_dev/libf/grid/fxy_new.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/fxy_new.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/grid/fxy_new.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 c--------------------------------------------------------------
          REAL ripx
Index: LMDZ6/branches/Amaury_dev/libf/grid/fxy_reg.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/fxy_reg.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/grid/fxy_reg.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 c-----------------------------------------------------------------------
 c INCLUDE 'fxyprim.h'
Index: LMDZ6/branches/Amaury_dev/libf/grid/fxy_sin.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/fxy_sin.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/grid/fxy_sin.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 c-----------------------------------------------------------------------
 c INCLUDE 'fxyprim.h'
Index: LMDZ6/branches/Amaury_dev/libf/grid/fxyprim.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/grid/fxyprim.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/grid/fxyprim.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 c-----------------------------------------------------------------------
 c INCLUDE 'fxyprim.h'
Index: LMDZ6/branches/Amaury_dev/libf/misc/description.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/description.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/description.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       character (len=120) :: descript
       common /titre/descript
Index: LMDZ6/branches/Amaury_dev/libf/misc/formcoord.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/formcoord.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/formcoord.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       subroutine formcoord(unit,n,x,a,rev,text)
       implicit none
Index: LMDZ6/branches/Amaury_dev/libf/misc/iniprint.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/iniprint.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/iniprint.h	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Header$
-!
-!
+
+
 ! gestion des impressions de sorties et de débogage
 ! lunout:    unité du fichier dans lequel se font les sorties
 !                           (par defaut 6, la sortie standard)
 ! prt_level: niveau d'impression souhaité (0 = minimum)
-!
+
       INTEGER lunout, prt_level
       COMMON /comprint/ lunout, prt_level
Index: LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_errioipsl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_errioipsl.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_errioipsl.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 ! Module/Routines extracted from IOIPSL v2_1_8
-!
+
 MODULE ioipsl_errioipsl
 !-
Index: LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_getincom.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_getincom.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_getincom.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 ! Module/Routines extracted from IOIPSL v2_1_8
-!
+
 MODULE ioipsl_getincom
 !-
Index: LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_stringop.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_stringop.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/ioipsl_stringop.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 ! Module/Routines extracted from IOIPSL v2_1_8
-!
+
 MODULE ioipsl_stringop
 !-
Index: LMDZ6/branches/Amaury_dev/libf/misc/ismax.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/ismax.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/ismax.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       function ismax(n,sx,incx)
 c
Index: LMDZ6/branches/Amaury_dev/libf/misc/ismin.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/ismin.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/ismin.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       FUNCTION ismin(n,sx,incx)
 c
Index: LMDZ6/branches/Amaury_dev/libf/misc/juldate.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/juldate.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/juldate.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 	subroutine juldate(ian,imoi,ijou,oh,om,os,tjd,tjdsec)
 c	Sous-routine de changement de date:
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_cppkeys_wrapper.F90	(revision 5099)
@@ -9,4 +9,5 @@
 !      INCA      -> CPPKEY_INCA
 !      CPP_StratAer-> CPPKEY_STRATAER
+!      CPP_DUST  -> CPPKEY_DUST
 ! ---------------------------------------------
 
@@ -15,5 +16,5 @@
   USE netcdf, ONLY: nf90_float, nf90_double
   IMPLICIT NONE; PRIVATE
-  PUBLIC nf90_format, CPPKEY_PHYS, CPPKEY_INCA, CPPKEY_STRATAER
+  PUBLIC nf90_format, CPPKEY_PHYS, CPPKEY_INCA, CPPKEY_STRATAER, CPPKEY_DUST
 
 #ifdef NC_DOUBLE
@@ -41,3 +42,9 @@
 #endif
 
+#ifdef CPP_DUST
+  LOGICAL, PARAMETER :: CPPKEY_DUST = .TRUE.
+#else
+  LOGICAL, PARAMETER :: CPPKEY_DUST = .FALSE.
+#endif
+
 END MODULE lmdz_cppkeys_wrapper
Index: LMDZ6/branches/Amaury_dev/libf/misc/minmax.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/minmax.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/minmax.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
        SUBROUTINE minmax(imax, xi, zmin, zmax )
 c
Index: LMDZ6/branches/Amaury_dev/libf/misc/minmax2.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/minmax2.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/minmax2.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
        SUBROUTINE minmax2(imax, jmax, lmax, xi, zmin, zmax )
 c
Index: LMDZ6/branches/Amaury_dev/libf/misc/pres2lev_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/pres2lev_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/pres2lev_mod.F90	(revision 5099)
@@ -1,4 +1,4 @@
 ! $Id: pres2lev.F 1179 2009-06-11 14:18:47Z jghattas $
-!
+
 MODULE pres2lev_mod
 
@@ -7,5 +7,5 @@
 !******************************************************
 SUBROUTINE pres2lev(varo,varn,lmo,lmn,po,pn,ni,nj,ok_invertp)
-!
+
 ! interpolation lineaire pour passer
 ! a une nouvelle discretisation verticale pour
@@ -20,5 +20,5 @@
 !   Declarations:
 ! ==============
-!
+
 !  ARGUMENTS
 !  """""""""
Index: LMDZ6/branches/Amaury_dev/libf/misc/q_sat.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/q_sat.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/q_sat.F	(revision 5099)
@@ -1,10 +1,9 @@
-!
+
 ! $Header$
-!
-!
-!
+
+
 
       subroutine q_sat(np,temp,pres,qsat)
-!
+
       IMPLICIT none
 !======================================================================
@@ -16,25 +15,25 @@
 ! kelvin---input-R: temperature en Kelvin
 ! millibar--input-R: pression en mb
-!
+
 ! q_sat----output-R: vapeur d'eau saturante en kg/kg
 !======================================================================
-!
+
       integer np
       REAL temp(np),pres(np),qsat(np)
-!
+
       REAL r2es
       PARAMETER (r2es=611.14 *18.0153/28.9644)
-!
+
       REAL r3les, r3ies, r3es
       PARAMETER (R3LES=17.269)
       PARAMETER (R3IES=21.875)
-!
+
       REAL r4les, r4ies, r4es
       PARAMETER (R4LES=35.86)
       PARAMETER (R4IES=7.66)
-!
+
       REAL rtt
       PARAMETER (rtt=273.16)
-!
+
       REAL retv
       PARAMETER (retv=28.9644/18.0153 - 1.0)
@@ -42,8 +41,7 @@
       real zqsat
       integer ip
-!
+
 !     ------------------------------------------------------------------
-!
-!
+
 
       do ip=1,np
@@ -51,5 +49,5 @@
 !      write(*,*)'kelvin,millibar=',kelvin,millibar
 !       write(*,*)'temp,pres=',temp(ip),pres(ip)
-!
+
          IF (temp(ip) <= rtt) THEN
             r3es = r3ies
@@ -59,14 +57,14 @@
             r4es = r4les
          ENDIF
-!
+
          zqsat=r2es/pres(ip)*EXP(r3es*(temp(ip)-rtt)/(temp(ip)-r4es))
          zqsat=MIN(0.5,ZQSAT)
          zqsat=zqsat/(1.-retv *zqsat)
-!
+
          qsat(ip)= zqsat
 !      write(*,*)'qsat=',qsat(ip)
 
       enddo
-!
+
       RETURN
       END
Index: LMDZ6/branches/Amaury_dev/libf/misc/ran1.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/ran1.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/ran1.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       FUNCTION RAN1(IDUM)
       IMPLICIT NONE
Index: LMDZ6/branches/Amaury_dev/libf/misc/regr_conserv_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/regr_conserv_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/regr_conserv_m.F90	(revision 5099)
@@ -40,7 +40,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE regr1_conserv(ix, vs, xs, xt, vt, slope)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -93,12 +93,12 @@
 
 END SUBROUTINE regr1_conserv
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr2_conserv(ix, vs, xs, xt, vt, slope)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -153,12 +153,12 @@
 
 END SUBROUTINE regr2_conserv
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr3_conserv(ix, vs, xs, xt, vt, slope)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -215,12 +215,12 @@
 
 END SUBROUTINE regr3_conserv
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr4_conserv(ix, vs, xs, xt, vt, slope)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -279,12 +279,12 @@
 
 END SUBROUTINE regr4_conserv
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr5_conserv(ix, vs, xs, xt, vt, slope)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -345,12 +345,12 @@
 
 END SUBROUTINE regr5_conserv
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE check_size(ix,svs,svt,xs,xt,ns,nt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -382,5 +382,5 @@
 
 END SUBROUTINE check_size
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/misc/regr_lint_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/regr_lint_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/regr_lint_m.F90	(revision 5099)
@@ -33,7 +33,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE regr1_lint(ix, vs, xs, xt, vt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -57,12 +57,12 @@
 
 END SUBROUTINE regr1_lint
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr2_lint(ix, vs, xs, xt, vt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -87,12 +87,12 @@
 
 END SUBROUTINE regr2_lint
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr3_lint(ix, vs, xs, xt, vt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -118,12 +118,12 @@
 
 END SUBROUTINE regr3_lint
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr4_lint(ix, vs, xs, xt, vt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -150,12 +150,12 @@
 
 END SUBROUTINE regr4_lint
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE regr5_lint(ix, vs, xs, xt, vt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -183,12 +183,12 @@
 
 END SUBROUTINE regr5_lint
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE check_size(ix,svs,svt,nxs,nxt,ns,nt)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -211,9 +211,9 @@
 
 END SUBROUTINE check_size
-!
+
 !-------------------------------------------------------------------------------
 
 END MODULE regr_lint_m
-!
-!-------------------------------------------------------------------------------
-
+
+!-------------------------------------------------------------------------------
+
Index: LMDZ6/branches/Amaury_dev/libf/misc/slopes_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/slopes_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/slopes_m.F90	(revision 5099)
@@ -29,7 +29,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 PURE FUNCTION slopes1(ix, f, x)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -64,12 +64,12 @@
 
 END FUNCTION slopes1
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 PURE FUNCTION slopes2(ix, f, x)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -113,12 +113,12 @@
 
 END FUNCTION slopes2
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 PURE FUNCTION slopes3(ix, f, x)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -165,12 +165,12 @@
 
 END FUNCTION slopes3
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 PURE FUNCTION slopes4(ix, f, x)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -220,12 +220,12 @@
 
 END FUNCTION slopes4
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 PURE FUNCTION slopes5(ix, f, x)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -278,5 +278,5 @@
 
 END FUNCTION slopes5
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/misc/sort.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/sort.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/sort.F	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 C
 C
Index: LMDZ6/branches/Amaury_dev/libf/misc/wxios.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/wxios.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/misc/wxios.F90	(revision 5099)
@@ -759,9 +759,9 @@
 !        CALL xios_update_calendar(ito)
 !    END SUBROUTINE wxios_update_calendar
-!    
+
 !    SUBROUTINE wxios_write_2D(fieldname, fdata)
 !        CHARACTER(len=*), INTENT(IN) :: fieldname
 !        REAL, DIMENSION(:,:), INTENT(IN) :: fdata
-!
+
 !        CALL xios_send_field(fieldname, fdata)
 !    END SUBROUTINE wxios_write_2D
@@ -770,5 +770,5 @@
 !        CHARACTER(len=*), INTENT(IN) :: fieldname
 !        REAL, DIMENSION(:,:,:), INTENT(IN) :: fdata
-!        
+
 !        CALL xios_send_field(fieldname, fdata)
 !    END SUBROUTINE wxios_write_3D
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/abort_physic.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/abort_physic.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/abort_physic.F90	(revision 5099)
@@ -11,8 +11,8 @@
       USE print_control_mod, ONLY: lunout
       IMPLICIT NONE
-!
+
 ! Stops the simulation cleanly, closing files and printing various
 ! comments
-!
+
 !  Input: modname = name of calling program
 !         message = stuff to print
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/ioipsl_getin_p_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/ioipsl_getin_p_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/ioipsl_getin_p_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE ioipsl_getin_p_mod
 ! To use getin in a parallel context
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_grid_phy_lmdz.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_grid_phy_lmdz.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_grid_phy_lmdz.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id $
-!
+
 MODULE mod_grid_phy_lmdz
 
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_data.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_data.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id$
-!
+
 MODULE mod_phys_lmdz_mpi_data
   USE lmdz_mpi 
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id$
-!
+
 MODULE mod_phys_lmdz_mpi_transfert
 
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_omp_data.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_omp_data.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_omp_data.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id$
-!
+
 MODULE mod_phys_lmdz_omp_data
 
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_omp_transfert.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_omp_transfert.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_omp_transfert.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Header$
-!
+
 MODULE mod_phys_lmdz_omp_transfert
 
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_para.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_para.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_para.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE mod_phys_lmdz_para
   USE mod_phys_lmdz_transfert_para
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_transfert_para.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_transfert_para.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/mod_phys_lmdz_transfert_para.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id$
-!
+
 MODULE mod_phys_lmdz_transfert_para
 
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/physics_distribution_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/physics_distribution_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/physics_distribution_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id$
-!
+
 MODULE physics_distribution_mod
 
@@ -68,5 +68,5 @@
 !!$OMP PARALLEL
 !    CALL Init_dimphy(klon_omp,nbp_lev)
-!
+
 !#ifdef REPROBUS
 !! Initialization of Reprobus
@@ -74,5 +74,5 @@
 !    END IF
 !#endif
-!
+
 !!$OMP END PARALLEL
  
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/write_field_phy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/write_field_phy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/write_field_phy.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE write_field_phy
 
Index: LMDZ6/branches/Amaury_dev/libf/phydev/gr_fi_ecrit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/gr_fi_ecrit.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/gr_fi_ecrit.F90	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE gr_fi_ecrit(nfield,nlon,iim,jjmp1,fi,ecrit)
   IMPLICIT NONE
-  !
+
   ! Transfer a field from the full physics grid
   ! to a full 2D (lonxlat) grid suitable for outputs
-  !
+
   INTEGER,INTENT(IN) :: nfield,nlon,iim,jjmp1
   REAL,INTENT(IN) :: fi(nlon,nfield)
Index: LMDZ6/branches/Amaury_dev/libf/phydev/iophy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/iophy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/iophy.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 module iophy
   
@@ -250,5 +250,5 @@
      endif
      CALL histwrite(nid,name,itau,fieldok,npstn,index2d)
-!
+
     endif
     deallocate(index2d)
Index: LMDZ6/branches/Amaury_dev/libf/phydev/phyaqua_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/phyaqua_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/phyaqua_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 MODULE phyaqua_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phydev/phyetat0.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/phyetat0.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/phyetat0.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE phyetat0(fichnom)
 ! Load initial state for the physics
Index: LMDZ6/branches/Amaury_dev/libf/phydev/phyredem.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/phyredem.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/phyredem.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: $
-!
+
 SUBROUTINE phyredem (fichnom)
 
Index: LMDZ6/branches/Amaury_dev/libf/phydev/phys_state_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/phys_state_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/phys_state_var_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id:  $
-!
+
 MODULE phys_state_var_mod
 !======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phydev/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/physiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/physiq_mod.F90	(revision 5099)
@@ -28,7 +28,7 @@
 
       IMPLICIT none
-!
+
 ! Routine argument:
-!
+
       integer,intent(in) :: nlon ! number of atmospheric colums
       integer,intent(in) :: nlev ! number of vertical levels (should be =klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bcscav_spl.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bcscav_spl.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bcscav_spl.F	(revision 5099)
@@ -34,10 +34,10 @@
 ! fluxes are defined on klev levels only.
 ! NHL
-!
+
       flxr_aux(:,klev+1)=0.0
       flxs_aux(:,klev+1)=0.0
       flxr_aux(:,1:klev)=flxr(:,:)
       flxs_aux(:,1:klev)=flxs(:,:)
-!
+
       DO k=1, klev
       DO i=1, klon 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/checkmass.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/checkmass.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/checkmass.F90	(revision 5099)
@@ -2,7 +2,7 @@
   USE dimphy
 USE geometry_mod , ONLY:cell_area
+  USE lmdz_yomcst
   IMPLICIT NONE
 
-  INCLUDE "YOMCST.h"
 
 ! Entrees
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/chem_spla.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/chem_spla.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/chem_spla.h	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Header$
-!
 
       INTEGER ss_bins
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.F	(revision 5098)
+++ 	(revision )
@@ -1,137 +1,0 @@
-      SUBROUTINE cltrac_spl(dtime,coef,yu1,yv1,t,tr,
-     .                     flux,paprs,pplay,d_tr)
-
-      USE dimphy
-      IMPLICIT none
-c======================================================================
-c Auteur(s): O. Boucher (LOA/LMD) date: 19961127
-c            inspire de clvent
-c Objet: diffusion verticale de traceurs avec flux fixe a la surface
-c        ou/et flux du type c-drag
-c======================================================================
-c Arguments:
-c dtime----input-R- intervalle du temps (en second)
-c coef-----input-R- le coefficient d'echange (m**2/s) l>1
-c yu1------input-R- le vent dans le 1iere couche
-c yv1------input-R- le vent dans le 1iere couche
-c t--------input-R- temperature (K)
-c tr-------input-R- la q. de traceurs
-c flux-----input-R- le flux de traceurs a la surface
-c paprs----input-R- pression a inter-couche (Pa)
-c pplay----input-R- pression au milieu de couche (Pa)
-c delp-----input-R- epaisseur de couche (Pa)
-c cdrag----input-R- cdrag pour le flux de surface (non active)
-c tr0------input-R- traceurs a la surface ou dans l'ocean (non active)
-c d_tr-----output-R- le changement de tr
-c flux_tr--output-R- flux de tr
-c======================================================================
-      INCLUDE "dimensions.h"
-      REAL dtime
-      REAL coef(klon,klev)
-      REAL yu1(klon), yv1(klon)
-      REAL t(klon,klev), tr(klon,klev)
-      REAL paprs(klon,klev+1), pplay(klon,klev), delp(klon,klev)
-      REAL d_tr(klon,klev)
-      REAL flux(klon), cdrag(klon), tr0(klon)
-c      REAL flux_tr(klon,klev)
-c======================================================================
-      INCLUDE "YOMCST.h"
-c======================================================================
-      INTEGER i, k
-      REAL zx_ctr(klon,2:klev)
-      REAL zx_dtr(klon,2:klev)
-      REAL zx_buf(klon)
-      REAL zx_coef(klon,klev)
-      REAL local_tr(klon,klev)
-      REAL zx_alf1(klon), zx_alf2(klon), zx_flux(klon)
-c======================================================================
-c CHECKING VALUES
-!      print *,'CHECKING VALUES IN CLTRAC (INI)'
-!      print *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
-!      print *,'flux = ',sum(flux),MINVAL(flux),MAXVAL(flux)
-!      print *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
-c======================================================================
-      DO k = 1, klev
-      DO i = 1, klon
-         local_tr(i,k) = tr(i,k)
-         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-      ENDDO
-      ENDDO
-c======================================================================
-      DO i = 1, klon
-         zx_alf1(i) = (paprs(i,1)-pplay(i,2))/(pplay(i,1)-pplay(i,2))
-         zx_alf2(i) = 1.0 - zx_alf1(i)
-         zx_flux(i) =  -flux(i)*dtime*RG
-c--pour le moment le flux est prescrit
-         cdrag(i) = 0.0 
-c         cdrag(i) =  coef(i,1) * (1.0+SQRT(yu1(i)**2+yv1(i)**2))
-c     .                * pplay(i,1)/(RD*t(i,1))
-         tr0(i) = 0.0
-         zx_coef(i,1) = cdrag(i)*dtime*RG 
-      ENDDO
-c======================================================================
-      DO k = 2, klev
-      DO i = 1, klon
-         zx_coef(i,k) = coef(i,k)*RG/(pplay(i,k-1)-pplay(i,k))
-     .                  *(paprs(i,k)*2/(t(i,k)+t(i,k-1))/RD)**2
-         zx_coef(i,k) = zx_coef(i,k)*dtime*RG
-      ENDDO
-      ENDDO
-c======================================================================
-      DO i = 1, klon
-         zx_buf(i) = delp(i,1) + zx_coef(i,1)*zx_alf1(i) + zx_coef(i,2)
-         zx_ctr(i,2) = (local_tr(i,1)*delp(i,1)+
-     .                  zx_coef(i,1)*tr0(i)-zx_flux(i))/zx_buf(i)
-         zx_dtr(i,2) = (zx_coef(i,2)-zx_alf2(i)*zx_coef(i,1)) / 
-     .                  zx_buf(i)
-      ENDDO
-c
-      DO k = 3, klev
-      DO i = 1, klon
-         zx_buf(i) = delp(i,k-1) + zx_coef(i,k)
-     .                  + zx_coef(i,k-1)*(1.-zx_dtr(i,k-1))
-         zx_ctr(i,k) = (local_tr(i,k-1)*delp(i,k-1)
-     .                  +zx_coef(i,k-1)*zx_ctr(i,k-1) )/zx_buf(i)
-         zx_dtr(i,k) = zx_coef(i,k)/zx_buf(i)
-      ENDDO
-      ENDDO
-      DO i = 1, klon
-         local_tr(i,klev) = ( local_tr(i,klev)*delp(i,klev)
-     .                        +zx_coef(i,klev)*zx_ctr(i,klev) )
-     .                   / ( delp(i,klev) + zx_coef(i,klev)
-     .                       -zx_coef(i,klev)*zx_dtr(i,klev) )
-      ENDDO
-      DO k = klev-1, 1, -1
-      DO i = 1, klon
-         local_tr(i,k) = zx_ctr(i,k+1) + zx_dtr(i,k+1)*local_tr(i,k+1)
-      ENDDO
-      ENDDO
-c======================================================================
-!      print *,'CHECKING VALUES IN CLTRAC (FIN)'
-!      print *,'local_tr = ',sum(local_tr),MINVAL(local_tr),
-!     .                                    MAXVAL(local_tr)
-!      print *,'zx_ctr = ',sum(zx_ctr),MINVAL(zx_ctr),MAXVAL(zx_ctr)
-!      print *,'zx_dtr = ',sum(zx_dtr),MINVAL(zx_dtr),MAXVAL(zx_dtr)
-!      print *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
-c======================================================================
-c== flux_tr est le flux de traceur (positif vers bas)
-c      DO i = 1, klon
-c         flux_tr(i,1) = zx_coef(i,1)/(RG*dtime)
-c      ENDDO
-c      DO k = 2, klev
-c      DO i = 1, klon
-c         flux_tr(i,k) = zx_coef(i,k)/(RG*dtime)
-c     .               * (local_tr(i,k)-local_tr(i,k-1))
-c      ENDDO
-c      ENDDO
-c======================================================================
-      DO k = 1, klev
-      DO i = 1, klon
-         d_tr(i,k) = local_tr(i,k) - tr(i,k)
-      ENDDO
-      ENDDO
-!      print *,'CHECKING VALUES IN CLTRAC (END)'
-!      print *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
-c
-      RETURN
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cltrac_spl.f90	(revision 5099)
@@ -0,0 +1,137 @@
+SUBROUTINE cltrac_spl(dtime, coef, yu1, yv1, t, tr, &
+        flux, paprs, pplay, d_tr)
+
+  USE dimphy
+  IMPLICIT none
+  !======================================================================
+  ! Auteur(s): O. Boucher (LOA/LMD) date: 19961127
+  ! inspire de clvent
+  ! Objet: diffusion verticale de traceurs avec flux fixe a la surface
+  ! ou/et flux du type c-drag
+  !======================================================================
+  ! Arguments:
+  ! dtime----input-R- intervalle du temps (en second)
+  ! coef-----input-R- le coefficient d'echange (m**2/s) l>1
+  ! yu1------input-R- le vent dans le 1iere couche
+  ! yv1------input-R- le vent dans le 1iere couche
+  ! t--------input-R- temperature (K)
+  ! tr-------input-R- la q. de traceurs
+  ! flux-----input-R- le flux de traceurs a la surface
+  ! paprs----input-R- pression a inter-couche (Pa)
+  ! pplay----input-R- pression au milieu de couche (Pa)
+  ! delp-----input-R- epaisseur de couche (Pa)
+  ! cdrag----input-R- cdrag pour le flux de surface (non active)
+  ! tr0------input-R- traceurs a la surface ou dans l'ocean (non active)
+  ! d_tr-----output-R- le changement de tr
+  ! flux_tr--output-R- flux de tr
+  !======================================================================
+  INCLUDE "dimensions.h"
+  REAL :: dtime
+  REAL :: coef(klon, klev)
+  REAL :: yu1(klon), yv1(klon)
+  REAL :: t(klon, klev), tr(klon, klev)
+  REAL :: paprs(klon, klev + 1), pplay(klon, klev), delp(klon, klev)
+  REAL :: d_tr(klon, klev)
+  REAL :: flux(klon), cdrag(klon), tr0(klon)
+  ! REAL flux_tr(klon,klev)
+  !======================================================================
+  INCLUDE "YOMCST.h"
+  !======================================================================
+  INTEGER :: i, k
+  REAL :: zx_ctr(klon, 2:klev)
+  REAL :: zx_dtr(klon, 2:klev)
+  REAL :: zx_buf(klon)
+  REAL :: zx_coef(klon, klev)
+  REAL :: local_tr(klon, klev)
+  REAL :: zx_alf1(klon), zx_alf2(klon), zx_flux(klon)
+  !======================================================================
+  ! CHECKING VALUES
+  ! print *,'CHECKING VALUES IN CLTRAC (INI)'
+  ! print *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
+  ! print *,'flux = ',sum(flux),MINVAL(flux),MAXVAL(flux)
+  ! print *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
+  !======================================================================
+  DO k = 1, klev
+    DO i = 1, klon
+      local_tr(i, k) = tr(i, k)
+      delp(i, k) = paprs(i, k) - paprs(i, k + 1)
+    ENDDO
+  ENDDO
+  !======================================================================
+  DO i = 1, klon
+    zx_alf1(i) = (paprs(i, 1) - pplay(i, 2)) / (pplay(i, 1) - pplay(i, 2))
+    zx_alf2(i) = 1.0 - zx_alf1(i)
+    zx_flux(i) = -flux(i) * dtime * RG
+    !--pour le moment le flux est prescrit
+    cdrag(i) = 0.0
+    ! cdrag(i) =  coef(i,1) * (1.0+SQRT(yu1(i)**2+yv1(i)**2))
+    ! .                * pplay(i,1)/(RD*t(i,1))
+    tr0(i) = 0.0
+    zx_coef(i, 1) = cdrag(i) * dtime * RG
+  ENDDO
+  !======================================================================
+  DO k = 2, klev
+    DO i = 1, klon
+      zx_coef(i, k) = coef(i, k) * RG / (pplay(i, k - 1) - pplay(i, k)) &
+              * (paprs(i, k) * 2 / (t(i, k) + t(i, k - 1)) / RD)**2
+      zx_coef(i, k) = zx_coef(i, k) * dtime * RG
+    ENDDO
+  ENDDO
+  !======================================================================
+  DO i = 1, klon
+    zx_buf(i) = delp(i, 1) + zx_coef(i, 1) * zx_alf1(i) + zx_coef(i, 2)
+    zx_ctr(i, 2) = (local_tr(i, 1) * delp(i, 1) + &
+            zx_coef(i, 1) * tr0(i) - zx_flux(i)) / zx_buf(i)
+    zx_dtr(i, 2) = (zx_coef(i, 2) - zx_alf2(i) * zx_coef(i, 1)) / &
+            zx_buf(i)
+  ENDDO
+
+  DO k = 3, klev
+    DO i = 1, klon
+      zx_buf(i) = delp(i, k - 1) + zx_coef(i, k) &
+              + zx_coef(i, k - 1) * (1. - zx_dtr(i, k - 1))
+      zx_ctr(i, k) = (local_tr(i, k - 1) * delp(i, k - 1) &
+              + zx_coef(i, k - 1) * zx_ctr(i, k - 1)) / zx_buf(i)
+      zx_dtr(i, k) = zx_coef(i, k) / zx_buf(i)
+    ENDDO
+  ENDDO
+  DO i = 1, klon
+    local_tr(i, klev) = (local_tr(i, klev) * delp(i, klev) &
+            + zx_coef(i, klev) * zx_ctr(i, klev)) &
+            / (delp(i, klev) + zx_coef(i, klev) &
+                    - zx_coef(i, klev) * zx_dtr(i, klev))
+  ENDDO
+  DO k = klev - 1, 1, -1
+    DO i = 1, klon
+      local_tr(i, k) = zx_ctr(i, k + 1) + zx_dtr(i, k + 1) * local_tr(i, k + 1)
+    ENDDO
+  ENDDO
+  !======================================================================
+  ! print *,'CHECKING VALUES IN CLTRAC (FIN)'
+  ! print *,'local_tr = ',sum(local_tr),MINVAL(local_tr),
+  ! .                                    MAXVAL(local_tr)
+  !  print *,'zx_ctr = ',sum(zx_ctr),MINVAL(zx_ctr),MAXVAL(zx_ctr)
+  !  print *,'zx_dtr = ',sum(zx_dtr),MINVAL(zx_dtr),MAXVAL(zx_dtr)
+  !  print *,'tr = ',sum(tr),MINVAL(tr),MAXVAL(tr)
+  !======================================================================
+  !== flux_tr est le flux de traceur (positif vers bas)
+  !  DO i = 1, klon
+  !     flux_tr(i,1) = zx_coef(i,1)/(RG*dtime)
+  !  ENDDO
+  !  DO k = 2, klev
+  !  DO i = 1, klon
+  !     flux_tr(i,k) = zx_coef(i,k)/(RG*dtime)
+  ! .               * (local_tr(i,k)-local_tr(i,k-1))
+  !  ENDDO
+  !  ENDDO
+  !======================================================================
+  DO k = 1, klev
+    DO i = 1, klon
+      d_tr(i, k) = local_tr(i, k) - tr(i, k)
+    ENDDO
+  ENDDO
+  ! print *,'CHECKING VALUES IN CLTRAC (END)'
+  ! print *,'d_tr = ',sum(d_tr),MINVAL(d_tr),MAXVAL(d_tr)
+
+  RETURN
+END SUBROUTINE cltrac_spl
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cm3_to_kg.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cm3_to_kg.F	(revision 5098)
+++ 	(revision )
@@ -1,25 +1,0 @@
-      SUBROUTINE cm3_to_kg(pplay,t_seri,tr_seri)
-
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-
-      IMPLICIT NONE
-c
-      INCLUDE "dimensions.h"
-      INCLUDE "YOMCST.h"
-c      
-      REAL t_seri(klon,klev), pplay(klon,klev)
-      REAL tr_seri(klon,klev)
-      REAL zrho
-      INTEGER i, k
-c
-!JE20150707      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
-      DO k = 1, klev
-      DO i = 1, klon
-        zrho=pplay(i,k)/t_seri(i,k)/RD
-        tr_seri(i,k)=tr_seri(i,k)*1.e6/zrho
-      ENDDO
-      ENDDO
-c 
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cm3_to_kg.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cm3_to_kg.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/cm3_to_kg.f90	(revision 5099)
@@ -0,0 +1,25 @@
+SUBROUTINE cm3_to_kg(pplay, t_seri, tr_seri)
+
+  USE dimphy
+  USE infotrac
+  USE indice_sol_mod
+
+  IMPLICIT NONE
+
+  INCLUDE "dimensions.h"
+  INCLUDE "YOMCST.h"
+
+  REAL :: t_seri(klon, klev), pplay(klon, klev)
+  REAL :: tr_seri(klon, klev)
+  REAL :: zrho
+  INTEGER :: i, k
+
+  !JE20150707      RD = 1000.0 * 1.380658E-23 * 6.0221367E+23 / 28.9644
+  DO k = 1, klev
+    DO i = 1, klon
+      zrho = pplay(i, k) / t_seri(i, k) / RD
+      tr_seri(i, k) = tr_seri(i, k) * 1.e6 / zrho
+    ENDDO
+  ENDDO
+
+END SUBROUTINE cm3_to_kg
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/coarsemission.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/coarsemission.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/coarsemission.F	(revision 5099)
@@ -24,5 +24,4 @@
 !      CALL dustemission( debutphy, xlat, xlon, pctsrf, 
 !     .               zu10m     zv10m,wstar,ale_bl,ale_wake)
-!
 
       USE dimphy
@@ -276,5 +275,5 @@
      .     MINVAL(source_tr(:,id_coss)), MAXVAL(source_tr(:,id_coss))
       ENDIF
-!
+
       DO i=1,klon
 ! Original line (4 tracers)
@@ -287,5 +286,5 @@
      . flux_tr(i,id_fine)+scale_param_ssacc
      .                            *lmt_sea_salt(i,1)*1.e4*1.e3      !mg/m2/s
-!
+
       IF(id_coss>0)  source_tr(i,id_coss)=
      . scale_param_sscoa*lmt_sea_salt(i,2)*1.e4    !g/m2/s
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.F	(revision 5098)
+++ 	(revision )
@@ -1,120 +1,0 @@
-      SUBROUTINE condsurfc(jour,lmt_bcff,lmt_bcbb,
-     .                     lmt_bcbbl,lmt_bcbbh,lmt_bc_penner,
-     .                     lmt_omff,lmt_ombb,lmt_ombbl,lmt_ombbh,
-     .                     lmt_omnat)
-      USE dimphy
-      USE netcdf, ONLY: nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite,nf90_get_var
-      IMPLICIT none
-!
-! Lire les conditions aux limites du modele pour la chimie.
-! --------------------------------------------------------
-!
-      INCLUDE "dimensions.h"
-
-      REAL lmt_bcff(klon), lmt_bcbb(klon),lmt_bc_penner(klon)
-      REAL lmt_omff(klon), lmt_ombb(klon)
-      REAL lmt_bcbbl(klon), lmt_bcbbh(klon)
-      REAL lmt_ombbl(klon), lmt_ombbh(klon)
-      REAL lmt_omnat(klon)
-      REAL lmt_terp(klon)
-!
-      INTEGER jour, i
-      INTEGER ierr
-      INTEGER nid1,nvarid
-      INTEGER debut(2),epais(2)
-!
-      IF (jour<0 .OR. jour>(360-1)) THEN
-         IF (jour>(360-1).AND.jour<=367) THEN
-           jour=360-1
-           print *,'JE: jour changed to jour= ',jour
-         ELSE
-           PRINT*,'Le jour demande n est pas correcte:', jour
-           CALL ABORT
-         ENDIF
-      ENDIF
-!
-      ierr = nf90_open ("limitcarbon.nc", nf90_nowrite, nid1)
-      if (ierr/=nf90_noerr) then
-        write(6,*)' Pb d''ouverture du fichier limitbc.nc'
-        write(6,*)' ierr = ', ierr
-        call exit(1)
-      endif
-!
-! Tranche a lire:
-      debut(1) = 1
-      debut(2) = jour+1
-      epais(1) = klon
-      epais(2) = 1
-!
-!
-      ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
-      ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais)
-!      print *,'IERR = ',ierr
-!      print *,'nf90_noerr = ',nf90_noerr
-!      print *,'debut = ',debut
-!      print *,'epais = ',epais
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC'
-         CALL exit(1)
-      ENDIF
-!
-!
-      ierr = nf90_inq_varid (nid1, "BCBB", nvarid)
-      ierr = nf90_get_var(nid1, nvarid, lmt_bcbb, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC-biomass'
-         CALL exit(1)
-      ENDIF
-!
-!
-      ierr = nf90_inq_varid (nid1, "BCBL", nvarid)
-      ierr = nf90_get_var(nid1, nvarid, lmt_bcbbl, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC low'
-         CALL exit(1)
-      ENDIF
-!
-!
-      ierr = nf90_inq_varid (nid1, "BCBH", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC high'
-         CALL exit(1)
-      ENDIF
-!
-      ierr = nf90_inq_varid (nid1, "TERP", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_terp, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources Terpene'
-         CALL exit(1)
-      ENDIF
-!
-!
-      ierr = nf90_inq_varid (nid1, "BC_penner", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bc_penner, debut,  epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC Penner'
-         CALL exit(1)
-      ENDIF
-!
-!
-      ierr = nf90_inq_varid (nid1, "OMFF", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_omff, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources om-ifossil'
-         CALL exit(1)
-      ENDIF
-!
-      DO i=1,klon
-        lmt_ombb(i)  = lmt_bcbb(i)*7.0*1.6      !OC/BC=7.0;OM/OC=1.6
-        lmt_ombbl(i) = lmt_bcbbl(i)*7.0*1.6
-        lmt_ombbh(i) = lmt_bcbbh(i)*7.0*1.6
-        lmt_omff(i)  = lmt_omff(i)*1.4          !--OM/OC=1.4
-        lmt_omnat(i)  = lmt_terp(i)*0.11*1.4 !-- 11% Terpene is OC
-      ENDDO
-!
-      ierr = nf90_close(nid1)
-      PRINT*, 'Carbon sources lues pour jour: ', jour
-!
-      RETURN
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc.f90	(revision 5099)
@@ -0,0 +1,120 @@
+SUBROUTINE condsurfc(jour, lmt_bcff, lmt_bcbb, &
+        lmt_bcbbl, lmt_bcbbh, lmt_bc_penner, &
+        lmt_omff, lmt_ombb, lmt_ombbl, lmt_ombbh, &
+        lmt_omnat)
+  USE dimphy
+  USE netcdf, ONLY : nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, nf90_nowrite, nf90_get_var
+  IMPLICIT none
+
+  ! Lire les conditions aux limites du modele pour la chimie.
+  ! --------------------------------------------------------
+
+  INCLUDE "dimensions.h"
+
+  REAL :: lmt_bcff(klon), lmt_bcbb(klon), lmt_bc_penner(klon)
+  REAL :: lmt_omff(klon), lmt_ombb(klon)
+  REAL :: lmt_bcbbl(klon), lmt_bcbbh(klon)
+  REAL :: lmt_ombbl(klon), lmt_ombbh(klon)
+  REAL :: lmt_omnat(klon)
+  REAL :: lmt_terp(klon)
+
+  INTEGER :: jour, i
+  INTEGER :: ierr
+  INTEGER :: nid1, nvarid
+  INTEGER :: debut(2), epais(2)
+
+  IF (jour<0 .OR. jour>(360 - 1)) THEN
+    IF (jour>(360 - 1).AND.jour<=367) THEN
+      jour = 360 - 1
+      print *, 'JE: jour changed to jour= ', jour
+    ELSE
+      PRINT*, 'Le jour demande n est pas correcte:', jour
+      CALL ABORT
+    ENDIF
+  ENDIF
+
+  ierr = nf90_open ("limitcarbon.nc", nf90_nowrite, nid1)
+  if (ierr/=nf90_noerr) then
+    write(6, *)' Pb d''ouverture du fichier limitbc.nc'
+    write(6, *)' ierr = ', ierr
+    call exit(1)
+  endif
+
+  ! Tranche a lire:
+  debut(1) = 1
+  debut(2) = jour + 1
+  epais(1) = klon
+  epais(2) = 1
+
+
+  ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
+  ierr = nf90_get_var(nid1, nvarid, lmt_bcff, debut, epais)
+  ! print *,'IERR = ',ierr
+  ! print *,'nf90_noerr = ',nf90_noerr
+  ! print *,'debut = ',debut
+  ! print *,'epais = ',epais
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources BC'
+    CALL exit(1)
+  ENDIF
+
+
+  ierr = nf90_inq_varid (nid1, "BCBB", nvarid)
+  ierr = nf90_get_var(nid1, nvarid, lmt_bcbb, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources BC-biomass'
+    CALL exit(1)
+  ENDIF
+
+
+  ierr = nf90_inq_varid (nid1, "BCBL", nvarid)
+  ierr = nf90_get_var(nid1, nvarid, lmt_bcbbl, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources BC low'
+    CALL exit(1)
+  ENDIF
+
+
+  ierr = nf90_inq_varid (nid1, "BCBH", nvarid)
+  ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources BC high'
+    CALL exit(1)
+  ENDIF
+
+  ierr = nf90_inq_varid (nid1, "TERP", nvarid)
+  ierr = nf90_get_var (nid1, nvarid, lmt_terp, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources Terpene'
+    CALL exit(1)
+  ENDIF
+
+
+  ierr = nf90_inq_varid (nid1, "BC_penner", nvarid)
+  ierr = nf90_get_var (nid1, nvarid, lmt_bc_penner, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources BC Penner'
+    CALL exit(1)
+  ENDIF
+
+
+  ierr = nf90_inq_varid (nid1, "OMFF", nvarid)
+  ierr = nf90_get_var (nid1, nvarid, lmt_omff, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources om-ifossil'
+    CALL exit(1)
+  ENDIF
+
+  DO i = 1, klon
+    lmt_ombb(i) = lmt_bcbb(i) * 7.0 * 1.6      !OC/BC=7.0;OM/OC=1.6
+    lmt_ombbl(i) = lmt_bcbbl(i) * 7.0 * 1.6
+    lmt_ombbh(i) = lmt_bcbbh(i) * 7.0 * 1.6
+    lmt_omff(i) = lmt_omff(i) * 1.4          !--OM/OC=1.4
+    lmt_omnat(i) = lmt_terp(i) * 0.11 * 1.4 !-- 11% Terpene is OC
+  ENDDO
+
+  ierr = nf90_close(nid1)
+  PRINT*, 'Carbon sources lues pour jour: ', jour
+
+  RETURN
+END SUBROUTINE condsurfc
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.F	(revision 5098)
+++ 	(revision )
@@ -1,215 +1,0 @@
-      SUBROUTINE condsurfc_new(jour,lmt_bcff, lmt_bcnff,
-     .                         lmt_bcbbl,lmt_bcbbh, lmt_bcba,
-     .                         lmt_omff,lmt_omnff,lmt_ombbl,lmt_ombbh,
-     .                                             lmt_omnat, lmt_omba)
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE dimphy
-      USE netcdf, ONLY:nf90_get_var,nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite
-      IMPLICIT none
-c
-c Lire les conditions aux limites du modele pour la chimie.
-c --------------------------------------------------------
-c
-      INCLUDE "dimensions.h"
-
-      REAL lmt_bcff(klon), lmt_bcnff(klon), lmt_bcba(klon)
-      REAL lmt_omff(klon), lmt_omnff(klon), lmt_ombb(klon)
-      REAL lmt_bcbbl(klon), lmt_bcbbh(klon)
-      REAL lmt_ombbl(klon), lmt_ombbh(klon)
-      REAL lmt_omnat(klon), lmt_omba(klon)
-      REAL lmt_terp(klon)
-c
-      REAL lmt_bcff_glo(klon_glo), lmt_bcnff_glo(klon_glo)
-      REAL lmt_bcba_glo(klon_glo)
-      REAL lmt_omff_glo(klon_glo), lmt_omnff_glo(klon_glo)
-      REAL lmt_ombb_glo(klon_glo)
-      REAL lmt_bcbbl_glo(klon_glo), lmt_bcbbh_glo(klon_glo)
-      REAL lmt_ombbl_glo(klon_glo), lmt_ombbh_glo(klon_glo)
-      REAL lmt_omnat_glo(klon_glo), lmt_omba_glo(klon_glo)
-      REAL lmt_terp_glo(klon_glo)
-!
-      INTEGER jour, i
-      INTEGER ierr
-      INTEGER nid1,nvarid
-      INTEGER debut(2),epais(2)
-c
-!      IF (jour.LT.0 .OR. jour.GT.(366-1)) THEN
-      IF (jour<0 .OR. jour>366) THEN
-         PRINT*,'Le jour demande n est pas correcte:', jour
-         print *,'JE: FORCED TO CONTINUE (emissions have
-     . to be longer than 1 year!!!! )'
-!JE         CALL ABORT
-      ENDIF
-
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-!
-! Tranche a lire:
-      debut(1) = 1
-      debut(2) = jour
-      epais(1) = klon_glo
-!      epais(1) = klon
-      epais(2) = 1
-!
-!=======================================================================
-!                        BC EMISSIONS
-!=======================================================================
-!
-      ierr = nf90_open ("carbon_emissions.nc", nf90_nowrite, nid1)
-      if (ierr/=nf90_noerr) then
-        write(6,*)' Pb d''ouverture du fichier limitbc.nc'
-        write(6,*)' ierr = ', ierr
-        call exit(1)
-      endif
-!
-! BC emissions from fossil fuel combustion
-!
-      ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bcff_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC'
-         CALL exit(1)
-      ENDIF
-      !print *,'lmt_bcff = ',lmt_bcff
-      !stop
-!
-! BC emissions from non fossil fuel combustion
-!
-      ierr = nf90_inq_varid (nid1, "BCNFF", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bcnff_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC'
-         CALL exit(1)
-      ENDIF
-!
-! Low BC emissions from biomass burning
-!
-      ierr = nf90_inq_varid (nid1, "BCBBL", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bcbbl_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC low'
-         CALL exit(1)
-      ENDIF
-!
-! High BC emissions from biomass burning
-!
-      ierr = nf90_inq_varid (nid1, "BCBBH", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC high'
-         CALL exit(1)
-      ENDIF
-!
-! BC emissions from ship transport
-!
-      ierr = nf90_inq_varid (nid1, "BCBA", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_bcba_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources BC'
-         CALL exit(1)
-      ENDIF
-!
-!=======================================================================
-!                        OM EMISSIONS 
-!=======================================================================
-!
-
-!
-! OM emissions from fossil fuel combustion
-!
-      ierr = nf90_inq_varid (nid1, "OMFF", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_omff_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources OM'
-         CALL exit(1)
-      ENDIF
-!
-! OM emissions from non fossil fuel combustion
-!
-      ierr = nf90_inq_varid (nid1, "OMNFF", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_omnff_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources OM'
-         CALL exit(1)
-      ENDIF
-!
-! Low OM emissions from biomass burning - low
-!
-      ierr = nf90_inq_varid (nid1, "OMBBL", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_ombbl_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources OM low'
-         CALL exit(1)
-      ENDIF
-!
-! High OM emissions from biomass burning - high
-!
-      ierr = nf90_inq_varid (nid1, "OMBBH", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_ombbh_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources OM high'
-         CALL exit(1)
-      ENDIF
-!
-! High OM emissions from ship
-!
-      ierr = nf90_inq_varid (nid1, "OMBA", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_omba_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources OM ship'
-         CALL exit(1)
-      ENDIF
-!
-! Natural Terpene emissions => Natural OM emissions
-!
-      ierr = nf90_inq_varid (nid1, "TERP", nvarid)
-      ierr = nf90_get_var (nid1, nvarid, lmt_terp_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources Terpene'
-         CALL exit(1)
-      ENDIF
-!
-      DO i=1,klon_glo
-        lmt_omnat_glo(i)  = lmt_terp_glo(i)*0.11*1.4 !-- 11% Terpene is OC
-      ENDDO
-
-      ierr = nf90_close(nid1)
-!
-      PRINT*, 'Carbon sources lues pour jour: ', jour
-!      lmt_bcff(klon)=0.0
-!      lmt_bcnff(klon)=0.0
-!      lmt_omff(klon)=0.0
-!      lmt_omnff(klon)=0.0
-!      lmt_ombb(klon)=0.0
-!      lmt_bcbbl(klon)=0.0
-!      lmt_bcbbh(klon)=0.0
-!      lmt_ombbl(klon)=0.0
-!      lmt_ombbh(klon)=0.0
-!      lmt_omnat(klon)=0.0
-!      lmt_omba(klon)=0.0
-!      lmt_terp(klon)=0.0
-
-
-      ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-      call scatter( lmt_bcff_glo   , lmt_bcff )   
-      call scatter( lmt_bcnff_glo  , lmt_bcnff )
-      call scatter( lmt_bcbbl_glo  , lmt_bcbbl )
-      call scatter( lmt_bcbbh_glo  , lmt_bcbbh )
-      call scatter( lmt_bcba_glo   , lmt_bcba )
-      call scatter( lmt_omff_glo   , lmt_omff )
-      call scatter( lmt_omnff_glo  , lmt_omnff )
-      call scatter( lmt_ombbl_glo  , lmt_ombbl )
-      call scatter( lmt_ombbh_glo  , lmt_ombbh )
-      call scatter( lmt_omba_glo   , lmt_omba )
-      call scatter( lmt_terp_glo   , lmt_terp )
-      call scatter( lmt_omnat_glo  , lmt_omnat )
-
-
-
-
-
-      RETURN
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90	(revision 5099)
@@ -0,0 +1,208 @@
+SUBROUTINE condsurfc_new(jour, lmt_bcff, lmt_bcnff, &
+        lmt_bcbbl, lmt_bcbbh, lmt_bcba, &
+        lmt_omff, lmt_omnff, lmt_ombbl, lmt_ombbh, &
+        lmt_omnat, lmt_omba)
+  USE mod_grid_phy_lmdz
+  USE mod_phys_lmdz_para
+  USE dimphy
+  USE netcdf, ONLY : nf90_get_var, nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, nf90_nowrite
+  IMPLICIT none
+
+  ! Lire les conditions aux limites du modele pour la chimie.
+  ! --------------------------------------------------------
+
+  INCLUDE "dimensions.h"
+
+  REAL :: lmt_bcff(klon), lmt_bcnff(klon), lmt_bcba(klon)
+  REAL :: lmt_omff(klon), lmt_omnff(klon), lmt_ombb(klon)
+  REAL :: lmt_bcbbl(klon), lmt_bcbbh(klon)
+  REAL :: lmt_ombbl(klon), lmt_ombbh(klon)
+  REAL :: lmt_omnat(klon), lmt_omba(klon)
+  REAL :: lmt_terp(klon)
+
+  REAL :: lmt_bcff_glo(klon_glo), lmt_bcnff_glo(klon_glo)
+  REAL :: lmt_bcba_glo(klon_glo)
+  REAL :: lmt_omff_glo(klon_glo), lmt_omnff_glo(klon_glo)
+  REAL :: lmt_ombb_glo(klon_glo)
+  REAL :: lmt_bcbbl_glo(klon_glo), lmt_bcbbh_glo(klon_glo)
+  REAL :: lmt_ombbl_glo(klon_glo), lmt_ombbh_glo(klon_glo)
+  REAL :: lmt_omnat_glo(klon_glo), lmt_omba_glo(klon_glo)
+  REAL :: lmt_terp_glo(klon_glo)
+
+  INTEGER :: jour, i
+  INTEGER :: ierr
+  INTEGER :: nid1, nvarid
+  INTEGER :: debut(2), epais(2)
+
+  !  IF (jour.LT.0 .OR. jour.GT.(366-1)) THEN
+  IF (jour<0 .OR. jour>366) THEN
+    PRINT*, 'Le jour demande n est pas correcte:', jour
+    print *, 'JE: FORCED TO CONTINUE (emissions have&
+            & to be longer than 1 year!!!! )'
+    !JE         CALL ABORT
+  ENDIF
+
+  !$OMP MASTER
+  IF (is_mpi_root .AND. is_omp_root) THEN
+
+    ! Tranche a lire:
+    debut(1) = 1
+    debut(2) = jour
+    epais(1) = klon_glo
+    ! epais(1) = klon
+    epais(2) = 1
+
+    !=======================================================================
+    !                    BC EMISSIONS
+    !=======================================================================
+
+    ierr = nf90_open ("carbon_emissions.nc", nf90_nowrite, nid1)
+    if (ierr/=nf90_noerr) then
+      write(6, *)' Pb d''ouverture du fichier limitbc.nc'
+      write(6, *)' ierr = ', ierr
+      call exit(1)
+    endif
+
+    ! BC emissions from fossil fuel combustion
+
+    ierr = nf90_inq_varid (nid1, "BCFF", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_bcff_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources BC'
+      CALL exit(1)
+    ENDIF
+    ! !print *,'lmt_bcff = ',lmt_bcff
+    ! !stop
+
+    ! BC emissions from non fossil fuel combustion
+
+    ierr = nf90_inq_varid (nid1, "BCNFF", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_bcnff_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources BC'
+      CALL exit(1)
+    ENDIF
+
+    ! Low BC emissions from biomass burning
+
+    ierr = nf90_inq_varid (nid1, "BCBBL", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_bcbbl_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources BC low'
+      CALL exit(1)
+    ENDIF
+
+    ! High BC emissions from biomass burning
+
+    ierr = nf90_inq_varid (nid1, "BCBBH", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_bcbbh_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources BC high'
+      CALL exit(1)
+    ENDIF
+
+    ! BC emissions from ship transport
+
+    ierr = nf90_inq_varid (nid1, "BCBA", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_bcba_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources BC'
+      CALL exit(1)
+    ENDIF
+
+    !=======================================================================
+    ! OM EMISSIONS
+    !=======================================================================
+
+    ! OM emissions from fossil fuel combustion
+
+    ierr = nf90_inq_varid (nid1, "OMFF", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_omff_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources OM'
+      CALL exit(1)
+    ENDIF
+
+    ! OM emissions from non fossil fuel combustion
+
+    ierr = nf90_inq_varid (nid1, "OMNFF", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_omnff_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources OM'
+      CALL exit(1)
+    ENDIF
+
+    ! Low OM emissions from biomass burning - low
+
+    ierr = nf90_inq_varid (nid1, "OMBBL", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_ombbl_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources OM low'
+      CALL exit(1)
+    ENDIF
+
+    ! High OM emissions from biomass burning - high
+
+    ierr = nf90_inq_varid (nid1, "OMBBH", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_ombbh_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources OM high'
+      CALL exit(1)
+    ENDIF
+
+    ! High OM emissions from ship
+
+    ierr = nf90_inq_varid (nid1, "OMBA", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_omba_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources OM ship'
+      CALL exit(1)
+    ENDIF
+
+    ! Natural Terpene emissions => Natural OM emissions
+
+    ierr = nf90_inq_varid (nid1, "TERP", nvarid)
+    ierr = nf90_get_var (nid1, nvarid, lmt_terp_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources Terpene'
+      CALL exit(1)
+    ENDIF
+
+    DO i = 1, klon_glo
+      lmt_omnat_glo(i) = lmt_terp_glo(i) * 0.11 * 1.4 !-- 11% Terpene is OC
+    ENDDO
+
+    ierr = nf90_close(nid1)
+
+    PRINT*, 'Carbon sources lues pour jour: ', jour
+    ! lmt_bcff(klon)=0.0
+    ! lmt_bcnff(klon)=0.0
+    ! lmt_omff(klon)=0.0
+    ! lmt_omnff(klon)=0.0
+    ! lmt_ombb(klon)=0.0
+    ! lmt_bcbbl(klon)=0.0
+    ! lmt_bcbbh(klon)=0.0
+    ! lmt_ombbl(klon)=0.0
+    ! lmt_ombbh(klon)=0.0
+    ! lmt_omnat(klon)=0.0
+    ! lmt_omba(klon)=0.0
+    ! lmt_terp(klon)=0.0
+
+  ENDIF
+  !$OMP END MASTER
+  !$OMP BARRIER
+  call scatter(lmt_bcff_glo, lmt_bcff)
+  call scatter(lmt_bcnff_glo, lmt_bcnff)
+  call scatter(lmt_bcbbl_glo, lmt_bcbbl)
+  call scatter(lmt_bcbbh_glo, lmt_bcbbh)
+  call scatter(lmt_bcba_glo, lmt_bcba)
+  call scatter(lmt_omff_glo, lmt_omff)
+  call scatter(lmt_omnff_glo, lmt_omnff)
+  call scatter(lmt_ombbl_glo, lmt_ombbl)
+  call scatter(lmt_ombbh_glo, lmt_ombbh)
+  call scatter(lmt_omba_glo, lmt_omba)
+  call scatter(lmt_terp_glo, lmt_terp)
+  call scatter(lmt_omnat_glo, lmt_omnat)
+
+  RETURN
+END SUBROUTINE condsurfc_new
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.F	(revision 5098)
+++ 	(revision )
@@ -1,237 +1,0 @@
-      SUBROUTINE condsurfs(jour, edgar, flag_dms,
-     .                     lmt_so2h, lmt_so2b, lmt_so2bb, lmt_so2ba,
-     .                     lmt_so2volc, lmt_altvolc,  
-     .                     lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc)
-       USE dimphy
-       USE netcdf, ONLY:nf90_close,nf90_noerr,nf90_inq_varid,nf90_open,nf90_nowrite,nf90_get_var
-      IMPLICIT none
-c
-c Lire les conditions aux limites du modele pour la chimie.
-c --------------------------------------------------------
-c
-      INCLUDE "dimensions.h"
-c
-      REAL lmt_so2h(klon), lmt_so2b(klon), lmt_so2bb(klon)
-      REAL lmt_dmsbio(klon), lmt_h2sbio(klon), lmt_so2ba(klon)
-      REAL lmt_so2volc(klon), lmt_altvolc(klon)
-      REAL lmt_dms(klon), lmt_dmsconc(klon)
-      LOGICAL edgar
-      INTEGER flag_dms
-c
-      INTEGER jour, i
-      INTEGER ierr
-      INTEGER nid,nvarid
-      INTEGER debut(2),epais(2)
-c
-      IF (jour<0 .OR. jour>(360-1)) THEN
-         IF ((jour>(360-1)) .AND. (jour<=367)) THEN
-           jour=360-1
-           print *,'JE: jour changed to jour= ',jour
-         ELSE
-           PRINT*,'Le jour demande n est pas correcte:', jour
-           CALL ABORT
-         ENDIF
-      ENDIF
-c
-      ierr = nf90_open ("limitsoufre.nc", nf90_nowrite, nid)
-      if (ierr/=nf90_noerr) then
-        write(6,*)' Pb d''ouverture du fichier limitsoufre.nc'
-        write(6,*)' ierr = ', ierr
-        call exit(1)
-      endif
-c
-c Tranche a lire:
-      debut(1) = 1
-      debut(2) = jour+1
-      epais(1) = klon
-      epais(2) = 1
-c
-      ierr = nf90_inq_varid (nid, "VOLC", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 volcan'
-         CALL exit(1)
-      ENDIF
-c
-      ierr = nf90_inq_varid (nid, "ALTI", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les altitudes volcan'
-         CALL exit(1)
-      ENDIF
-c
-      IF (edgar) THEN   !--EDGAR w/o ship and biomass burning
-c
-      ierr = nf90_inq_varid (nid, "SO2ED95L", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 edgar low'
-         CALL exit(1)
-      ENDIF
-c
-      ierr = nf90_inq_varid (nid, "SO2ED95H", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 edgar high'
-         CALL exit(1)
-      ENDIF
-c
-      ELSE  !--GEIA 
-c
-      ierr = nf90_inq_varid (nid, "SO2H", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 haut'
-         CALL exit(1)
-      ENDIF
-c
-      ierr = nf90_inq_varid (nid, "SO2B", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 bas'
-         CALL exit(1)
-      ENDIF
-c
-      ENDIF  !--edgar
-c
-      ierr = nf90_inq_varid (nid, "SO2BB", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 bb'
-         CALL exit(1)
-      ENDIF
-c
-      ierr = nf90_inq_varid (nid, "SO2BA", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 bateau'
-         CALL exit(1)
-      ENDIF
-c
-      ierr = nf90_inq_varid (nid, "DMSB", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms bio'
-         CALL exit(1)
-      ENDIF
-c
-      ierr = nf90_inq_varid (nid, "H2SB", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources h2s bio'
-         CALL exit(1)
-      ENDIF
-c
-      IF (flag_dms==1) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSL", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms liss'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==2) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSW", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms wann'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==3) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC1", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dmsconc old'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==4) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC2", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 2'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==5) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC3", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 3'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==6) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC4", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 4'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==7) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC5", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 5'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==8) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC6", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 6'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==9) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC7", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 7'
-         CALL exit(1)
-      ENDIF
-c
-      ELSEIF (flag_dms==10) THEN 
-c
-      ierr = nf90_inq_varid (nid, "DMSC8", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 8'
-         CALL exit(1)
-      ENDIF
-c
-      ELSE 
-c
-         PRINT *,'choix non possible pour flag_dms'
-         STOP
-c
-      ENDIF
-c
-      ierr = nf90_close(nid)
-c
-      IF (flag_dms<=2) THEN 
-      DO i=1, klon 
-         lmt_dmsconc(i)=0.0
-      ENDDO
-      ELSE 
-      DO i=1, klon 
-         lmt_dms(i)=0.0
-      ENDDO
-      ENDIF
-c
-      PRINT*, 'Sources SOUFRE lues pour jour: ', jour
-c
-      RETURN
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs.f90	(revision 5099)
@@ -0,0 +1,238 @@
+SUBROUTINE condsurfs(jour, edgar, flag_dms, &
+        lmt_so2h, lmt_so2b, lmt_so2bb, lmt_so2ba, &
+        lmt_so2volc, lmt_altvolc, &
+        lmt_dmsbio, lmt_h2sbio, lmt_dms, lmt_dmsconc)
+  USE dimphy
+  USE netcdf, ONLY : nf90_close, nf90_noerr, nf90_inq_varid, nf90_open, &
+          nf90_nowrite, nf90_get_var
+  IMPLICIT none
+
+  ! Lire les conditions aux limites du modele pour la chimie.
+  ! --------------------------------------------------------
+
+  INCLUDE "dimensions.h"
+
+  REAL :: lmt_so2h(klon), lmt_so2b(klon), lmt_so2bb(klon)
+  REAL :: lmt_dmsbio(klon), lmt_h2sbio(klon), lmt_so2ba(klon)
+  REAL :: lmt_so2volc(klon), lmt_altvolc(klon)
+  REAL :: lmt_dms(klon), lmt_dmsconc(klon)
+  LOGICAL :: edgar
+  INTEGER :: flag_dms
+
+  INTEGER :: jour, i
+  INTEGER :: ierr
+  INTEGER :: nid, nvarid
+  INTEGER :: debut(2), epais(2)
+
+  IF (jour<0 .OR. jour>(360 - 1)) THEN
+    IF ((jour>(360 - 1)) .AND. (jour<=367)) THEN
+      jour = 360 - 1
+      print *, 'JE: jour changed to jour= ', jour
+    ELSE
+      PRINT*, 'Le jour demande n est pas correcte:', jour
+      CALL ABORT
+    ENDIF
+  ENDIF
+
+  ierr = nf90_open ("limitsoufre.nc", nf90_nowrite, nid)
+  if (ierr/=nf90_noerr) then
+    write(6, *)' Pb d''ouverture du fichier limitsoufre.nc'
+    write(6, *)' ierr = ', ierr
+    call exit(1)
+  endif
+
+  ! Tranche a lire:
+  debut(1) = 1
+  debut(2) = jour + 1
+  epais(1) = klon
+  epais(2) = 1
+
+  ierr = nf90_inq_varid (nid, "VOLC", nvarid)
+  ierr = nf90_get_var(nid, nvarid, lmt_so2volc, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources so2 volcan'
+    CALL exit(1)
+  ENDIF
+
+  ierr = nf90_inq_varid (nid, "ALTI", nvarid)
+  ierr = nf90_get_var(nid, nvarid, lmt_altvolc, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les altitudes volcan'
+    CALL exit(1)
+  ENDIF
+
+  IF (edgar) THEN   !--EDGAR w/o ship and biomass burning
+
+    ierr = nf90_inq_varid (nid, "SO2ED95L", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 edgar low'
+      CALL exit(1)
+    ENDIF
+
+    ierr = nf90_inq_varid (nid, "SO2ED95H", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 edgar high'
+      CALL exit(1)
+    ENDIF
+
+  ELSE  !--GEIA
+
+    ierr = nf90_inq_varid (nid, "SO2H", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2h, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 haut'
+      CALL exit(1)
+    ENDIF
+
+    ierr = nf90_inq_varid (nid, "SO2B", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2b, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 bas'
+      CALL exit(1)
+    ENDIF
+
+  ENDIF  !--edgar
+
+  ierr = nf90_inq_varid (nid, "SO2BB", nvarid)
+  ierr = nf90_get_var(nid, nvarid, lmt_so2bb, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources so2 bb'
+    CALL exit(1)
+  ENDIF
+
+  ierr = nf90_inq_varid (nid, "SO2BA", nvarid)
+  ierr = nf90_get_var(nid, nvarid, lmt_so2ba, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources so2 bateau'
+    CALL exit(1)
+  ENDIF
+
+  ierr = nf90_inq_varid (nid, "DMSB", nvarid)
+  ierr = nf90_get_var(nid, nvarid, lmt_dmsbio, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources dms bio'
+    CALL exit(1)
+  ENDIF
+
+  ierr = nf90_inq_varid (nid, "H2SB", nvarid)
+  ierr = nf90_get_var(nid, nvarid, lmt_h2sbio, debut, epais)
+  IF (ierr /= nf90_noerr) THEN
+    PRINT*, 'Pb de lecture pour les sources h2s bio'
+    CALL exit(1)
+  ENDIF
+
+  IF (flag_dms==1) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSL", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms liss'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==2) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSW", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dms, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms wann'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==3) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC1", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dmsconc old'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==4) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC2", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 2'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==5) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC3", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 3'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==6) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC4", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 4'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==7) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC5", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 5'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==8) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC6", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 6'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==9) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC7", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 7'
+      CALL exit(1)
+    ENDIF
+
+  ELSEIF (flag_dms==10) THEN
+
+    ierr = nf90_inq_varid (nid, "DMSC8", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsconc, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms conc 8'
+      CALL exit(1)
+    ENDIF
+
+  ELSE
+
+    PRINT *, 'choix non possible pour flag_dms'
+    STOP
+
+  ENDIF
+
+  ierr = nf90_close(nid)
+
+  IF (flag_dms<=2) THEN
+    DO i = 1, klon
+      lmt_dmsconc(i) = 0.0
+    ENDDO
+  ELSE
+    DO i = 1, klon
+      lmt_dms(i) = 0.0
+    ENDDO
+  ENDIF
+
+  PRINT*, 'Sources SOUFRE lues pour jour: ', jour
+
+  RETURN
+END SUBROUTINE condsurfs
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.F	(revision 5098)
+++ 	(revision )
@@ -1,266 +1,0 @@
-      SUBROUTINE condsurfs_new(jour, edgar, flag_dms,
-     .                         lmt_so2b, lmt_so2h, lmt_so2nff,
-     .                         lmt_so2bb_l, lmt_so2bb_h, lmt_so2ba,
-     .                         lmt_so2volc_cont, lmt_altvolc_cont,  
-     .                         lmt_so2volc_expl, lmt_altvolc_expl,  
-     .                         lmt_dmsbio, lmt_h2sbio, lmt_dms, 
-     .                                                      lmt_dmsconc)
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE dimphy
-      USE netcdf, ONLY: nf90_get_var,nf90_inq_varid,nf90_close,nf90_noerr,nf90_open,nf90_nowrite
-      IMPLICIT none
-c
-c Lire les conditions aux limites du modele pour la chimie.
-c --------------------------------------------------------
-c
-      INCLUDE "dimensions.h"
-c
-      REAL lmt_so2b(klon), lmt_so2h(klon), lmt_so2nff(klon)
-      REAL lmt_so2bb_l(klon), lmt_so2bb_h(klon)
-      REAL lmt_dmsbio(klon), lmt_h2sbio(klon), lmt_so2ba(klon)
-      REAL lmt_so2volc_cont(klon), lmt_altvolc_cont(klon)
-      REAL lmt_so2volc_expl(klon), lmt_altvolc_expl(klon)
-      REAL lmt_dms(klon), lmt_dmsconc(klon)
-
-      REAL lmt_so2b_glo(klon_glo), lmt_so2h_glo(klon_glo)
-      REAL lmt_so2nff_glo(klon_glo)
-      REAL lmt_so2bb_l_glo(klon_glo), lmt_so2bb_h_glo(klon_glo)
-      REAL lmt_dmsbio_glo(klon_glo), lmt_h2sbio_glo(klon_glo)
-      REAL lmt_so2ba_glo(klon_glo)
-      REAL lmt_so2volc_cont_glo(klon_glo),lmt_altvolc_cont_glo(klon_glo)
-      REAL lmt_so2volc_expl_glo(klon_glo),lmt_altvolc_expl_glo(klon_glo)
-      REAL lmt_dms_glo(klon_glo), lmt_dmsconc_glo(klon_glo)
-      LOGICAL edgar
-      INTEGER flag_dms
-c
-      INTEGER jour, i
-      INTEGER ierr
-      INTEGER nid,nvarid
-      INTEGER debut(2),epais(2)
-c
-      IF (jour<0 .OR. jour>(366-1)) THEN
-         PRINT*,'Le jour demande n est pas correcte:', jour
-         print *,'JE: FORCED TO CONTINUE (emissions have
-     . to be longer than 1 year!!!! )'
-!         CALL ABORT
-      ENDIF
-!
-
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-
-c Tranche a lire:
-      debut(1) = 1
-      debut(2) = jour
-!      epais(1) = klon
-      epais(1) = klon_glo
-      epais(2) = 1
-!=======================================================================
-!                 READING NEW EMISSIONS FROM RCP
-!=======================================================================
-!
-      ierr = nf90_open ("sulphur_emissions_antro.nc", nf90_nowrite, nid)
-      if (ierr/=nf90_noerr) then
-        write(6,*)' Pb d''ouverture du fichier sulphur_emissions_antro'
-        write(6,*)' ierr = ', ierr
-        call exit(1)
-      endif
-
-!
-! SO2 Low level emissions
-!
-      ierr = nf90_inq_varid (nid, "SO2FF_LOW", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2b_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-        PRINT*, 'Pb de lecture pour les sources so2 low'
-        print *,'JE klon, jour, debut ,epais ',klon_glo,jour,debut,epais
-        CALL HANDLE_ERR(ierr)
-        print *,'error ierr= ',ierr
-        CALL exit(1)
-      ENDIF
-!
-! SO2 High level emissions
-!
-      ierr = nf90_inq_varid (nid, "SO2FF_HIGH", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2h_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-        PRINT*, 'Pb de lecture pour les sources so2 high'
-        CALL exit(1)
-      ENDIF
-!
-! SO2 Biomass burning High level emissions
-!
-      ierr = nf90_inq_varid (nid, "SO2BBH", nvarid)
-      ierr = nf90_get_var(nid, nvarid,  lmt_so2bb_h_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-        PRINT*, 'Pb de lecture pour les sources so2 BB high'
-        CALL exit(1)
-      ENDIF
-!
-! SO2 biomass burning low level emissions
-!
-      ierr = nf90_inq_varid (nid, "SO2BBL", nvarid)
-      ierr = nf90_get_var(nid, nvarid,  lmt_so2bb_l_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-        PRINT*, 'Pb de lecture pour les sources so2 BB low'
-        CALL exit(1)
-      ENDIF
-!
-! SO2 ship emissions
-!
-      ierr = nf90_inq_varid (nid, "SO2BA", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2ba_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-        PRINT*, 'Pb de lecture pour les sources so2 ship'
-        CALL exit(1)
-      ENDIF
-!
-! SO2 Non Fossil Fuel Emissions
-!
-      ierr = nf90_inq_varid (nid, "SO2NFF", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2nff_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-        PRINT*, 'Pb de lecture pour les sources so2 non FF'
-        CALL exit(1)
-      ENDIF
-!
-      ierr = nf90_close(nid)
-!
-!=======================================================================
-!                      READING NATURAL EMISSIONS
-!=======================================================================
-      ierr = nf90_open ("sulphur_emissions_nat.nc", nf90_nowrite, nid)
-      if (ierr/=nf90_noerr) then
-        write(6,*)' Pb d''ouverture du fichier sulphur_emissions_nat'
-        write(6,*)' ierr = ', ierr
-        call exit(1)
-      endif
-c
-c Biologenic source of DMS
-c
-      ierr = nf90_inq_varid (nid, "DMSB", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsbio_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms bio'
-         CALL exit(1)
-      ENDIF
-c
-c Biologenic source of H2S
-c
-      ierr = nf90_inq_varid (nid, "H2SB", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_h2sbio_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources h2s bio'
-         CALL exit(1)
-      ENDIF
-c
-c Ocean surface concentration of dms (emissions are computed later)
-c
-      IF (flag_dms==4) THEN
-c
-      ierr = nf90_inq_varid (nid, "DMSC2", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources dms conc 2'
-         CALL exit(1)
-      ENDIF
-c
-      DO i=1, klon 
-!         lmt_dms(i)=0.0
-         lmt_dms_glo(i)=0.0
-      ENDDO
-c
-      ELSE 
-c
-         PRINT *,'choix non possible pour flag_dms'
-         STOP
-
-      ENDIF
-c
-      ierr = nf90_close(nid)
-c
-!=======================================================================
-!                      READING VOLCANIC EMISSIONS
-!=======================================================================
-      print *,'   ***      READING VOLCANIC EMISSIONS   ***   '
-      print *,' Jour = ',jour
-      ierr = nf90_open ("sulphur_emissions_volc.nc", nf90_nowrite, nid)
-      if (ierr/=nf90_noerr) then
-        write(6,*)' Pb d''ouverture du fichier sulphur_emissions_volc'
-        write(6,*)' ierr = ', ierr
-        call exit(1)
-      endif
-c
-c Continuous Volcanic emissions
-c
-!      ierr = nf90_inq_varid (nid, "VOLC", nvarid)
-      ierr = nf90_inq_varid (nid, "flx_volc_cont", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2volc_cont_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 volcan (cont)'
-         CALL exit(1)
-      ENDIF
-      print *,'SO2 volc cont (in read) = ',SUM(lmt_so2volc_cont_glo),
-     +      MINVAL(lmt_so2volc_cont_glo),MAXVAL(lmt_so2volc_cont_glo)
-!      lmt_so2volc(:)=0.0
-c
-c Altitud of continuous volcanic emissions
-c
-!      ierr = nf90_inq_varid (nid, "ALTI", nvarid)
-      ierr = nf90_inq_varid (nid, "flx_volc_altcont", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_altvolc_cont_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les altitudes volcan (cont)'
-         CALL exit(1)
-      ENDIF
-c
-c Explosive Volcanic emissions
-c
-      ierr = nf90_inq_varid (nid, "flx_volc_expl", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_so2volc_expl_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les sources so2 volcan (expl)'
-         CALL exit(1)
-      ENDIF
-!      lmt_so2volc_expl(:)=0.0
-      print *,'SO2 volc expl (in read) = ',SUM(lmt_so2volc_expl_glo),
-     +      MINVAL(lmt_so2volc_expl_glo),MAXVAL(lmt_so2volc_expl_glo)
-c
-c Altitud of explosive volcanic emissions
-c
-      ierr = nf90_inq_varid (nid, "flx_volc_altexpl", nvarid)
-      ierr = nf90_get_var(nid, nvarid, lmt_altvolc_expl_glo, debut, epais)
-      IF (ierr /= nf90_noerr) THEN
-         PRINT*, 'Pb de lecture pour les altitudes volcan'
-         CALL exit(1)
-      ENDIF
-!      lmt_altvolc_expl(:)=0.0
-
-      ierr = nf90_close(nid)
-c
-      PRINT*, 'Sources SOUFRE lues pour jour: ', jour
-c
-
-
-      ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-      call scatter( lmt_so2b_glo        , lmt_so2b )
-      call scatter(lmt_so2h_glo         , lmt_so2h )  
-      call scatter(lmt_so2bb_h_glo      , lmt_so2bb_h )
-      call scatter(lmt_so2bb_l_glo      , lmt_so2bb_l)
-      call scatter(lmt_so2ba_glo        , lmt_so2ba)
-      call scatter(lmt_so2nff_glo       , lmt_so2nff)
-      call scatter(lmt_dmsbio_glo       , lmt_dmsbio)
-      call scatter(lmt_h2sbio_glo       , lmt_h2sbio)
-      call scatter(lmt_dmsconc_glo      , lmt_dmsconc)
-      call scatter(lmt_dms_glo          , lmt_dms)
-      call scatter(lmt_so2volc_cont_glo , lmt_so2volc_cont)
-      call scatter(lmt_altvolc_cont_glo , lmt_altvolc_cont)
-      call scatter(lmt_so2volc_expl_glo , lmt_so2volc_expl)
-      call scatter(lmt_altvolc_expl_glo , lmt_altvolc_expl)
-
-
-      RETURN
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfs_new.f90	(revision 5099)
@@ -0,0 +1,261 @@
+SUBROUTINE condsurfs_new(jour, edgar, flag_dms, &
+        lmt_so2b, lmt_so2h, lmt_so2nff, &
+        lmt_so2bb_l, lmt_so2bb_h, lmt_so2ba, &
+        lmt_so2volc_cont, lmt_altvolc_cont, &
+        lmt_so2volc_expl, lmt_altvolc_expl, &
+        lmt_dmsbio, lmt_h2sbio, lmt_dms, &
+        lmt_dmsconc)
+  USE mod_grid_phy_lmdz
+  USE mod_phys_lmdz_para
+  USE dimphy
+  USE netcdf, ONLY : nf90_get_var, nf90_inq_varid, nf90_close, nf90_noerr, nf90_open, nf90_nowrite
+  IMPLICIT none
+
+  ! Lire les conditions aux limites du modele pour la chimie.
+  ! --------------------------------------------------------
+
+  INCLUDE "dimensions.h"
+
+  REAL :: lmt_so2b(klon), lmt_so2h(klon), lmt_so2nff(klon)
+  REAL :: lmt_so2bb_l(klon), lmt_so2bb_h(klon)
+  REAL :: lmt_dmsbio(klon), lmt_h2sbio(klon), lmt_so2ba(klon)
+  REAL :: lmt_so2volc_cont(klon), lmt_altvolc_cont(klon)
+  REAL :: lmt_so2volc_expl(klon), lmt_altvolc_expl(klon)
+  REAL :: lmt_dms(klon), lmt_dmsconc(klon)
+
+  REAL :: lmt_so2b_glo(klon_glo), lmt_so2h_glo(klon_glo)
+  REAL :: lmt_so2nff_glo(klon_glo)
+  REAL :: lmt_so2bb_l_glo(klon_glo), lmt_so2bb_h_glo(klon_glo)
+  REAL :: lmt_dmsbio_glo(klon_glo), lmt_h2sbio_glo(klon_glo)
+  REAL :: lmt_so2ba_glo(klon_glo)
+  REAL :: lmt_so2volc_cont_glo(klon_glo), lmt_altvolc_cont_glo(klon_glo)
+  REAL :: lmt_so2volc_expl_glo(klon_glo), lmt_altvolc_expl_glo(klon_glo)
+  REAL :: lmt_dms_glo(klon_glo), lmt_dmsconc_glo(klon_glo)
+  LOGICAL :: edgar
+  INTEGER :: flag_dms
+
+  INTEGER :: jour, i
+  INTEGER :: ierr
+  INTEGER :: nid, nvarid
+  INTEGER :: debut(2), epais(2)
+
+  IF (jour<0 .OR. jour>(366 - 1)) THEN
+    PRINT*, 'Le jour demande n est pas correcte:', jour
+    print *, 'JE: FORCED TO CONTINUE (emissions have&
+            & to be longer than 1 year!!!! )'
+    ! CALL ABORT
+  ENDIF
+
+  !$OMP MASTER
+  IF (is_mpi_root .AND. is_omp_root) THEN
+
+    ! Tranche a lire:
+    debut(1) = 1
+    debut(2) = jour
+    ! epais(1) = klon
+    epais(1) = klon_glo
+    epais(2) = 1
+    !=======================================================================
+    ! READING NEW EMISSIONS FROM RCP
+    !=======================================================================
+
+    ierr = nf90_open ("sulphur_emissions_antro.nc", nf90_nowrite, nid)
+    if (ierr/=nf90_noerr) then
+      write(6, *)' Pb d''ouverture du fichier sulphur_emissions_antro'
+      write(6, *)' ierr = ', ierr
+      call exit(1)
+    endif
+
+    ! SO2 Low level emissions
+
+    ierr = nf90_inq_varid (nid, "SO2FF_LOW", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2b_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 low'
+      print *, 'JE klon, jour, debut ,epais ', klon_glo, jour, debut, epais
+      CALL HANDLE_ERR(ierr)
+      print *, 'error ierr= ', ierr
+      CALL exit(1)
+    ENDIF
+
+    ! SO2 High level emissions
+
+    ierr = nf90_inq_varid (nid, "SO2FF_HIGH", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2h_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 high'
+      CALL exit(1)
+    ENDIF
+
+    ! SO2 Biomass burning High level emissions
+
+    ierr = nf90_inq_varid (nid, "SO2BBH", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2bb_h_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 BB high'
+      CALL exit(1)
+    ENDIF
+
+    ! SO2 biomass burning low level emissions
+
+    ierr = nf90_inq_varid (nid, "SO2BBL", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2bb_l_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 BB low'
+      CALL exit(1)
+    ENDIF
+
+    ! SO2 ship emissions
+
+    ierr = nf90_inq_varid (nid, "SO2BA", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2ba_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 ship'
+      CALL exit(1)
+    ENDIF
+
+    ! SO2 Non Fossil Fuel Emissions
+
+    ierr = nf90_inq_varid (nid, "SO2NFF", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2nff_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 non FF'
+      CALL exit(1)
+    ENDIF
+
+    ierr = nf90_close(nid)
+
+    !=======================================================================
+    ! READING NATURAL EMISSIONS
+    !=======================================================================
+    ierr = nf90_open ("sulphur_emissions_nat.nc", nf90_nowrite, nid)
+    if (ierr/=nf90_noerr) then
+      write(6, *)' Pb d''ouverture du fichier sulphur_emissions_nat'
+      write(6, *)' ierr = ', ierr
+      call exit(1)
+    endif
+
+    ! Biologenic source of DMS
+
+    ierr = nf90_inq_varid (nid, "DMSB", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_dmsbio_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources dms bio'
+      CALL exit(1)
+    ENDIF
+
+    ! Biologenic source of H2S
+
+    ierr = nf90_inq_varid (nid, "H2SB", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_h2sbio_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources h2s bio'
+      CALL exit(1)
+    ENDIF
+
+    ! Ocean surface concentration of dms (emissions are computed later)
+
+    IF (flag_dms==4) THEN
+
+      ierr = nf90_inq_varid (nid, "DMSC2", nvarid)
+      ierr = nf90_get_var(nid, nvarid, lmt_dmsconc_glo, debut, epais)
+      IF (ierr /= nf90_noerr) THEN
+        PRINT*, 'Pb de lecture pour les sources dms conc 2'
+        CALL exit(1)
+      ENDIF
+
+      DO i = 1, klon
+        ! lmt_dms(i)=0.0
+        lmt_dms_glo(i) = 0.0
+      ENDDO
+
+    ELSE
+
+      PRINT *, 'choix non possible pour flag_dms'
+      STOP
+
+    ENDIF
+
+    ierr = nf90_close(nid)
+
+    !=======================================================================
+    !                  READING VOLCANIC EMISSIONS
+    !=======================================================================
+    print *, '   ***      READING VOLCANIC EMISSIONS   ***   '
+    print *, ' Jour = ', jour
+    ierr = nf90_open ("sulphur_emissions_volc.nc", nf90_nowrite, nid)
+    if (ierr/=nf90_noerr) then
+      write(6, *)' Pb d''ouverture du fichier sulphur_emissions_volc'
+      write(6, *)' ierr = ', ierr
+      call exit(1)
+    endif
+
+    ! Continuous Volcanic emissions
+
+    !  ierr = nf90_inq_varid (nid, "VOLC", nvarid)
+    ierr = nf90_inq_varid (nid, "flx_volc_cont", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2volc_cont_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 volcan (cont)'
+      CALL exit(1)
+    ENDIF
+    print *, 'SO2 volc cont (in read) = ', SUM(lmt_so2volc_cont_glo), &
+            MINVAL(lmt_so2volc_cont_glo), MAXVAL(lmt_so2volc_cont_glo)
+    ! lmt_so2volc(:)=0.0
+
+    ! Altitud of continuous volcanic emissions
+
+    !  ierr = nf90_inq_varid (nid, "ALTI", nvarid)
+    ierr = nf90_inq_varid (nid, "flx_volc_altcont", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_altvolc_cont_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les altitudes volcan (cont)'
+      CALL exit(1)
+    ENDIF
+
+    ! Explosive Volcanic emissions
+
+    ierr = nf90_inq_varid (nid, "flx_volc_expl", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_so2volc_expl_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les sources so2 volcan (expl)'
+      CALL exit(1)
+    ENDIF
+    ! lmt_so2volc_expl(:)=0.0
+    print *, 'SO2 volc expl (in read) = ', SUM(lmt_so2volc_expl_glo), &
+            MINVAL(lmt_so2volc_expl_glo), MAXVAL(lmt_so2volc_expl_glo)
+
+    ! Altitud of explosive volcanic emissions
+
+    ierr = nf90_inq_varid (nid, "flx_volc_altexpl", nvarid)
+    ierr = nf90_get_var(nid, nvarid, lmt_altvolc_expl_glo, debut, epais)
+    IF (ierr /= nf90_noerr) THEN
+      PRINT*, 'Pb de lecture pour les altitudes volcan'
+      CALL exit(1)
+    ENDIF
+    ! lmt_altvolc_expl(:)=0.0
+
+    ierr = nf90_close(nid)
+
+    PRINT*, 'Sources SOUFRE lues pour jour: ', jour
+
+  ENDIF
+  !$OMP END MASTER
+  !$OMP BARRIER
+  call scatter(lmt_so2b_glo, lmt_so2b)
+  call scatter(lmt_so2h_glo, lmt_so2h)
+  call scatter(lmt_so2bb_h_glo, lmt_so2bb_h)
+  call scatter(lmt_so2bb_l_glo, lmt_so2bb_l)
+  call scatter(lmt_so2ba_glo, lmt_so2ba)
+  call scatter(lmt_so2nff_glo, lmt_so2nff)
+  call scatter(lmt_dmsbio_glo, lmt_dmsbio)
+  call scatter(lmt_h2sbio_glo, lmt_h2sbio)
+  call scatter(lmt_dmsconc_glo, lmt_dmsconc)
+  call scatter(lmt_dms_glo, lmt_dms)
+  call scatter(lmt_so2volc_cont_glo, lmt_so2volc_cont)
+  call scatter(lmt_altvolc_cont_glo, lmt_altvolc_cont)
+  call scatter(lmt_so2volc_expl_glo, lmt_so2volc_expl)
+  call scatter(lmt_altvolc_expl_glo, lmt_altvolc_expl)
+
+  RETURN
+END SUBROUTINE condsurfs_new
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90	(revision 5099)
@@ -466,8 +466,4 @@
 !  emdustsco(k)=auxr3*tuningfactor
 !enddo
-!
-
-
-
 
 !JEdbg<<
@@ -904,5 +900,5 @@
 if (1==1) then
 !  !  CALL writefield_phy("AA",tmp1(1:klon,1:5),5)
-!
+
     CALL writefield_phy("REPART5",feff(1:klon,1:5),5)
     CALL writefield_phy("REPART5dbg",feffdbg(1:klon,1:5),5)
@@ -925,13 +921,13 @@
 !  if (.false.) then
 !!**************L718
-!
+
 !!c------------------------------------------------------------------------
 !! isolog distrib and massfrac calculations.
-!
+
 !      nbinsout=nbins+1
 !      b1=log(sizedustmin)
 !      b2=log(sizedustmax)
 !! restricted ISOLOG bins distributions
-!
+
 !!      step=(b2-b1)/(nbinsout-1)
 !!      DO ni=1,nbinsout
@@ -945,5 +941,5 @@
 !     binsHR(nb)=exp(b1+(nb-1)*stepbin)
 !  END DO
-!
+
 !  DO nb=1,nbinsHR
 !     binsHRcm(nb)=binsHR(nb)*1.e-4
@@ -951,11 +947,11 @@
 !! Making HIGH RESOLUTION dry deposition velocity
 !     CALL calcvd(vdout)
-!
-!
+
+
 ! DO nb=1,nbinsHR
 !     vdHR(nb)=vdout(nb)
 !!  WRITE(18,*),binsHR(nb),vdHR(nb)
 !  END DO
-!
+
 !   !searching for minimum value of dry deposition velocity
 !  minisograd=1.e20
@@ -966,7 +962,7 @@
 !     END IF
 !  END DO
-!
+
 !! searching for optimal number of bins in positive slope Vd part
-!
+
 !  nbins1=1
 !  nbins2=nbinsout-1
@@ -976,5 +972,5 @@
 !        IF(delta2.GE.delta1)THEN
 !        GOTO 50
-!
+
 !        ELSE
 !           nbins2=nbins2-1
@@ -994,11 +990,11 @@
 !     logvdISOGRAD(k)=logvdISOGRAD(1)-(k-1)*delta1
 !  END DO
-!
+
 !  logvdISOGRAD(nbins1+1)=log(minisograd)
-!
+
 !  DO k=1,nbins2
 !     logvdISOGRAD(nbins1+1+k)=logvdISOGRAD(nbins1+1)+k*delta2
 !  END DO
-!
+
 !  DO k=1,nbinsout
 !     vdISOGRAD(k)=exp(logvdISOGRAD(k))
@@ -1040,5 +1036,5 @@
 
 ! Making dust size distribution (in um)
-!
+
       nbinsout=nbins+1
       b1=log(sizedustmin)
@@ -1053,5 +1049,5 @@
 !     binsHR(nb)=exp(b1+(nb-1)*stepbin)
 !  END DO
-!
+
 !  DO nb=1,nbinsHR
 !     binsHRcm(nb)=binsHR(nb)*1.e-4
@@ -1188,5 +1184,5 @@
 !  print
 !*,'zwstar=sqrt(2.*(',flag_wstarBL,'ale_bl+0.01*(',flag_wstar,'-100)*ale_wake))'
-  !
+
     DO i=1,klon  ! main loop
      zwstar(i)=sqrt(2.*(param_wstarBL(i)*ale_bl(i)+param_wstarWAKE(i)*ale_wake(i)))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.F	(revision 5099)
@@ -102,5 +102,5 @@
 ! fluxes are defined on klev levels only.
 ! NHL
-!
+
       flxr_aux(:,klev+1)=0.0
       flxs_aux(:,klev+1)=0.0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/kg_to_cm3.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/kg_to_cm3.F	(revision 5098)
+++ 	(revision )
@@ -1,22 +1,0 @@
-      SUBROUTINE kg_to_cm3(pplay,t_seri,tr_seri)
-c      
-      USE dimphy
-      USE infotrac
-      IMPLICIT NONE
-c
-      INCLUDE "dimensions.h"
-      INCLUDE "YOMCST.h"
-c      
-      REAL t_seri(klon,klev), pplay(klon,klev)
-      REAL tr_seri(klon,klev)
-      REAL zrho
-      INTEGER i, k
-c
-      DO k = 1, klev
-      DO i = 1, klon
-        zrho=pplay(i,k)/t_seri(i,k)/RD
-        tr_seri(i,k)=tr_seri(i,k)/1.e6*zrho
-      ENDDO
-      ENDDO
-c 
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/kg_to_cm3.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/kg_to_cm3.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/kg_to_cm3.f90	(revision 5099)
@@ -0,0 +1,22 @@
+SUBROUTINE kg_to_cm3(pplay, t_seri, tr_seri)
+
+  USE dimphy
+  USE infotrac
+  IMPLICIT NONE
+
+  INCLUDE "dimensions.h"
+  INCLUDE "YOMCST.h"
+
+  REAL :: t_seri(klon, klev), pplay(klon, klev)
+  REAL :: tr_seri(klon, klev)
+  REAL :: zrho
+  INTEGER :: i, k
+
+  DO k = 1, klev
+    DO i = 1, klon
+      zrho = pplay(i, k) / t_seri(i, k) / RD
+      tr_seri(i, k) = tr_seri(i, k) / 1.e6 * zrho
+    ENDDO
+  ENDDO
+
+END SUBROUTINE kg_to_cm3
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_orig.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_orig.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_orig.F90	(revision 5099)
@@ -10,6 +10,6 @@
   USE traclmdz_mod
   USE infotrac,ONLY : nbtr
-!!!  USE geometry_mod
   USE iophy
+  USE lmdz_yomcst
 
   IMPLICIT NONE 
@@ -23,6 +23,5 @@
   include "dimensions.h"
   include "chem.h"
-  include "YOMCST.h"
-  include "YOECUMF.h" 
+  include "YOECUMF.h"
 
   REAL,INTENT(IN)                        :: pdtime ! time step (s)
@@ -53,5 +52,5 @@
  LOGICAL,SAVE :: debut=.true.
 !$OMP THREADPRIVATE(debut)
-!
+
   REAL,PARAMETER :: henry=1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
   REAL           :: henry_t    !  constante de Henry a T t  (mol/l/atm)
@@ -89,12 +88,12 @@
   REAL           :: pr, ps, ice, water
   real :: conserv
-!
+
 !!!!!!!!!!!!!!!!!!!! choix lessivage !!!!!!!!!!!!!!!!!!!!!!!!
 !!  logical,save  :: inscav_fisrt
 !!! $OMP THREADPRIVATE(inscav_first)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (debut) THEN
-!
+
 !  inscav_fisrt=.true.
 !  call getin('inscav_fisrt',inscav_fisrt)
@@ -104,5 +103,5 @@
 !   print*,'beta from Reddy and Bocuher 2004 (original version), inscav_fisrt=',inscav_fisrt
 !  endif
-!
+
       alpha_r=0.001        !  coefficient d'impaction pour la pluie
       alpha_s=0.01         !  coefficient d'impaction pour la neige  
@@ -113,8 +112,7 @@
 !     frac_aer=0.5 ~ droplet size shrinks by evap
       frac_aer=0.5
-!
 
 !JE to speed up, commented 20140219
-!
+
 !      OPEN(99,file='lsc_scav_param.data',status='old', &
 !                form='formatted',err=9999)
@@ -129,5 +127,5 @@
 !      CLOSE(99)
 !9999  Continue
-!
+
 !   print*,'alpha_r',alpha_r
 !   print*,'alpha_s',alpha_s
@@ -137,10 +135,10 @@
 !   print*,'frac_coar_scav',frac_coar_scav
 !   print*,'frac_aer ev',frac_aer
-!
+
 ! JE endcomment
-!
+
   ENDIF !(debut)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
+
 ! initialization
   dxin=0.
@@ -212,5 +210,5 @@
    endif ! (iflag_lscav .eq. 4)
    beta_v1(i,k)=beta    !! for output
-!
+
       dxin=tr_seri(i,k,it)*(exp(-scav(i,k)*beta*pdtime)-1.)
 !      his_dh(i)=his_dh(i)-dxin*zrho(i,k)*zdz(i,k)/pdtime !  kg/m2/s
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_spl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_spl.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/lsc_scav_spl.F90	(revision 5099)
@@ -12,6 +12,6 @@
   USE traclmdz_mod
   USE infotrac,ONLY : nbtr
-!  USE comgeomphy
   USE iophy
+  USE lmdz_yomcst
   IMPLICIT NONE 
 !=====================================================================
@@ -25,6 +25,5 @@
   include "dimensions.h"
   include "chem.h"
-  include "YOMCST.h"
-  include "YOECUMF.h" 
+  include "YOECUMF.h"
 
   REAL,INTENT(IN)                        :: pdtime ! time step (s)
@@ -56,5 +55,5 @@
  LOGICAL,SAVE :: debut=.true.
 !$OMP THREADPRIVATE(debut)
-!
+
 !JE  REAL,PARAMETER :: henry=1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
   REAL,DIMENSION(nbtr) :: henry  ! constante de Henry en mol/l/atm ~1.4 for gases
@@ -99,12 +98,12 @@
   REAL           :: pr, ps, ice, water
   real :: conserv
-!
+
 !!!!!!!!!!!!!!!!!!!! choix lessivage !!!!!!!!!!!!!!!!!!!!!!!!
 !!  logical,save  :: inscav_fisrt
 !!! $OMP THREADPRIVATE(inscav_first)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (debut) THEN
-!
+
 !  inscav_fisrt=.true.
 !  call getin('inscav_fisrt',inscav_fisrt)
@@ -114,5 +113,5 @@
 !   print*,'beta from Reddy and Bocuher 2004 (original version), inscav_fisrt=',inscav_fisrt
 !  endif
-!
+
 !JE      alpha_r=0.001        !  coefficient d'impaction pour la pluie
 !JE      alpha_s=0.01         !  coefficient d'impaction pour la neige  
@@ -123,8 +122,7 @@
 !     frac_aer=0.5 ~ droplet size shrinks by evap
       frac_aer=0.5
-!
 
 !JE to speed up, commented 20140219
-!
+
 !      OPEN(99,file='lsc_scav_param.data',status='old', &
 !                form='formatted',err=9999)
@@ -139,5 +137,5 @@
 !      CLOSE(99)
 !9999  Continue
-!
+
 !   print*,'JE alpha_r',alpha_r
 !   print*,'JE alpha_s',alpha_s
@@ -147,10 +145,10 @@
 !   print*,'frac_coar_scav',frac_coar_scav
 !   print*,'frac_aer ev',frac_aer
-!
+
 ! JE endcomment
-!
+
   ENDIF !(debut)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
+
 ! initialization
   dxin=0.
@@ -223,5 +221,5 @@
    endif ! (iflag_lscav .eq. 4)
    beta_v1(i,k)=beta    !! for output
-!
+
       dxin=tr_seri(i,k,it)*(exp(-scav(i,k)*beta*pdtime)-1.)
 !      his_dh(i)=his_dh(i)-dxin*zrho(i,k)*zdz(i,k)/pdtime !  kg/m2/s
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phys_output_write_spl_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: phys_output_write_mod.F90 2298 2015-06-14 19:13:32Z fairhead $
-!
+
 MODULE phys_output_write_spl_mod
 
@@ -395,4 +395,5 @@
     USE wxios, ONLY: wxios_closedef, missing_val_xios => missing_val
     USE phys_cal_mod, ONLY : mth_len
+    USE lmdz_yomcst
 
     IMPLICIT NONE
@@ -402,5 +403,4 @@
     INCLUDE "alpale.h"
     INCLUDE "compbl.h"
-    INCLUDE "YOMCST.h"
     INCLUDE "dimensions.h"
     include "iniprint.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/phytracr_spl_mod.F90	(revision 5099)
@@ -4,29 +4,27 @@
 MODULE phytracr_spl_mod
 
-! Recuperation des morceaux de la physique de Jeronimo specifiques
-! du modele d'aerosols d'Olivier n'co.
-!
-INCLUDE "chem.h"
-INCLUDE "chem_spla.h"
-
-  REAL,SAVE  :: scale_param_ssacc  !Scaling parameter for Fine Sea Salt
-  REAL,SAVE ::  scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
-
-
-
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: scale_param_ind !Scaling parameter for industrial emissions of SO2
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: scale_param_bb  !Scaling parameter for biomas burning (SO2,BC & OM)
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: scale_param_ff  !Scaling parameter for industrial emissions (fossil fuel)
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: scale_param_dustacc  !Scaling parameter for Fine Dust
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: scale_param_dustcoa  !Scaling parameter for Coarse Dust
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: scale_param_dustsco  !Scaling parameter for SCoarse Dust
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: param_wstarBLperregion  !parameter for ..
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE :: param_wstarWAKEperregion  !parameter for ..
+  ! Recuperation des morceaux de la physique de Jeronimo specifiques
+  ! du modele d'aerosols d'Olivier n'co.
+
+  INCLUDE "chem.h"
+  INCLUDE "chem_spla.h"
+
+  REAL, SAVE :: scale_param_ssacc  !Scaling parameter for Fine Sea Salt
+  REAL, SAVE :: scale_param_sscoa  !Scaling parameter for Coarse Sea Salt
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_ind !Scaling parameter for industrial emissions of SO2
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_bb  !Scaling parameter for biomas burning (SO2,BC & OM)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_ff  !Scaling parameter for industrial emissions (fossil fuel)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustacc  !Scaling parameter for Fine Dust
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustcoa  !Scaling parameter for Coarse Dust
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: scale_param_dustsco  !Scaling parameter for SCoarse Dust
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: param_wstarBLperregion  !parameter for ..
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: param_wstarWAKEperregion  !parameter for ..
   !$OMP THREADPRIVATE(scale_param_ind,scale_param_bb,scale_param_ff)
   !$OMP THREADPRIVATE(scale_param_dustacc,scale_param_dustcoa,scale_param_dustsco)
   !$OMP THREADPRIVATE(scale_param_ssacc,scale_param_sscoa)
   !$OMP THREADPRIVATE(param_wstarBLperregion,param_wstarWAKEperregion)
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE ::dust_ec, u10m_ec, v10m_ec
-!$OMP THREADPRIVATE(dust_ec, u10m_ec, v10m_ec)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dust_ec, u10m_ec, v10m_ec
+  !$OMP THREADPRIVATE(dust_ec, u10m_ec, v10m_ec)
 
   CHARACTER*800 fileregionsdimsind
@@ -45,5 +43,4 @@
   CHARACTER*100 paramname_wstarWAKE
 
-
   CHARACTER*800 filescaleparams
   CHARACTER*800 paramsname
@@ -51,1212 +48,1179 @@
 
   !!------------------------ SULFUR emissions ----------------------------
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2volc_cont  ! emissions so2 volcan continuous
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_altvolc_cont  ! altitude  so2 volcan continuous
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2volc_expl  ! emissions so2 volcan explosive
-!$OMP THREADPRIVATE( lmt_so2volc_cont,lmt_altvolc_cont,lmt_so2volc_expl )
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_altvolc_expl  ! altitude  so2 volcan explosive
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2ff_l       ! emissions so2 fossil fuel (low)
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2ff_h       ! emissions so2 fossil fuel (high)
-!$OMP THREADPRIVATE( lmt_altvolc_expl,lmt_so2ff_l,lmt_so2ff_h )
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2nff        ! emissions so2 non-fossil fuel
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2ba         ! emissions de so2 bateau
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2bb_l       ! emissions de so2 biomass burning (low)
-!$OMP THREADPRIVATE( lmt_so2nff,lmt_so2ba,lmt_so2bb_l )
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_so2bb_h       ! emissions de so2 biomass burning (high)
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_dmsconc       ! concentration de dms oceanique
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_dmsbio        ! emissions de dms bio
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_h2sbio        ! emissions de h2s bio
-!$OMP THREADPRIVATE(lmt_so2bb_h,lmt_dmsconc,lmt_dmsbio,lmt_h2sbio )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2volc_cont  ! emissions so2 volcan continuous
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_altvolc_cont  ! altitude  so2 volcan continuous
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2volc_expl  ! emissions so2 volcan explosive
+  !$OMP THREADPRIVATE( lmt_so2volc_cont,lmt_altvolc_cont,lmt_so2volc_expl )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_altvolc_expl  ! altitude  so2 volcan explosive
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ff_l       ! emissions so2 fossil fuel (low)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ff_h       ! emissions so2 fossil fuel (high)
+  !$OMP THREADPRIVATE( lmt_altvolc_expl,lmt_so2ff_l,lmt_so2ff_h )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2nff        ! emissions so2 non-fossil fuel
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2ba         ! emissions de so2 bateau
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2bb_l       ! emissions de so2 biomass burning (low)
+  !$OMP THREADPRIVATE( lmt_so2nff,lmt_so2ba,lmt_so2bb_l )
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_so2bb_h       ! emissions de so2 biomass burning (high)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_dmsconc       ! concentration de dms oceanique
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_dmsbio        ! emissions de dms bio
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_h2sbio        ! emissions de h2s bio
+  !$OMP THREADPRIVATE(lmt_so2bb_h,lmt_dmsconc,lmt_dmsbio,lmt_h2sbio )
   !------------------------- BLACK CARBON emissions ----------------------
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_bcff       ! emissions de BC fossil fuels
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_bcnff      ! emissions de BC non-fossil fuels
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_bcbb_l     ! emissions de BC biomass basses
-!$OMP THREADPRIVATE( lmt_bcff,lmt_bcnff,lmt_bcbb_l)
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_bcbb_h     ! emissions de BC biomass hautes
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_bcba       ! emissions de BC bateau
-!$OMP THREADPRIVATE(lmt_bcbb_h,lmt_bcba)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcff       ! emissions de BC fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcnff      ! emissions de BC non-fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcbb_l     ! emissions de BC biomass basses
+  !$OMP THREADPRIVATE( lmt_bcff,lmt_bcnff,lmt_bcbb_l)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcbb_h     ! emissions de BC biomass hautes
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_bcba       ! emissions de BC bateau
+  !$OMP THREADPRIVATE(lmt_bcbb_h,lmt_bcba)
   !------------------------ ORGANIC MATTER emissions ---------------------
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_omff     ! emissions de OM fossil fuels
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_omnff    ! emissions de OM non-fossil fuels
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_ombb_l   ! emissions de OM biomass basses
-!$OMP THREADPRIVATE( lmt_omff,lmt_omnff,lmt_ombb_l)
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_ombb_h   ! emissions de OM biomass hautes
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_omnat    ! emissions de OM Natural
-  REAL , DIMENSION(:),ALLOCATABLE,SAVE :: lmt_omba     ! emissions de OM bateau
-  REAL , DIMENSION(:,:),ALLOCATABLE,SAVE :: lmt_sea_salt    ! emissions de OM Natural
-!$OMP THREADPRIVATE(lmt_ombb_h,lmt_omnat,lmt_omba,lmt_sea_salt)
-
-!JE20141224 >>
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omff     ! emissions de OM fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omnff    ! emissions de OM non-fossil fuels
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_ombb_l   ! emissions de OM biomass basses
+  !$OMP THREADPRIVATE( lmt_omff,lmt_omnff,lmt_ombb_l)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_ombb_h   ! emissions de OM biomass hautes
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omnat    ! emissions de OM Natural
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: lmt_omba     ! emissions de OM bateau
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: lmt_sea_salt    ! emissions de OM Natural
+  !$OMP THREADPRIVATE(lmt_ombb_h,lmt_omnat,lmt_omba,lmt_sea_salt)
+
+  !JE20141224 >>
   ! others
-  REAL, DIMENSION(:),ALLOCATABLE,SAVE ::  tsol
-!$OMP THREADPRIVATE(tsol)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: tsol
+  !$OMP THREADPRIVATE(tsol)
   INTEGER :: ijulday
-  LOGICAL , parameter :: edgar = .true.
-  INTEGER , parameter :: flag_dms=4
-  INTEGER(kind=4)  nbjour
-
-      !
-! Tracer tendencies, for outputs
-!-------------------------------
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cl  ! Td couche
-!. limite/traceur
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_dec
-!RomP
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv  ! Td
-!onvection/traceur
-! RomP >>>
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_insc
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_bcscav
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_evapls
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_ls
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPr,qDi ! concentration tra
-!dans pluie,air descente insaturee
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qPa,qMel
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: qTrdi,dtrcvMA ! conc traceur
-!descente air insaturee et td convective MA
-!! RomP <<<
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th  ! Td thermique
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_lessi_impa ! Td du
-!lessivage par impaction
-      REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_lessi_nucl ! Td du
-!lessivage par nucleation
-      REAL,DIMENSION(:,:),ALLOCATABLE,SAVE      :: qPrls      !jyg:
-!oncentration tra dans pluie LS a la surf.
-      REAL,DIMENSION(:,:),ALLOCATABLE,SAVE      :: d_tr_dry ! Td depot
-!sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
-      REAL,DIMENSION(:,:),ALLOCATABLE,SAVE      :: flux_tr_dry ! depot
-!sec/traceur (surface),ALLOCATABLE,SAVE    jyg
-
-! Index of each traceur
-      INTEGER,SAVE :: id_prec, id_fine, id_coss, id_codu, id_scdu 
-
-!$OMP THREADPRIVATE(d_tr_cl,d_tr_dec,d_tr_cv,d_tr_insc,d_tr_bcscav,d_tr_evapls)
-!$OMP THREADPRIVATE(d_tr_ls,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav)
-!$OMP THREADPRIVATE(qPr,qDi,qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa)
-!$OMP THREADPRIVATE(d_tr_lessi_nucl,qPrls,d_tr_dry,flux_tr_dry)
-!$OMP THREADPRIVATE(id_prec,id_fine,id_coss,id_codu,id_scdu)
-
-! JE20141224 <<
-
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diff_aod550_tot  ! epaisseur optique total aerosol 550  nm
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod670_tot  ! epaisseur optique total aerosol 670 nm
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod865_tot  ! epaisseur optique total aerosol 865 nm
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diff_aod550_tr2  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod670_tr2  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod865_tr2  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod550_ss  ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod670_ss  ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod865_ss   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod550_dust ! epaisseur optique Dust aerosol 550 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod670_dust ! epaisseur optique Dust aerosol 670 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod865_dust ! epaisseur optique Dust aerosol 865 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod550_dustsco ! epaisseur optique Dust SCOarse aerosol 550 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod670_dustsco ! epaisseur optique Dust SCOarse aerosol 670 nm, diagnostic
-      REAL,DIMENSION(:),ALLOCATABLE,SAVE :: diag_aod865_dustsco ! epaisseur optique Dust SCOarse aerosol 865 nm, diagnostic
-
-!$OMP THREADPRIVATE(diff_aod550_tot,diag_aod670_tot,diag_aod865_tot)
-!$OMP THREADPRIVATE(diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2)
-!$OMP THREADPRIVATE(diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,diag_aod550_dust)
-!$OMP THREADPRIVATE(diag_aod670_dust,diag_aod865_dust,diag_aod550_dustsco)
-!$OMP THREADPRIVATE(diag_aod670_dustsco,diag_aod865_dustsco)
-
-
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
-
-
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
-
-!$OMP THREADPRIVATE(aod550_aqua,aod550_tr2_aqua,aod550_ss_aqua,aod550_dust_aqua,aod550_dustsco_aqua)
-!$OMP THREADPRIVATE(aod670_aqua,aod670_tr2_aqua,aod670_ss_aqua,aod670_dust_aqua,aod670_dustsco_aqua)
-!$OMP THREADPRIVATE(aod865_aqua,aod865_tr2_aqua,aod865_ss_aqua,aod865_dust_aqua,aod865_dustsco_aqua)
-!$OMP THREADPRIVATE(aod550_terra,aod550_tr2_terra,aod550_ss_terra,aod550_dust_terra,aod550_dustsco_terra)
-!$OMP THREADPRIVATE(aod670_terra,aod670_tr2_terra,aod670_ss_terra,aod670_dust_terra,aod670_dustsco_terra)
-!$OMP THREADPRIVATE(aod865_terra,aod865_tr2_terra,aod865_ss_terra,aod865_dust_terra,aod865_dustsco_terra)
-
-
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc01 ! surface concentration
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm01   ! burden 
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc02 ! surface concentration
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm02   ! burden 
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc03 ! surface concentration
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm03   ! burden 
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc04 ! surface concentration
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm04   ! burden 
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc05 ! surface concentration
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm05   ! burden 
-!$OMP THREADPRIVATE(sconc01,sconc02,sconc03,sconc04,sconc05)
-!$OMP THREADPRIVATE(trm01,trm02,trm03,trm04,trm05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux01        
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux02       
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux03       
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux04       
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux05       
-!$OMP THREADPRIVATE(flux01,flux02,flux03,flux04,flux05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds01         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds02         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds03         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds04         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds05         
-!$OMP THREADPRIVATE(ds01,ds02,ds03,ds04,ds05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh01         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh02         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh03         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh04         
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh05         
-!$OMP THREADPRIVATE(dh01,dh02,dh03,dh04,dh05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv01    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv02    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv03    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv04    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv05    
-!$OMP THREADPRIVATE(dtrconv01,dtrconv02,dtrconv03,dtrconv04,dtrconv05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm01     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm02     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm03     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm04     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm05     
-!$OMP THREADPRIVATE(dtherm01,dtherm02,dtherm03,dtherm04,dtherm05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv01     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv02     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv03     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv04     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv05     
-!$OMP THREADPRIVATE(dhkecv01,dhkecv02,dhkecv03,dhkecv04,dhkecv05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds01     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds02     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds03     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds04     
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds05     
-!$OMP THREADPRIVATE(d_tr_ds01,d_tr_ds02,d_tr_ds03,d_tr_ds04,d_tr_ds05)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc01    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc02    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc03    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc04    
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc05    
-!$OMP THREADPRIVATE(dhkelsc01,dhkelsc02,dhkelsc03,dhkelsc04,dhkelsc05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cv01    
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cv02    
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cv03    
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cv04    
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cv05    
-!$OMP THREADPRIVATE(d_tr_cv01,d_tr_cv02,d_tr_cv03,d_tr_cv04,d_tr_cv05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_trsp01  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_trsp02  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_trsp03  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_trsp04  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_trsp05  
-!$OMP THREADPRIVATE(d_tr_trsp01,d_tr_trsp02,d_tr_trsp03,d_tr_trsp04,d_tr_trsp05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sscav01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sscav02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sscav03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sscav04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sscav05 
-!$OMP THREADPRIVATE(d_tr_sscav01,d_tr_sscav02,d_tr_sscav03,d_tr_sscav04,d_tr_sscav05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sat01   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sat02   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sat03   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sat04   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_sat05   
-!$OMP THREADPRIVATE(d_tr_sat01,d_tr_sat02,d_tr_sat03,d_tr_sat04,d_tr_sat05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_uscav01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_uscav02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_uscav03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_uscav04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_uscav05 
-!$OMP THREADPRIVATE(d_tr_uscav01,d_tr_uscav02,d_tr_uscav03,d_tr_uscav04,d_tr_uscav05)
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_insc01  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_insc02  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_insc03  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_insc04  
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_insc05  
-!$OMP THREADPRIVATE(d_tr_insc01,d_tr_insc02,d_tr_insc03,d_tr_insc04,d_tr_insc05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_bcscav01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_bcscav02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_bcscav03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_bcscav04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_bcscav05 
-!$OMP THREADPRIVATE(d_tr_bcscav01,d_tr_bcscav02,d_tr_bcscav03,d_tr_bcscav04,d_tr_bcscav05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_evapls01   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_evapls02   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_evapls03   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_evapls04   
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_evapls05   
-!$OMP THREADPRIVATE(d_tr_evapls01,d_tr_evapls02,d_tr_evapls03,d_tr_evapls04,d_tr_evapls05)
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_ls01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_ls02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_ls03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_ls04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_ls05 
-!$OMP THREADPRIVATE(d_tr_ls01,d_tr_ls02,d_tr_ls03,d_tr_ls04,d_tr_ls05)
-
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_dyn01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_dyn02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_dyn03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_dyn04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_dyn05 
-!$OMP THREADPRIVATE(d_tr_dyn01,d_tr_dyn02,d_tr_dyn03,d_tr_dyn04,d_tr_dyn05)
-
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cl01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cl02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cl03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cl04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_cl05 
-!$OMP THREADPRIVATE(d_tr_cl01,d_tr_cl02,d_tr_cl03,d_tr_cl04,d_tr_cl05)
-
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_th01 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_th02 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_th03 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_th04 
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: d_tr_th05 
-!$OMP THREADPRIVATE(d_tr_th01,d_tr_th02,d_tr_th03,d_tr_th04,d_tr_th05)
-
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: sed_ss3D    ! corresponds to tracer 3
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: sed_dust3D  ! corresponds to tracer 4
-      REAL, DIMENSION(:,:), ALLOCATABLE, SAVE :: sed_dustsco3D  ! corresponds to tracer 4
-!$OMP THREADPRIVATE(sed_ss3D,sed_dust3D,sed_dustsco3D)
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_ss    ! corresponds to tracer 3
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dust  ! corresponds to tracer 4
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dustsco  ! corresponds to tracer 4
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2pgas  ! corresponds to tracer 4
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2paer  ! corresponds to tracer 4
-!$OMP THREADPRIVATE(sed_ss,sed_dust,sed_dustsco,his_g2pgas,his_g2paer)
-
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbb
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcbb
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcnff
-!$OMP THREADPRIVATE(fluxbb,fluxff,fluxbcbb,fluxbcff,fluxbcnff)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcba
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbc
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxombb
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnff
-!$OMP THREADPRIVATE(fluxbcba,fluxbc,fluxombb,fluxomff,fluxomnff)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomba
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnat
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxom
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2snff
-!$OMP THREADPRIVATE(fluxomba,fluxomnat,fluxom,fluxh2sff,fluxh2snff)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2nff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2bb
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2vol
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ba
-!$OMP THREADPRIVATE(fluxso2ff,fluxso2nff,fluxso2bb,fluxso2vol,fluxso2ba)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4nff
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4bb
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ba
-!$OMP THREADPRIVATE(fluxso2,fluxso4ff,fluxso4nff,fluxso4ba,fluxso4bb)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdms
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sbio
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdustec
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddfine
-!$OMP THREADPRIVATE(fluxso4,fluxdms,fluxh2sbio,fluxdustec,fluxddfine)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddcoa
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddsco
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdd
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxssfine
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxsscoa
-!$OMP THREADPRIVATE(fluxddcoa,fluxddsco,fluxdd,fluxssfine,fluxsscoa)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxss
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ind
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_bb
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ff
-!$OMP THREADPRIVATE(fluxss,flux_sparam_ind,flux_sparam_bb,flux_sparam_ff)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddfine
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddcoa
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddsco
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ssfine
-!$OMP THREADPRIVATE(flux_sparam_ddfine,flux_sparam_ddcoa)
-!$OMP THREADPRIVATE(flux_sparam_ddsco,flux_sparam_ssfine)
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_sscoa
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: u10m_ss
-      REAL, DIMENSION(:), ALLOCATABLE, SAVE :: v10m_ss
-!$OMP THREADPRIVATE(flux_sparam_sscoa,u10m_ss,v10m_ss)
-
-! Select dust emission scheme for the Sahara:
-!      LOGICAL,PARAMETER,SAVE ::  ok_chimeredust=.FALSE.
-      LOGICAL,PARAMETER ::  ok_chimeredust=.TRUE.
-!!!!!! !$OMP THREADPRIVATE(ok_chimeredust)
+  LOGICAL, parameter :: edgar = .true.
+  INTEGER, parameter :: flag_dms = 4
+  INTEGER(kind = 4)  nbjour
+
+  ! Tracer tendencies, for outputs
+  !-------------------------------
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl  ! Td couche
+  !. limite/traceur
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dec
+  !RomP
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv  ! Td
+  !onvection/traceur
+  ! RomP >>>
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPr, qDi ! concentration tra
+  !dans pluie,air descente insaturee
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qPa, qMel
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: qTrdi, dtrcvMA ! conc traceur
+  !descente air insaturee et td convective MA
+  !! RomP <<<
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th  ! Td thermique
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_impa ! Td du
+  !lessivage par impaction
+  REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_lessi_nucl ! Td du
+  !lessivage par nucleation
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: qPrls      !jyg:
+  !oncentration tra dans pluie LS a la surf.
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dry ! Td depot
+  !sec/traceur (1st layer),ALLOCATABLE,SAVE  jyg
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: flux_tr_dry ! depot
+  !sec/traceur (surface),ALLOCATABLE,SAVE    jyg
+
+  ! Index of each traceur
+  INTEGER, SAVE :: id_prec, id_fine, id_coss, id_codu, id_scdu
+
+  !$OMP THREADPRIVATE(d_tr_cl,d_tr_dec,d_tr_cv,d_tr_insc,d_tr_bcscav,d_tr_evapls)
+  !$OMP THREADPRIVATE(d_tr_ls,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav)
+  !$OMP THREADPRIVATE(qPr,qDi,qPa,qMel,qTrdi,dtrcvMA,d_tr_th,d_tr_lessi_impa)
+  !$OMP THREADPRIVATE(d_tr_lessi_nucl,qPrls,d_tr_dry,flux_tr_dry)
+  !$OMP THREADPRIVATE(id_prec,id_fine,id_coss,id_codu,id_scdu)
+
+  ! JE20141224 <<
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_aod550_tot  ! epaisseur optique total aerosol 550  nm
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_tot  ! epaisseur optique total aerosol 670 nm
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_tot  ! epaisseur optique total aerosol 865 nm
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diff_aod550_tr2  ! epaisseur optique Traceur 2 aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_tr2  ! epaisseur optique Traceur 2 aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_tr2  ! epaisseur optique Traceur 2 aerosol 865 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_ss  ! epaisseur optique Sels marins aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_ss  ! epaisseur optique Sels marins aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_ss   ! epaisseur optique Sels marins aerosol 865 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_dust ! epaisseur optique Dust aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_dust ! epaisseur optique Dust aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_dust ! epaisseur optique Dust aerosol 865 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod550_dustsco ! epaisseur optique Dust SCOarse aerosol 550 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod670_dustsco ! epaisseur optique Dust SCOarse aerosol 670 nm, diagnostic
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: diag_aod865_dustsco ! epaisseur optique Dust SCOarse aerosol 865 nm, diagnostic
+
+  !$OMP THREADPRIVATE(diff_aod550_tot,diag_aod670_tot,diag_aod865_tot)
+  !$OMP THREADPRIVATE(diff_aod550_tr2,diag_aod670_tr2,diag_aod865_tr2)
+  !$OMP THREADPRIVATE(diag_aod550_ss,diag_aod670_ss,diag_aod865_ss,diag_aod550_dust)
+  !$OMP THREADPRIVATE(diag_aod670_dust,diag_aod865_dust,diag_aod550_dustsco)
+  !$OMP THREADPRIVATE(diag_aod670_dustsco,diag_aod865_dustsco)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_terra  ! AOD at terra overpass time ( 10.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_terra  ! AOD at terra overpass time ( 10.30 local hour)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod550_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod670_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_tr2_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_ss_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dust_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: aod865_dustsco_aqua  ! AOD at aqua overpass time ( 13.30 local hour)
+
+  !$OMP THREADPRIVATE(aod550_aqua,aod550_tr2_aqua,aod550_ss_aqua,aod550_dust_aqua,aod550_dustsco_aqua)
+  !$OMP THREADPRIVATE(aod670_aqua,aod670_tr2_aqua,aod670_ss_aqua,aod670_dust_aqua,aod670_dustsco_aqua)
+  !$OMP THREADPRIVATE(aod865_aqua,aod865_tr2_aqua,aod865_ss_aqua,aod865_dust_aqua,aod865_dustsco_aqua)
+  !$OMP THREADPRIVATE(aod550_terra,aod550_tr2_terra,aod550_ss_terra,aod550_dust_terra,aod550_dustsco_terra)
+  !$OMP THREADPRIVATE(aod670_terra,aod670_tr2_terra,aod670_ss_terra,aod670_dust_terra,aod670_dustsco_terra)
+  !$OMP THREADPRIVATE(aod865_terra,aod865_tr2_terra,aod865_ss_terra,aod865_dust_terra,aod865_dustsco_terra)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc01 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm01   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc02 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm02   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc03 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm03   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc04 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm04   ! burden
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sconc05 ! surface concentration
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: trm05   ! burden
+  !$OMP THREADPRIVATE(sconc01,sconc02,sconc03,sconc04,sconc05)
+  !$OMP THREADPRIVATE(trm01,trm02,trm03,trm04,trm05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux05
+  !$OMP THREADPRIVATE(flux01,flux02,flux03,flux04,flux05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ds05
+  !$OMP THREADPRIVATE(ds01,ds02,ds03,ds04,ds05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dh05
+  !$OMP THREADPRIVATE(dh01,dh02,dh03,dh04,dh05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtrconv05
+  !$OMP THREADPRIVATE(dtrconv01,dtrconv02,dtrconv03,dtrconv04,dtrconv05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dtherm05
+  !$OMP THREADPRIVATE(dtherm01,dtherm02,dtherm03,dtherm04,dtherm05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkecv05
+  !$OMP THREADPRIVATE(dhkecv01,dhkecv02,dhkecv03,dhkecv04,dhkecv05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: d_tr_ds05
+  !$OMP THREADPRIVATE(d_tr_ds01,d_tr_ds02,d_tr_ds03,d_tr_ds04,d_tr_ds05)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc01
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc02
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc03
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc04
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: dhkelsc05
+  !$OMP THREADPRIVATE(dhkelsc01,dhkelsc02,dhkelsc03,dhkelsc04,dhkelsc05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cv05
+  !$OMP THREADPRIVATE(d_tr_cv01,d_tr_cv02,d_tr_cv03,d_tr_cv04,d_tr_cv05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_trsp05
+  !$OMP THREADPRIVATE(d_tr_trsp01,d_tr_trsp02,d_tr_trsp03,d_tr_trsp04,d_tr_trsp05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sscav05
+  !$OMP THREADPRIVATE(d_tr_sscav01,d_tr_sscav02,d_tr_sscav03,d_tr_sscav04,d_tr_sscav05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_sat05
+  !$OMP THREADPRIVATE(d_tr_sat01,d_tr_sat02,d_tr_sat03,d_tr_sat04,d_tr_sat05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_uscav05
+  !$OMP THREADPRIVATE(d_tr_uscav01,d_tr_uscav02,d_tr_uscav03,d_tr_uscav04,d_tr_uscav05)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_insc05
+  !$OMP THREADPRIVATE(d_tr_insc01,d_tr_insc02,d_tr_insc03,d_tr_insc04,d_tr_insc05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_bcscav05
+  !$OMP THREADPRIVATE(d_tr_bcscav01,d_tr_bcscav02,d_tr_bcscav03,d_tr_bcscav04,d_tr_bcscav05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_evapls05
+  !$OMP THREADPRIVATE(d_tr_evapls01,d_tr_evapls02,d_tr_evapls03,d_tr_evapls04,d_tr_evapls05)
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_ls05
+  !$OMP THREADPRIVATE(d_tr_ls01,d_tr_ls02,d_tr_ls03,d_tr_ls04,d_tr_ls05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_dyn05
+  !$OMP THREADPRIVATE(d_tr_dyn01,d_tr_dyn02,d_tr_dyn03,d_tr_dyn04,d_tr_dyn05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_cl05
+  !$OMP THREADPRIVATE(d_tr_cl01,d_tr_cl02,d_tr_cl03,d_tr_cl04,d_tr_cl05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th01
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th02
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th03
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th04
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: d_tr_th05
+  !$OMP THREADPRIVATE(d_tr_th01,d_tr_th02,d_tr_th03,d_tr_th04,d_tr_th05)
+
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_ss3D    ! corresponds to tracer 3
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_dust3D  ! corresponds to tracer 4
+  REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: sed_dustsco3D  ! corresponds to tracer 4
+  !$OMP THREADPRIVATE(sed_ss3D,sed_dust3D,sed_dustsco3D)
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_ss    ! corresponds to tracer 3
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dust  ! corresponds to tracer 4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: sed_dustsco  ! corresponds to tracer 4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2pgas  ! corresponds to tracer 4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: his_g2paer  ! corresponds to tracer 4
+  !$OMP THREADPRIVATE(sed_ss,sed_dust,sed_dustsco,his_g2pgas,his_g2paer)
+
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcbb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcnff
+  !$OMP THREADPRIVATE(fluxbb,fluxff,fluxbcbb,fluxbcff,fluxbcnff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbcba
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxbc
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxombb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnff
+  !$OMP THREADPRIVATE(fluxbcba,fluxbc,fluxombb,fluxomff,fluxomnff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomba
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxomnat
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxom
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2snff
+  !$OMP THREADPRIVATE(fluxomba,fluxomnat,fluxom,fluxh2sff,fluxh2snff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2nff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2bb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2vol
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2ba
+  !$OMP THREADPRIVATE(fluxso2ff,fluxso2nff,fluxso2bb,fluxso2vol,fluxso2ba)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso2
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4nff
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4bb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4ba
+  !$OMP THREADPRIVATE(fluxso2,fluxso4ff,fluxso4nff,fluxso4ba,fluxso4bb)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxso4
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdms
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxh2sbio
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdustec
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddfine
+  !$OMP THREADPRIVATE(fluxso4,fluxdms,fluxh2sbio,fluxdustec,fluxddfine)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddcoa
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxddsco
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxdd
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxssfine
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxsscoa
+  !$OMP THREADPRIVATE(fluxddcoa,fluxddsco,fluxdd,fluxssfine,fluxsscoa)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: fluxss
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ind
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_bb
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ff
+  !$OMP THREADPRIVATE(fluxss,flux_sparam_ind,flux_sparam_bb,flux_sparam_ff)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddfine
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddcoa
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ddsco
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_ssfine
+  !$OMP THREADPRIVATE(flux_sparam_ddfine,flux_sparam_ddcoa)
+  !$OMP THREADPRIVATE(flux_sparam_ddsco,flux_sparam_ssfine)
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: flux_sparam_sscoa
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: u10m_ss
+  REAL, DIMENSION(:), ALLOCATABLE, SAVE :: v10m_ss
+  !$OMP THREADPRIVATE(flux_sparam_sscoa,u10m_ss,v10m_ss)
+
+  ! Select dust emission scheme for the Sahara:
+  !      LOGICAL,PARAMETER,SAVE ::  ok_chimeredust=.FALSE.
+  LOGICAL, PARAMETER :: ok_chimeredust = .TRUE.
+  !!!!!! !$OMP THREADPRIVATE(ok_chimeredust)
 
 
 CONTAINS
-!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-SUBROUTINE phytracr_spl_out_init()
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!AS : This subroutine centralises the ALLOCATE needed for the 1st call of
-!     phys_output_write_spl in physiq
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE phytracr_spl_out_init()
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !AS : This subroutine centralises the ALLOCATE needed for the 1st call of
+    !     phys_output_write_spl in physiq
 
     USE dimphy
-    USE infotrac_phy, ONLY: nbtr
-    USE dustemission_mod, ONLY :  dustemis_out_init
+    USE infotrac_phy, ONLY : nbtr
+    USE dustemission_mod, ONLY : dustemis_out_init
 
     ! pour les variables m[1-3]dflux
-    CALL dustemis_out_init() 
-
-!traceur
-      ALLOCATE( diff_aod550_tot(klon)     )
-      ALLOCATE( diag_aod670_tot(klon)     )
-      ALLOCATE( diag_aod865_tot(klon)     )
-      ALLOCATE( diff_aod550_tr2(klon)     )
-      ALLOCATE( diag_aod670_tr2(klon)     )
-      ALLOCATE( diag_aod865_tr2(klon)     )
-      ALLOCATE( diag_aod550_ss(klon)      )
-      ALLOCATE( diag_aod670_ss(klon)      )
-      ALLOCATE( diag_aod865_ss(klon)      )
-      ALLOCATE( diag_aod550_dust(klon)    )
-      ALLOCATE( diag_aod670_dust(klon)    )
-      ALLOCATE( diag_aod865_dust(klon)    )
-      ALLOCATE( diag_aod550_dustsco(klon)  )
-      ALLOCATE( diag_aod670_dustsco(klon)  )
-      ALLOCATE( diag_aod865_dustsco(klon)  )
-      !AS: les 15 vars _terra et 15 _aqua suivantes sont groupees differemment dans spla_output_write.h
-      ALLOCATE( aod550_terra(klon))
-      ALLOCATE( aod550_tr2_terra(klon))
-      ALLOCATE( aod550_ss_terra(klon))
-      ALLOCATE( aod550_dust_terra(klon))
-      ALLOCATE( aod550_dustsco_terra(klon))
-      ALLOCATE( aod670_terra(klon))
-      ALLOCATE( aod670_tr2_terra(klon))
-      ALLOCATE( aod670_ss_terra(klon))
-      ALLOCATE( aod670_dust_terra(klon))
-      ALLOCATE( aod670_dustsco_terra(klon))
-      ALLOCATE( aod865_terra(klon))
-      ALLOCATE( aod865_tr2_terra(klon))
-      ALLOCATE( aod865_ss_terra(klon))
-      ALLOCATE( aod865_dust_terra(klon))
-      ALLOCATE( aod865_dustsco_terra(klon))
-
-      ALLOCATE( aod550_aqua(klon))
-      ALLOCATE( aod550_tr2_aqua(klon))
-      ALLOCATE( aod550_ss_aqua(klon))
-      ALLOCATE( aod550_dust_aqua(klon))
-      ALLOCATE( aod550_dustsco_aqua(klon))
-      ALLOCATE( aod670_aqua(klon))
-      ALLOCATE( aod670_tr2_aqua(klon))
-      ALLOCATE( aod670_ss_aqua(klon))
-      ALLOCATE( aod670_dust_aqua(klon))
-      ALLOCATE( aod670_dustsco_aqua(klon))
-      ALLOCATE( aod865_aqua(klon))
-      ALLOCATE( aod865_tr2_aqua(klon))
-      ALLOCATE( aod865_ss_aqua(klon))
-      ALLOCATE( aod865_dust_aqua(klon))
-      ALLOCATE( aod865_dustsco_aqua(klon))
-
-      ALLOCATE(  sconc01(klon)     )
-      ALLOCATE(  trm01(klon)     )
-      ALLOCATE(  sconc02(klon)     )
-      ALLOCATE(  trm02(klon)     )
-      ALLOCATE(  sconc03(klon)     )
-      ALLOCATE(  trm03(klon)     )
-      ALLOCATE(  sconc04(klon)     )
-      ALLOCATE(  trm04(klon)     )
-      ALLOCATE(  sconc05(klon)     )
-      ALLOCATE(  trm05(klon)     )
-
-! Lessivage
-      ALLOCATE(  flux01(klon)     )
-      ALLOCATE(  flux02(klon)     )
-      ALLOCATE(  flux03(klon)     )
-      ALLOCATE(  flux04(klon)     )
-      ALLOCATE(  flux05(klon)     )
-      ALLOCATE(  ds01(klon)     )
-      ALLOCATE(  ds02(klon)     )
-      ALLOCATE(  ds03(klon)     )
-      ALLOCATE(  ds04(klon)     )
-      ALLOCATE(  ds05(klon)     )
-      ALLOCATE(  dh01(klon)     )
-      ALLOCATE(  dh02(klon)     )
-      ALLOCATE(  dh03(klon)     )
-      ALLOCATE(  dh04(klon)     )
-      ALLOCATE(  dh05(klon)     )
-      ALLOCATE(  dtrconv01(klon)     )
-      ALLOCATE(  dtrconv02(klon)     )
-      ALLOCATE(  dtrconv03(klon)     )
-      ALLOCATE(  dtrconv04(klon)     )
-      ALLOCATE(  dtrconv05(klon)     )
-      ALLOCATE(  dtherm01(klon)     )
-      ALLOCATE(  dtherm02(klon)     )
-      ALLOCATE(  dtherm03(klon)     )
-      ALLOCATE(  dtherm04(klon)     )
-      ALLOCATE(  dtherm05(klon)     )
-      ALLOCATE(  dhkecv01(klon)     )
-      ALLOCATE(  dhkecv02(klon)     )
-      ALLOCATE(  dhkecv03(klon)     )
-      ALLOCATE(  dhkecv04(klon)     )
-      ALLOCATE(  dhkecv05(klon)     )
-      ALLOCATE(  d_tr_ds01(klon)     )
-      ALLOCATE(  d_tr_ds02(klon)     )
-      ALLOCATE(  d_tr_ds03(klon)     )
-      ALLOCATE(  d_tr_ds04(klon)     )
-      ALLOCATE(  d_tr_ds05(klon)     )
-      ALLOCATE(  dhkelsc01(klon)     )
-      ALLOCATE(  dhkelsc02(klon)     )
-      ALLOCATE(  dhkelsc03(klon)     )
-      ALLOCATE(  dhkelsc04(klon)     )
-      ALLOCATE(  dhkelsc05(klon)     )
-      ALLOCATE(  d_tr_cv01(klon,klev))
-      ALLOCATE(  d_tr_cv02(klon,klev))
-      ALLOCATE(  d_tr_cv03(klon,klev))
-      ALLOCATE(  d_tr_cv04(klon,klev))
-      ALLOCATE(  d_tr_cv05(klon,klev))
-      ALLOCATE(  d_tr_trsp01(klon,klev))
-      ALLOCATE(  d_tr_trsp02(klon,klev))
-      ALLOCATE(  d_tr_trsp03(klon,klev))
-      ALLOCATE(  d_tr_trsp04(klon,klev))
-      ALLOCATE(  d_tr_trsp05(klon,klev))
-      ALLOCATE(  d_tr_sscav01(klon,klev))
-      ALLOCATE(  d_tr_sscav02(klon,klev))
-      ALLOCATE(  d_tr_sscav03(klon,klev))
-      ALLOCATE(  d_tr_sscav04(klon,klev))
-      ALLOCATE(  d_tr_sscav05(klon,klev))
-      ALLOCATE(  d_tr_sat01(klon,klev))
-      ALLOCATE(  d_tr_sat02(klon,klev))
-      ALLOCATE(  d_tr_sat03(klon,klev))
-      ALLOCATE(  d_tr_sat04(klon,klev))
-      ALLOCATE(  d_tr_sat05(klon,klev))
-      ALLOCATE(  d_tr_uscav01(klon,klev))
-      ALLOCATE(  d_tr_uscav02(klon,klev))
-      ALLOCATE(  d_tr_uscav03(klon,klev))
-      ALLOCATE(  d_tr_uscav04(klon,klev))
-      ALLOCATE(  d_tr_uscav05(klon,klev))
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ALLOCATE(  d_tr_insc01(klon,klev))
-      ALLOCATE(  d_tr_insc02(klon,klev))
-      ALLOCATE(  d_tr_insc03(klon,klev))
-      ALLOCATE(  d_tr_insc04(klon,klev))
-      ALLOCATE(  d_tr_insc05(klon,klev))
-      ALLOCATE(  d_tr_bcscav01(klon,klev))
-      ALLOCATE(  d_tr_bcscav02(klon,klev))
-      ALLOCATE(  d_tr_bcscav03(klon,klev))
-      ALLOCATE(  d_tr_bcscav04(klon,klev))
-      ALLOCATE(  d_tr_bcscav05(klon,klev))
-      ALLOCATE(  d_tr_evapls01(klon,klev))
-      ALLOCATE(  d_tr_evapls02(klon,klev))
-      ALLOCATE(  d_tr_evapls03(klon,klev))
-      ALLOCATE(  d_tr_evapls04(klon,klev))
-      ALLOCATE(  d_tr_evapls05(klon,klev))
-      ALLOCATE(  d_tr_ls01(klon,klev))
-      ALLOCATE(  d_tr_ls02(klon,klev))
-      ALLOCATE(  d_tr_ls03(klon,klev))
-      ALLOCATE(  d_tr_ls04(klon,klev))
-      ALLOCATE(  d_tr_ls05(klon,klev))
-
-      ALLOCATE(  d_tr_dyn01(klon,klev))
-      ALLOCATE(  d_tr_dyn02(klon,klev))
-      ALLOCATE(  d_tr_dyn03(klon,klev))
-      ALLOCATE(  d_tr_dyn04(klon,klev))
-      ALLOCATE(  d_tr_dyn05(klon,klev))
-
-      ALLOCATE(  d_tr_cl01(klon,klev))
-      ALLOCATE(  d_tr_cl02(klon,klev))
-      ALLOCATE(  d_tr_cl03(klon,klev))
-      ALLOCATE(  d_tr_cl04(klon,klev))
-      ALLOCATE(  d_tr_cl05(klon,klev))
-      ALLOCATE(  d_tr_th01(klon,klev))
-      ALLOCATE(  d_tr_th02(klon,klev))
-      ALLOCATE(  d_tr_th03(klon,klev))
-      ALLOCATE(  d_tr_th04(klon,klev))
-      ALLOCATE(  d_tr_th05(klon,klev))
-
-      ALLOCATE( sed_ss(klon))
-      ALLOCATE( sed_dust(klon))
-      ALLOCATE( sed_dustsco(klon))
-      ALLOCATE( his_g2pgas(klon))
-      ALLOCATE( his_g2paer(klon))
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      ALLOCATE( sed_ss3D(klon,klev))
-      ALLOCATE( sed_dust3D(klon,klev))
-      ALLOCATE( sed_dustsco3D(klon,klev))
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-! histrac_spl
-!
-      ALLOCATE( fluxbb(klon))
-      ALLOCATE( fluxff(klon))
-      ALLOCATE( fluxbcbb(klon))
-      ALLOCATE( fluxbcff(klon))
-      ALLOCATE( fluxbcnff(klon))
-      ALLOCATE( fluxbcba(klon))
-      ALLOCATE( fluxbc(klon))
-      ALLOCATE( fluxombb(klon))
-      ALLOCATE( fluxomff(klon))
-      ALLOCATE( fluxomnff(klon))
-      ALLOCATE( fluxomba(klon))
-      ALLOCATE( fluxomnat(klon))
-      ALLOCATE( fluxom(klon))
-      ALLOCATE( fluxh2sff(klon))
-      ALLOCATE( fluxh2snff(klon))
-      ALLOCATE( fluxso2ff(klon))
-      ALLOCATE( fluxso2nff(klon))
-      ALLOCATE( fluxso2bb(klon))
-      ALLOCATE( fluxso2vol(klon))
-      ALLOCATE( fluxso2ba(klon))
-      ALLOCATE( fluxso2(klon))
-      ALLOCATE( fluxso4ff(klon))
-      ALLOCATE( fluxso4nff(klon))
-      ALLOCATE( fluxso4bb(klon))
-      ALLOCATE( fluxso4ba(klon))
-      ALLOCATE( fluxso4(klon))
-      ALLOCATE( fluxdms(klon))
-      ALLOCATE( fluxh2sbio(klon))
-      ALLOCATE( fluxdustec(klon))
-      ALLOCATE( fluxddfine(klon))
-      ALLOCATE( fluxddcoa(klon))
-      ALLOCATE( fluxddsco(klon))
-      ALLOCATE( fluxdd(klon))
-      ALLOCATE( fluxssfine(klon))
-      ALLOCATE( fluxsscoa(klon))
-      ALLOCATE( fluxss(klon))
-      ALLOCATE( flux_sparam_ind(klon))
-      ALLOCATE( flux_sparam_bb(klon))
-      ALLOCATE( flux_sparam_ff(klon))
-      ALLOCATE( flux_sparam_ddfine(klon))
-      ALLOCATE( flux_sparam_ddcoa(klon))
-      ALLOCATE( flux_sparam_ddsco(klon))
-      ALLOCATE( flux_sparam_ssfine(klon))
-      ALLOCATE( flux_sparam_sscoa(klon))
-      ALLOCATE( u10m_ss(klon))
-      ALLOCATE( v10m_ss(klon))
-
-!AS: in phys_output_write_spl, but not in spla_output_write.h
-!------------------------------------------------------
-      ALLOCATE(d_tr_cl(klon,klev,nbtr))
-      ALLOCATE(d_tr_th(klon,klev,nbtr))
-      ALLOCATE(d_tr_cv(klon,klev,nbtr))
-      ALLOCATE(d_tr_lessi_impa(klon,klev,nbtr))
-      ALLOCATE(d_tr_lessi_nucl(klon,klev,nbtr))
-      ALLOCATE(d_tr_insc(klon,klev,nbtr))
-      ALLOCATE(d_tr_bcscav(klon,klev,nbtr))
-      ALLOCATE(d_tr_evapls(klon,klev,nbtr))
-      ALLOCATE(d_tr_ls(klon,klev,nbtr))
-      ALLOCATE(d_tr_trsp(klon,klev,nbtr))
-      ALLOCATE(d_tr_sscav(klon,klev,nbtr))
-      ALLOCATE(d_tr_sat(klon,klev,nbtr))
-      ALLOCATE(d_tr_uscav(klon,klev,nbtr))
-      
-END SUBROUTINE phytracr_spl_out_init
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-SUBROUTINE phytracr_spl_ini(klon,nbreg_ind,nbreg_bb,nbreg_dust,nbreg_wstardust)
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-
-  IMPLICIT NONE
-  INTEGER klon,nbreg_ind,nbreg_bb,nbreg_dust,nbreg_wstardust
-
-  ALLOCATE(  tsol(klon)              )
-
-!AS: IF permettant le debranchage des coefs de Jeronimo Escribano: fichiers *_meta
-! nbreg_* sont initialisés à 1 dans phytracr_spl, if debutphy, 
-! avant d'appeler la subroutine presente, phytracr_spl_ini 
-! (phytracr_spl_ini appele readregionsdims2_spl, 
-! qui lit et fait "bcast" de nbreg_ind,_bb,_dust,_wstardust dans fichiers regions_*_meta)
-IF("ASSIM"=="YES") THEN
-  fileregionsdimsind='regions_ind_meta'
-  fileregionsdimsdust='regions_dustacc_meta'
-!  fileregionsdimsdust='regions_dust_meta'
-  fileregionsdimsbb='regions_bb_meta'
-  fileregionsdimswstar='regions_pwstarwake_meta'
-  call  readregionsdims2_spl(nbreg_ind,fileregionsdimsind)
-  call  readregionsdims2_spl(nbreg_dust,fileregionsdimsdust)
-  call  readregionsdims2_spl(nbreg_bb,fileregionsdimsbb)
-  call  readregionsdims2_spl(nbreg_wstardust,fileregionsdimswstar)
-  ENDIF ! ASSIM
-! fin debranchage
-
-!readregions_spl()
-
-  ALLOCATE(scale_param_ind(nbreg_ind))
-  ALLOCATE(scale_param_bb(nbreg_bb))
-  ALLOCATE(scale_param_ff(nbreg_ind))
-  ALLOCATE(scale_param_dustacc(nbreg_dust))
-  ALLOCATE(scale_param_dustcoa(nbreg_dust))
-  ALLOCATE(scale_param_dustsco(nbreg_dust))
-  ALLOCATE(param_wstarBLperregion(nbreg_wstardust))
-  ALLOCATE(param_wstarWAKEperregion(nbreg_wstardust))
-  ALLOCATE(  dust_ec(klon)           )
-  ALLOCATE(  u10m_ec(klon)           )
-  ALLOCATE(  v10m_ec(klon)           )
-  ALLOCATE(  lmt_so2volc_cont(klon)  )
-  ALLOCATE(  lmt_altvolc_cont(klon)  )
-  ALLOCATE(  lmt_so2volc_expl(klon)  )
-  ALLOCATE(  lmt_altvolc_expl(klon)  )
-  ALLOCATE(  lmt_so2ff_l(klon)       )   
-  ALLOCATE(  lmt_so2ff_h(klon)       )  
-  ALLOCATE(  lmt_so2nff(klon)        )  
-  ALLOCATE(  lmt_so2ba(klon)         )  
-  ALLOCATE(  lmt_so2bb_l(klon)       )
-  ALLOCATE(  lmt_so2bb_h(klon)       )  
-  ALLOCATE(  lmt_dmsconc(klon)       )  
-  ALLOCATE(  lmt_dmsbio(klon)        )  
-  ALLOCATE(  lmt_h2sbio(klon)        )  
-  ALLOCATE(  lmt_bcff(klon)          )
-  ALLOCATE(  lmt_bcnff(klon)         )
-  ALLOCATE(  lmt_bcbb_l(klon)        )
-  ALLOCATE(  lmt_bcbb_h(klon)        )
-  ALLOCATE(  lmt_bcba(klon)          )
-  ALLOCATE(  lmt_omff(klon)          )  
-  ALLOCATE(  lmt_omnff(klon)         )  
-  ALLOCATE(  lmt_ombb_l(klon)        )  
-  ALLOCATE(  lmt_ombb_h(klon)        )  
-  ALLOCATE(  lmt_omnat(klon)         )  
-  ALLOCATE(  lmt_omba(klon)          )           
-  ALLOCATE(lmt_sea_salt(klon,ss_bins)) 
-
-
-
-
-  !temporal hardcoded null inicialization of assimilation emmision factors
-!AS: scale_param sont ensuite lus dans modvalues.nc 
-! par la subroutine read_scalenc, appelee par readscaleparamsnc_spl
-  scale_param_ssacc=1.
-  scale_param_sscoa=1.
-  scale_param_ind(:)=1.
-  scale_param_bb(:)=1.
-  scale_param_ff(:)=1.
-  scale_param_dustacc(:)=1.
-  scale_param_dustcoa(:)=1.
-  scale_param_dustsco(:)=1.
-  param_wstarBLperregion(:)=0.
-  param_wstarWAKEperregion(:)=0.
-
-
-RETURN
-END SUBROUTINE phytracr_spl_ini
-
-
-
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      SUBROUTINE phytracr_spl ( debutphy,lafin,jD_cur,jH_cur,iflag_conv, &  ! I
-                      pdtphys,ftsol,                                   &  ! I
-                      t_seri,q_seri,paprs,pplay,RHcl,                  &  ! I
-                      pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,          &  ! I
-                      coefh, cdragh, cdragm, yu1, yv1,                 &  ! I
-                      u_seri, v_seri, rlat,rlon,                       &  ! I
-                      pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,            &  ! I
-                      da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,     &  ! I
-                      epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,      &  ! I
-                      evapls,wdtrainA,  wdtrainM,wght_cvfd,              &  ! I
-                      fm_therm, entr_therm, rneb,                      &  ! I
-                      beta_fisrt,beta_v1,                              &  ! I
-                      zu10m,zv10m,wstar,ale_bl,ale_wake,               &  ! I
-                      d_tr_dyn,tr_seri)                                            ! O
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE IOIPSL
-      USE dimphy
-      USE infotrac
-      USE indice_sol_mod
-      USE write_field_phy
-     
-
-      USE mod_phys_lmdz_transfert_para
-      USE lmdz_thermcell_dq,  ONLY : thermcell_dq
-      USE phys_cal_mod, only: jD_1jan,year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
-                              mth_cur, phys_cal_update
-
-!
-      IMPLICIT none
-!
-
-!======================================================================
-! Auteur(s) FH
-! Objet: Moniteur general des tendances traceurs
-!
-! Remarques en vrac:
-! ------------------
-! 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien 
-! les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
-!! AS : nqmax-2 devrait etre nqmax-3 apres introducton de H2Oi ; 
-!!   et c'est encore different avec le parser de DC ?
-!======================================================================
-      INCLUDE "dimensions.h"
-      INCLUDE "chem.h"
-      INCLUDE "chem_spla.h"
-      INCLUDE "YOMCST.h"
-      INCLUDE "YOETHF.h"
-      INCLUDE "paramet.h"
-      INCLUDE "alpale.h"
-
-!======================================================================
-
-! Arguments:
-!
-!  EN ENTREE:
-!  ==========
-!
-!  divers:
-!  -------
-!
-      real,intent(in) :: pdtphys  ! pas d'integration pour la physique (seconde)
-      REAL, intent(in):: jD_cur, jH_cur
-      real, intent(in) ::  ftsol(klon,nbsrf)  ! temperature du sol par type
-      real, intent(in) ::  t_seri(klon,klev)  ! temperature
-      real, intent(in) ::  u_seri(klon,klev)  ! vent
-      real , intent(in) :: v_seri(klon,klev)  ! vent
-      real , intent(in) :: q_seri(klon,klev)  ! vapeur d eau kg/kg
-
-LOGICAL,  INTENT(IN)                          :: lafin
-
-      real tr_seri(klon,klev,nbtr) ! traceur  
-      real tmp_var(klon,klev) ! auxiliary variable to replace traceur  
-      real tmp_var2(klon,nbtr) ! auxiliary variable to replace source
-      real tmp_var3(klon,klev,nbtr) ! auxiliary variable 3D  
-      real dummy1d ! JE auxiliary variable
-      real aux_var2(klon) ! auxiliary variable to replace traceur  
-      real aux_var3(klon,klev) ! auxiliary variable to replace traceur  
-      real d_tr(klon,klev,nbtr)    ! traceur  tendance
-      real sconc_seri(klon,nbtr) ! surface concentration of traceur  
-!
-      integer nbjour
-      save nbjour
-!$OMP THREADPRIVATE(nbjour)
-!
-      INTEGER  masque_aqua_cur(klon)
-      INTEGER  masque_terra_cur(klon)
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_aqua  !mask for 1 day
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_terra !
-!$OMP THREADPRIVATE(masque_aqua,masque_terra)
-
-  INTEGER, SAVE :: nbreg_dust, nbreg_ind, nbreg_bb, nbreg_ss,nbreg_wstardust
-  !$OMP THREADPRIVATE(nbreg_dust, nbreg_ind, nbreg_bb,nbreg_ss,nbreg_wstardust)
-
-
-
-      REAL lmt_dms(klon)           ! emissions de dms
-
-!JE20150518<<
-      REAL, DIMENSION(klon_glo)  :: aod550_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
-
-      REAL, DIMENSION(klon_glo)  :: aod550_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod550_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod670_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-      REAL, DIMENSION(klon_glo)  :: aod865_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
-!!!!!!!!!!!!!
-!JE20150518>>
-
-
-
-
-      real , intent(in) :: paprs(klon,klev+1)  ! pression pour chaque inter-couche (en Pa)
-      real , intent(in) :: pplay(klon,klev)  ! pression pour le mileu de chaque couche (en Pa)
-      real , intent(in) :: RHcl(klon,klev)  ! humidite relativen ciel clair
-      real znivsig(klev)  ! indice des couches
-      real paire(klon)
-      real, intent(in) ::  pphis(klon)
-      real, intent(in) ::  pctsrf(klon,nbsrf)
-      logical , intent(in) :: debutphy   ! le flag de l'initialisation de la physique
-!
-!  Scaling Parameters:
-!  ----------------------
-!
-      CHARACTER*50 c_Directory
-      CHARACTER*80 c_FileName1 
-      CHARACTER*80 c_FileName2
-      CHARACTER*130 c_FullName1
-      CHARACTER*130 c_FullName2
-      INTEGER :: xidx, yidx
-      INTEGER,DIMENSION(klon) :: mask_bbreg
-      INTEGER,DIMENSION(klon) :: mask_ffso2reg
-      INTEGER :: aux_mask1
-      INTEGER :: aux_mask2
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_so4 !Defines regions for SO4 ; AS: PAS UTILISE!
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_ind  !Defines regions for SO2, BC & OM
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_bb   !Defines regions for SO2, BC & OM
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_dust !Defines  dust regions
-      INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_wstardust !Defines  dust regions
-!$OMP THREADPRIVATE(iregion_so4,iregion_ind,iregion_bb,iregion_dust,iregion_wstardust)
-
-!  Emissions:
-
-!
-!---------------------------- SEA SALT & DUST emissions ------------------------
-      REAL lmt_sea_salt(klon,ss_bins) !Sea salt 0.03-8.0 um
-      REAL u10m_ec1(klon),v10m_ec1(klon)
-      REAL u10m_ec2(klon),v10m_ec2(klon),dust_ec2(klon)
-      REAL dust_ec(klon)
-!     new dust emission chimere je20140522
-      REAL,DIMENSION(klon),INTENT(IN)                     :: zu10m
-      REAL,DIMENSION(klon),INTENT(IN)                     :: zv10m
-      REAL,DIMENSION(klon),INTENT(IN)  :: wstar,ale_bl,ale_wake
-
-
-!
-!  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-     !Dynamique
-     !--------
-      REAL,DIMENSION(klon,klev,nbtr),INTENT(IN)    :: d_tr_dyn
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!  convection:
-!  -----------
-!
-      REAL , intent(in) :: pmfu(klon,klev)  ! flux de masse dans le panache montant
-      REAL , intent(in) :: pmfd(klon,klev)  ! flux de masse dans le panache descendant
-      REAL, intent(in) ::  pen_u(klon,klev) ! flux entraine dans le panache montant
-      REAL, intent(in) ::  pde_u(klon,klev) ! flux detraine dans le panache montant
-      REAL, intent(in) ::  pen_d(klon,klev) ! flux entraine dans le panache descendant
-      REAL, intent(in) ::  pde_d(klon,klev) ! flux detraine dans le panache descendant
-!
-!  Convection KE scheme:
-!  ---------------------
-!
-!! Variables pour le lessivage convectif
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: da
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN):: phi
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: mp
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: upwd      ! saturated
-!            updraft mass flux
-       REAL,DIMENSION(klon,klev),INTENT(IN)     :: dnwd      ! saturated
-!            downdraft mass flux
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: itop_con
-       INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
-       REAL,DIMENSION(klon,klev)      :: evapls
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM
-
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: ep
-       REAL,DIMENSION(klon),INTENT(IN)           :: sigd
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: sij
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: clw
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: elij
-       REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: epmlmMm
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: eplaMm
-       REAL,DIMENSION(klon,klev),INTENT(IN)      :: wght_cvfd          !RL
-
-
-!     KE: Tendances de traceurs (Td) et flux de traceurs:
-!     ------------------------
-       REAL,DIMENSION(klon,klev)      :: Mint
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfd1a
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfdam
-       REAL,DIMENSION(klon,klev,nbtr) :: zmfphi2
-
-!                                                        !tra dans pluie LS a la surf.
-!      outputs for cvltr_spl
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cv_o  
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_trsp_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sscav_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_sat_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_uscav_o
-     !!!!!!!!!!!!!!!!!
-     !!!!!!!!!!!!!!!!!
-     !!!!!!!!!!!!!!!!!
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_insc_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_bcscav_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_evapls_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_ls_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_dyn_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_cl_o
-       REAL,DIMENSION(:,:,:),ALLOCATABLE,SAVE :: d_tr_th_o
-     !!!!!!!!!!!!!!!!!
-     !!!!!!!!!!!!!!!!!
-     !!!!!!!!!!!!!!!!!
-
-!$OMP THREADPRIVATE(d_tr_cv_o,d_tr_trsp_o,d_tr_sscav_o,d_tr_sat_o,d_tr_uscav_o)
-!$OMP THREADPRIVATE(d_tr_insc_o,d_tr_bcscav_o,d_tr_evapls_o,d_tr_ls_o)
-!$OMP THREADPRIVATE(d_tr_dyn_o,d_tr_cl_o,d_tr_th_o)
-
-
-       INTEGER ::  nsplit
-!
-
-     
-
-!
-!  Lessivage
-!  ---------
-!
-      REAL, intent(in) ::  pmflxr(klon,klev+1), pmflxs(klon,klev+1)   !--convection
-      REAL, intent(in) ::  prfl(klon,klev+1),   psfl(klon,klev+1)     !--large-scale
-      REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
-      REAL  :: ql_incloud_ref    ! ref value of in-cloud condensed water content
-
-       REAL,DIMENSION(klon,klev),INTENT(IN)   :: rneb    ! fraction nuageuse (grande echelle)
-!
-
-      REAL,DIMENSION(klon,klev) :: beta_fisrt ! taux de conversion
-!                                                          ! de l'eau cond (de fisrtilp)
-      REAL,DIMENSION(klon,klev) :: beta_v1    ! -- (originale version)
-      INTEGER,SAVE  :: iflag_lscav_omp,iflag_lscav
-!$OMP THREADPRIVATE(iflag_lscav_omp,iflag_lscav)
-
-
-
-
-!Thermiques:
-!----------
-      REAL,DIMENSION(klon,klev+1),INTENT(IN)   :: fm_therm
-      REAL,DIMENSION(klon,klev),INTENT(INOUT)     :: entr_therm
-
-
-!
-!  Couche limite:
-!  --------------
-!
-      REAL , intent(in) :: coefh(klon,klev) ! coeff melange CL
-      REAL , intent(in) :: cdragh(klon), cdragm(klon)
-      REAL, intent(in) ::  yu1(klon)        ! vent dans la 1iere couche
-      REAL, intent(in) ::  yv1(klon)        ! vent dans la 1iere couche
-!
-!
-!----------------------------------------------------------------------
-      REAL his_ds(klon,nbtr)
-      REAL his_dh(klon,nbtr)
-      REAL his_dhlsc(klon,nbtr)        ! in-cloud scavenging lsc
-      REAL his_dhcon(klon,nbtr)       ! in-cloud scavenging con
-      REAL his_dhbclsc(klon,nbtr)      ! below-cloud scavenging lsc
-      REAL his_dhbccon(klon,nbtr)      ! below-cloud scavenging con
-      REAL trm(klon,nbtr)
-!
-      REAL u10m_ec(klon), v10m_ec(klon)
-!
-      REAL his_th(klon,nbtr)
-      REAL his_dhkecv(klon,nbtr)
-      REAL his_dhkelsc(klon,nbtr)
-
-
-!
-!  Coordonnees
-!  -----------
-!
-      REAL, intent(in) ::  rlat(klon)       ! latitudes pour chaque point 
-      REAL, intent(in) ::  rlon(klon)       ! longitudes pour chaque point 
-!
-      INTEGER i, k, iq, itr, j, ig 
-!
-! DEFINITION OF DIAGNOSTIC VARIABLES
-!
-      REAL diag_trm(nbtr), diag_drydep(nbtr) 
-      REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
-      REAL diag_emissn(nbtr), diag_g2part
-      REAL diag_sedimt
-      REAL trm_aux(nbtr), src_aux(nbtr)
-!
-! Variables locales pour effectuer les appels en serie
-!----------------------------------------------------
-      REAL source_tr(klon,nbtr)
-      REAL flux_tr(klon,nbtr)
-      REAL m_conc(klon,klev)
-      REAL henry(nbtr)  !--cste de Henry  mol/l/atm
-      REAL kk(nbtr)     !--coefficient de var avec T (K)
-      REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
-      REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
-      REAL vdep_oce(nbtr), vdep_sic(nbtr)
-      REAL vdep_ter(nbtr), vdep_lic(nbtr)
-      REAL ccntrAA_spla(nbtr)
-      REAL ccntrENV_spla(nbtr)
-      REAL coefcoli_spla(nbtr)
-      REAL dtrconv(klon,nbtr)
-      REAL zrho(klon,klev), zdz(klon,klev)
-      REAL zalt(klon,klev)
-      REAL,DIMENSION(klon,klev)      :: zmasse    ! densité atmosphérique
-!     .                                              Kg/m2
-      REAL,DIMENSION(klon,klev)      :: ztra_th
-      REAL qmin, qmax, aux
-!      PARAMETER (qmin=0.0, qmax=1.e33)
-      PARAMETER (qmin=1.e33, qmax=-1.e33)
-
-! Variables to save data into file
-!----------------------------------
-   
-      CHARACTER*2 str2
-!!AS:      LOGICAL ok_histrac
-!!!JE2014124      PARAMETER (ok_histrac=.true.)
-!!      PARAMETER (ok_histrac=.false.)
-      INTEGER ndex2d(iim*(jjm+1)), ndex3d(iim*(jjm+1)*klev)
-      INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
-      INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-      SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
-!$OMP THREADPRIVATE(nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5)
-      INTEGER itra
-      SAVE itra                    ! compteur pour la physique
-!$OMP THREADPRIVATE(itra)
-      INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
-      SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
-!$OMP THREADPRIVATE(ecrit_tra, ecrit_tra_h, ecrit_tra_m)
-      REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
-      REAL zx_tmp_2d(iim,jjm+1), zx_tmp_3d(iim,jjm+1,klev)
-      REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
-      REAL zx_lon_glo(nbp_lon,nbp_lat), zx_lat_glo(nbp_lon,nbp_lat)
-      REAL zsto, zout, zout_h, zout_m, zjulian
-
-!------Molar Masses
-      REAL masse(nbtr)
-!
-      REAL fracso2emis                              !--fraction so2 emis en so2
-      PARAMETER (fracso2emis=0.95) 
-      REAL frach2sofso2                             !--fraction h2s from so2
-      PARAMETER (frach2sofso2=0.0426)
-!
-!  Controles
-!-------------
-      LOGICAL convection,lessivage,lminmax,lcheckmass
-      DATA convection,lessivage,lminmax,lcheckmass &
-          /.true.,.true.,.true.,.false./
-!
-      REAL xconv(nbtr)
-!
-      LOGICAL anthropo, bateau, edgar
-      DATA anthropo,bateau,edgar/.true.,.true.,.true./
-!
-!c bc_source
-      INTEGER kminbc, kmaxbc
-!JE20150715      PARAMETER (kminbc=3, kmaxbc=5)
-      PARAMETER (kminbc=4, kmaxbc=7)
-!
-      REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
-!
-! JE for updating in  cltrac
-      REAL,DIMENSION(klon,klev)             :: delp     ! epaisseur de couche (Pa)
-!! JE for include gas to particle conversion in output
-!      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
-!      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
-!
-      INTEGER ,intent(in) :: iflag_conv
-      LOGICAL iscm3  ! debug variable. for checkmass ! JE
-
-!------------------------------------------------------------------------
-!  only to compute time consumption of each process
-!----
-      INTEGER clock_start,clock_end,clock_rate,clock_start_spla
-      INTEGER clock_end_outphytracr,clock_start_outphytracr
-      INTEGER ti_init,dife,ti_inittype,ti_inittwrite
-      INTEGER ti_spla,ti_emis,ti_depo,ti_cltr,ti_ther
-      INTEGER ti_sedi,ti_gasp,ti_wetap,ti_cvltr,ti_lscs,ti_brop,ti_outs
-      INTEGER ti_nophytracr,clock_per_max
-      REAL tia_init,tia_inittype,tia_inittwrite
-      REAL tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther
-      REAL tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs
-      REAL tia_brop,tia_outs
-      REAL tia_nophytracr
- 
-      SAVE tia_init,tia_inittype,tia_inittwrite
-      SAVE tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther
-      SAVE tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs
-      SAVE tia_brop,tia_outs
-      SAVE ti_nophytracr
-      SAVE tia_nophytracr
-      SAVE clock_end_outphytracr,clock_start_outphytracr
-      SAVE clock_per_max
-      LOGICAL logitime
-!$OMP THREADPRIVATE(tia_init,tia_inittype,tia_inittwrite)
-!$OMP THREADPRIVATE(tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther)
-!$OMP THREADPRIVATE(tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs)
-!$OMP THREADPRIVATE(tia_brop,tia_outs)
-!$OMP THREADPRIVATE(ti_nophytracr)
-!$OMP THREADPRIVATE(tia_nophytracr)
-!$OMP THREADPRIVATE(clock_end_outphytracr,clock_start_outphytracr)
-!$OMP THREADPRIVATE(clock_per_max)
-
-!     utils parallelization
-      REAL :: auxklon_glo(klon_glo)
-      INTEGER :: iauxklon_glo(klon_glo)
-      REAL, DIMENSION(klon_glo,nbp_lev) :: auxklonnbp_lev
-      REAL, DIMENSION(klon_glo,nbp_lev,nbtr)  :: auxklonklevnbtr_glo
-      REAL,DIMENSION(nbp_lon,nbp_lat) ::  zx_tmp_2d_glo
-      REAL,DIMENSION(nbp_lon,nbp_lat,nbp_lev) :: zx_tmp_3d_glo
-      REAL,DIMENSION(klon_glo) :: zx_tmp_fi2d_glo
-      REAL,DIMENSION(klon_glo , nbp_lev) :: zx_tmp_fi3d_glo
-      REAL,DIMENSION(klon_glo,nbtr) :: auxklonnbtr_glo
-
-
-
-      source_tr=0.
-
-
-
-      if (debutphy) then
+    CALL dustemis_out_init()
+
+    !traceur
+    ALLOCATE(diff_aod550_tot(klon))
+    ALLOCATE(diag_aod670_tot(klon))
+    ALLOCATE(diag_aod865_tot(klon))
+    ALLOCATE(diff_aod550_tr2(klon))
+    ALLOCATE(diag_aod670_tr2(klon))
+    ALLOCATE(diag_aod865_tr2(klon))
+    ALLOCATE(diag_aod550_ss(klon))
+    ALLOCATE(diag_aod670_ss(klon))
+    ALLOCATE(diag_aod865_ss(klon))
+    ALLOCATE(diag_aod550_dust(klon))
+    ALLOCATE(diag_aod670_dust(klon))
+    ALLOCATE(diag_aod865_dust(klon))
+    ALLOCATE(diag_aod550_dustsco(klon))
+    ALLOCATE(diag_aod670_dustsco(klon))
+    ALLOCATE(diag_aod865_dustsco(klon))
+    !AS: les 15 vars _terra et 15 _aqua suivantes sont groupees differemment dans spla_output_write.h
+    ALLOCATE(aod550_terra(klon))
+    ALLOCATE(aod550_tr2_terra(klon))
+    ALLOCATE(aod550_ss_terra(klon))
+    ALLOCATE(aod550_dust_terra(klon))
+    ALLOCATE(aod550_dustsco_terra(klon))
+    ALLOCATE(aod670_terra(klon))
+    ALLOCATE(aod670_tr2_terra(klon))
+    ALLOCATE(aod670_ss_terra(klon))
+    ALLOCATE(aod670_dust_terra(klon))
+    ALLOCATE(aod670_dustsco_terra(klon))
+    ALLOCATE(aod865_terra(klon))
+    ALLOCATE(aod865_tr2_terra(klon))
+    ALLOCATE(aod865_ss_terra(klon))
+    ALLOCATE(aod865_dust_terra(klon))
+    ALLOCATE(aod865_dustsco_terra(klon))
+
+    ALLOCATE(aod550_aqua(klon))
+    ALLOCATE(aod550_tr2_aqua(klon))
+    ALLOCATE(aod550_ss_aqua(klon))
+    ALLOCATE(aod550_dust_aqua(klon))
+    ALLOCATE(aod550_dustsco_aqua(klon))
+    ALLOCATE(aod670_aqua(klon))
+    ALLOCATE(aod670_tr2_aqua(klon))
+    ALLOCATE(aod670_ss_aqua(klon))
+    ALLOCATE(aod670_dust_aqua(klon))
+    ALLOCATE(aod670_dustsco_aqua(klon))
+    ALLOCATE(aod865_aqua(klon))
+    ALLOCATE(aod865_tr2_aqua(klon))
+    ALLOCATE(aod865_ss_aqua(klon))
+    ALLOCATE(aod865_dust_aqua(klon))
+    ALLOCATE(aod865_dustsco_aqua(klon))
+
+    ALLOCATE(sconc01(klon))
+    ALLOCATE(trm01(klon))
+    ALLOCATE(sconc02(klon))
+    ALLOCATE(trm02(klon))
+    ALLOCATE(sconc03(klon))
+    ALLOCATE(trm03(klon))
+    ALLOCATE(sconc04(klon))
+    ALLOCATE(trm04(klon))
+    ALLOCATE(sconc05(klon))
+    ALLOCATE(trm05(klon))
+
+    ! Lessivage
+    ALLOCATE(flux01(klon))
+    ALLOCATE(flux02(klon))
+    ALLOCATE(flux03(klon))
+    ALLOCATE(flux04(klon))
+    ALLOCATE(flux05(klon))
+    ALLOCATE(ds01(klon))
+    ALLOCATE(ds02(klon))
+    ALLOCATE(ds03(klon))
+    ALLOCATE(ds04(klon))
+    ALLOCATE(ds05(klon))
+    ALLOCATE(dh01(klon))
+    ALLOCATE(dh02(klon))
+    ALLOCATE(dh03(klon))
+    ALLOCATE(dh04(klon))
+    ALLOCATE(dh05(klon))
+    ALLOCATE(dtrconv01(klon))
+    ALLOCATE(dtrconv02(klon))
+    ALLOCATE(dtrconv03(klon))
+    ALLOCATE(dtrconv04(klon))
+    ALLOCATE(dtrconv05(klon))
+    ALLOCATE(dtherm01(klon))
+    ALLOCATE(dtherm02(klon))
+    ALLOCATE(dtherm03(klon))
+    ALLOCATE(dtherm04(klon))
+    ALLOCATE(dtherm05(klon))
+    ALLOCATE(dhkecv01(klon))
+    ALLOCATE(dhkecv02(klon))
+    ALLOCATE(dhkecv03(klon))
+    ALLOCATE(dhkecv04(klon))
+    ALLOCATE(dhkecv05(klon))
+    ALLOCATE(d_tr_ds01(klon))
+    ALLOCATE(d_tr_ds02(klon))
+    ALLOCATE(d_tr_ds03(klon))
+    ALLOCATE(d_tr_ds04(klon))
+    ALLOCATE(d_tr_ds05(klon))
+    ALLOCATE(dhkelsc01(klon))
+    ALLOCATE(dhkelsc02(klon))
+    ALLOCATE(dhkelsc03(klon))
+    ALLOCATE(dhkelsc04(klon))
+    ALLOCATE(dhkelsc05(klon))
+    ALLOCATE(d_tr_cv01(klon, klev))
+    ALLOCATE(d_tr_cv02(klon, klev))
+    ALLOCATE(d_tr_cv03(klon, klev))
+    ALLOCATE(d_tr_cv04(klon, klev))
+    ALLOCATE(d_tr_cv05(klon, klev))
+    ALLOCATE(d_tr_trsp01(klon, klev))
+    ALLOCATE(d_tr_trsp02(klon, klev))
+    ALLOCATE(d_tr_trsp03(klon, klev))
+    ALLOCATE(d_tr_trsp04(klon, klev))
+    ALLOCATE(d_tr_trsp05(klon, klev))
+    ALLOCATE(d_tr_sscav01(klon, klev))
+    ALLOCATE(d_tr_sscav02(klon, klev))
+    ALLOCATE(d_tr_sscav03(klon, klev))
+    ALLOCATE(d_tr_sscav04(klon, klev))
+    ALLOCATE(d_tr_sscav05(klon, klev))
+    ALLOCATE(d_tr_sat01(klon, klev))
+    ALLOCATE(d_tr_sat02(klon, klev))
+    ALLOCATE(d_tr_sat03(klon, klev))
+    ALLOCATE(d_tr_sat04(klon, klev))
+    ALLOCATE(d_tr_sat05(klon, klev))
+    ALLOCATE(d_tr_uscav01(klon, klev))
+    ALLOCATE(d_tr_uscav02(klon, klev))
+    ALLOCATE(d_tr_uscav03(klon, klev))
+    ALLOCATE(d_tr_uscav04(klon, klev))
+    ALLOCATE(d_tr_uscav05(klon, klev))
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ALLOCATE(d_tr_insc01(klon, klev))
+    ALLOCATE(d_tr_insc02(klon, klev))
+    ALLOCATE(d_tr_insc03(klon, klev))
+    ALLOCATE(d_tr_insc04(klon, klev))
+    ALLOCATE(d_tr_insc05(klon, klev))
+    ALLOCATE(d_tr_bcscav01(klon, klev))
+    ALLOCATE(d_tr_bcscav02(klon, klev))
+    ALLOCATE(d_tr_bcscav03(klon, klev))
+    ALLOCATE(d_tr_bcscav04(klon, klev))
+    ALLOCATE(d_tr_bcscav05(klon, klev))
+    ALLOCATE(d_tr_evapls01(klon, klev))
+    ALLOCATE(d_tr_evapls02(klon, klev))
+    ALLOCATE(d_tr_evapls03(klon, klev))
+    ALLOCATE(d_tr_evapls04(klon, klev))
+    ALLOCATE(d_tr_evapls05(klon, klev))
+    ALLOCATE(d_tr_ls01(klon, klev))
+    ALLOCATE(d_tr_ls02(klon, klev))
+    ALLOCATE(d_tr_ls03(klon, klev))
+    ALLOCATE(d_tr_ls04(klon, klev))
+    ALLOCATE(d_tr_ls05(klon, klev))
+
+    ALLOCATE(d_tr_dyn01(klon, klev))
+    ALLOCATE(d_tr_dyn02(klon, klev))
+    ALLOCATE(d_tr_dyn03(klon, klev))
+    ALLOCATE(d_tr_dyn04(klon, klev))
+    ALLOCATE(d_tr_dyn05(klon, klev))
+
+    ALLOCATE(d_tr_cl01(klon, klev))
+    ALLOCATE(d_tr_cl02(klon, klev))
+    ALLOCATE(d_tr_cl03(klon, klev))
+    ALLOCATE(d_tr_cl04(klon, klev))
+    ALLOCATE(d_tr_cl05(klon, klev))
+    ALLOCATE(d_tr_th01(klon, klev))
+    ALLOCATE(d_tr_th02(klon, klev))
+    ALLOCATE(d_tr_th03(klon, klev))
+    ALLOCATE(d_tr_th04(klon, klev))
+    ALLOCATE(d_tr_th05(klon, klev))
+
+    ALLOCATE(sed_ss(klon))
+    ALLOCATE(sed_dust(klon))
+    ALLOCATE(sed_dustsco(klon))
+    ALLOCATE(his_g2pgas(klon))
+    ALLOCATE(his_g2paer(klon))
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ALLOCATE(sed_ss3D(klon, klev))
+    ALLOCATE(sed_dust3D(klon, klev))
+    ALLOCATE(sed_dustsco3D(klon, klev))
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    ! histrac_spl
+
+    ALLOCATE(fluxbb(klon))
+    ALLOCATE(fluxff(klon))
+    ALLOCATE(fluxbcbb(klon))
+    ALLOCATE(fluxbcff(klon))
+    ALLOCATE(fluxbcnff(klon))
+    ALLOCATE(fluxbcba(klon))
+    ALLOCATE(fluxbc(klon))
+    ALLOCATE(fluxombb(klon))
+    ALLOCATE(fluxomff(klon))
+    ALLOCATE(fluxomnff(klon))
+    ALLOCATE(fluxomba(klon))
+    ALLOCATE(fluxomnat(klon))
+    ALLOCATE(fluxom(klon))
+    ALLOCATE(fluxh2sff(klon))
+    ALLOCATE(fluxh2snff(klon))
+    ALLOCATE(fluxso2ff(klon))
+    ALLOCATE(fluxso2nff(klon))
+    ALLOCATE(fluxso2bb(klon))
+    ALLOCATE(fluxso2vol(klon))
+    ALLOCATE(fluxso2ba(klon))
+    ALLOCATE(fluxso2(klon))
+    ALLOCATE(fluxso4ff(klon))
+    ALLOCATE(fluxso4nff(klon))
+    ALLOCATE(fluxso4bb(klon))
+    ALLOCATE(fluxso4ba(klon))
+    ALLOCATE(fluxso4(klon))
+    ALLOCATE(fluxdms(klon))
+    ALLOCATE(fluxh2sbio(klon))
+    ALLOCATE(fluxdustec(klon))
+    ALLOCATE(fluxddfine(klon))
+    ALLOCATE(fluxddcoa(klon))
+    ALLOCATE(fluxddsco(klon))
+    ALLOCATE(fluxdd(klon))
+    ALLOCATE(fluxssfine(klon))
+    ALLOCATE(fluxsscoa(klon))
+    ALLOCATE(fluxss(klon))
+    ALLOCATE(flux_sparam_ind(klon))
+    ALLOCATE(flux_sparam_bb(klon))
+    ALLOCATE(flux_sparam_ff(klon))
+    ALLOCATE(flux_sparam_ddfine(klon))
+    ALLOCATE(flux_sparam_ddcoa(klon))
+    ALLOCATE(flux_sparam_ddsco(klon))
+    ALLOCATE(flux_sparam_ssfine(klon))
+    ALLOCATE(flux_sparam_sscoa(klon))
+    ALLOCATE(u10m_ss(klon))
+    ALLOCATE(v10m_ss(klon))
+
+    !AS: in phys_output_write_spl, but not in spla_output_write.h
+    !------------------------------------------------------
+    ALLOCATE(d_tr_cl(klon, klev, nbtr))
+    ALLOCATE(d_tr_th(klon, klev, nbtr))
+    ALLOCATE(d_tr_cv(klon, klev, nbtr))
+    ALLOCATE(d_tr_lessi_impa(klon, klev, nbtr))
+    ALLOCATE(d_tr_lessi_nucl(klon, klev, nbtr))
+    ALLOCATE(d_tr_insc(klon, klev, nbtr))
+    ALLOCATE(d_tr_bcscav(klon, klev, nbtr))
+    ALLOCATE(d_tr_evapls(klon, klev, nbtr))
+    ALLOCATE(d_tr_ls(klon, klev, nbtr))
+    ALLOCATE(d_tr_trsp(klon, klev, nbtr))
+    ALLOCATE(d_tr_sscav(klon, klev, nbtr))
+    ALLOCATE(d_tr_sat(klon, klev, nbtr))
+    ALLOCATE(d_tr_uscav(klon, klev, nbtr))
+
+  END SUBROUTINE phytracr_spl_out_init
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE phytracr_spl_ini(klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust)
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    IMPLICIT NONE
+    INTEGER klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust
+
+    ALLOCATE(tsol(klon))
+
+    !AS: IF permettant le debranchage des coefs de Jeronimo Escribano: fichiers *_meta
+    ! nbreg_* sont initialisés à 1 dans phytracr_spl, if debutphy,
+    ! avant d'appeler la subroutine presente, phytracr_spl_ini
+    ! (phytracr_spl_ini appele readregionsdims2_spl,
+    ! qui lit et fait "bcast" de nbreg_ind,_bb,_dust,_wstardust dans fichiers regions_*_meta)
+    IF("ASSIM"=="YES") THEN
+      fileregionsdimsind = 'regions_ind_meta'
+      fileregionsdimsdust = 'regions_dustacc_meta'
+      !  fileregionsdimsdust='regions_dust_meta'
+      fileregionsdimsbb = 'regions_bb_meta'
+      fileregionsdimswstar = 'regions_pwstarwake_meta'
+      call  readregionsdims2_spl(nbreg_ind, fileregionsdimsind)
+      call  readregionsdims2_spl(nbreg_dust, fileregionsdimsdust)
+      call  readregionsdims2_spl(nbreg_bb, fileregionsdimsbb)
+      call  readregionsdims2_spl(nbreg_wstardust, fileregionsdimswstar)
+    ENDIF ! ASSIM
+    ! fin debranchage
+
+    !readregions_spl()
+
+    ALLOCATE(scale_param_ind(nbreg_ind))
+    ALLOCATE(scale_param_bb(nbreg_bb))
+    ALLOCATE(scale_param_ff(nbreg_ind))
+    ALLOCATE(scale_param_dustacc(nbreg_dust))
+    ALLOCATE(scale_param_dustcoa(nbreg_dust))
+    ALLOCATE(scale_param_dustsco(nbreg_dust))
+    ALLOCATE(param_wstarBLperregion(nbreg_wstardust))
+    ALLOCATE(param_wstarWAKEperregion(nbreg_wstardust))
+    ALLOCATE(dust_ec(klon))
+    ALLOCATE(u10m_ec(klon))
+    ALLOCATE(v10m_ec(klon))
+    ALLOCATE(lmt_so2volc_cont(klon))
+    ALLOCATE(lmt_altvolc_cont(klon))
+    ALLOCATE(lmt_so2volc_expl(klon))
+    ALLOCATE(lmt_altvolc_expl(klon))
+    ALLOCATE(lmt_so2ff_l(klon))
+    ALLOCATE(lmt_so2ff_h(klon))
+    ALLOCATE(lmt_so2nff(klon))
+    ALLOCATE(lmt_so2ba(klon))
+    ALLOCATE(lmt_so2bb_l(klon))
+    ALLOCATE(lmt_so2bb_h(klon))
+    ALLOCATE(lmt_dmsconc(klon))
+    ALLOCATE(lmt_dmsbio(klon))
+    ALLOCATE(lmt_h2sbio(klon))
+    ALLOCATE(lmt_bcff(klon))
+    ALLOCATE(lmt_bcnff(klon))
+    ALLOCATE(lmt_bcbb_l(klon))
+    ALLOCATE(lmt_bcbb_h(klon))
+    ALLOCATE(lmt_bcba(klon))
+    ALLOCATE(lmt_omff(klon))
+    ALLOCATE(lmt_omnff(klon))
+    ALLOCATE(lmt_ombb_l(klon))
+    ALLOCATE(lmt_ombb_h(klon))
+    ALLOCATE(lmt_omnat(klon))
+    ALLOCATE(lmt_omba(klon))
+    ALLOCATE(lmt_sea_salt(klon, ss_bins))
+
+
+
+
+    !temporal hardcoded null inicialization of assimilation emmision factors
+    !AS: scale_param sont ensuite lus dans modvalues.nc
+    ! par la subroutine read_scalenc, appelee par readscaleparamsnc_spl
+    scale_param_ssacc = 1.
+    scale_param_sscoa = 1.
+    scale_param_ind(:) = 1.
+    scale_param_bb(:) = 1.
+    scale_param_ff(:) = 1.
+    scale_param_dustacc(:) = 1.
+    scale_param_dustcoa(:) = 1.
+    scale_param_dustsco(:) = 1.
+    param_wstarBLperregion(:) = 0.
+    param_wstarWAKEperregion(:) = 0.
+
+    RETURN
+  END SUBROUTINE phytracr_spl_ini
+
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  SUBROUTINE phytracr_spl (debutphy, lafin, jD_cur, jH_cur, iflag_conv, &  ! I
+          pdtphys, ftsol, &  ! I
+          t_seri, q_seri, paprs, pplay, RHcl, &  ! I
+          pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &  ! I
+          coefh, cdragh, cdragm, yu1, yv1, &  ! I
+          u_seri, v_seri, rlat, rlon, &  ! I
+          pphis, pctsrf, pmflxr, pmflxs, prfl, psfl, &  ! I
+          da, phi, phi2, d1a, dam, mp, ep, sigd, sij, clw, elij, &  ! I
+          epmlmMm, eplaMm, upwd, dnwd, itop_con, ibas_con, &  ! I
+          evapls, wdtrainA, wdtrainM, wght_cvfd, &  ! I
+          fm_therm, entr_therm, rneb, &  ! I
+          beta_fisrt, beta_v1, &  ! I
+          zu10m, zv10m, wstar, ale_bl, ale_wake, &  ! I
+          d_tr_dyn, tr_seri)                                            ! O
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+    USE IOIPSL
+    USE dimphy
+    USE infotrac
+    USE indice_sol_mod
+    USE write_field_phy
+
+    USE mod_phys_lmdz_transfert_para
+    USE lmdz_thermcell_dq, ONLY : thermcell_dq
+    USE phys_cal_mod, only : jD_1jan, year_len, mth_len, days_elapsed, jh_1jan, year_cur, &
+            mth_cur, phys_cal_update
+
+    USE lmdz_yomcst
+
+    IMPLICIT none
+
+    !======================================================================
+    ! Auteur(s) FH
+    ! Objet: Moniteur general des tendances traceurs
+
+    ! Remarques en vrac:
+    ! ------------------
+    ! 1/ le call phytrac se fait avec nqmax-2 donc nous avons bien
+    ! les vrais traceurs (nbtr) dans phytrac (pas la vapeur ni eau liquide)
+    !! AS : nqmax-2 devrait etre nqmax-3 apres introducton de H2Oi ;
+    !!   et c'est encore different avec le parser de DC ?
+    !======================================================================
+    INCLUDE "dimensions.h"
+    INCLUDE "chem.h"
+    INCLUDE "chem_spla.h"
+    INCLUDE "YOETHF.h"
+    INCLUDE "paramet.h"
+    INCLUDE "alpale.h"
+
+    !======================================================================
+
+    ! Arguments:
+
+    !  EN ENTREE:
+    !  ==========
+
+    !  divers:
+    !  -------
+
+    real, intent(in) :: pdtphys  ! pas d'integration pour la physique (seconde)
+    REAL, intent(in) :: jD_cur, jH_cur
+    real, intent(in) :: ftsol(klon, nbsrf)  ! temperature du sol par type
+    real, intent(in) :: t_seri(klon, klev)  ! temperature
+    real, intent(in) :: u_seri(klon, klev)  ! vent
+    real, intent(in) :: v_seri(klon, klev)  ! vent
+    real, intent(in) :: q_seri(klon, klev)  ! vapeur d eau kg/kg
+
+    LOGICAL, INTENT(IN) :: lafin
+
+    real tr_seri(klon, klev, nbtr) ! traceur
+    real tmp_var(klon, klev) ! auxiliary variable to replace traceur
+    real tmp_var2(klon, nbtr) ! auxiliary variable to replace source
+    real tmp_var3(klon, klev, nbtr) ! auxiliary variable 3D
+    real dummy1d ! JE auxiliary variable
+    real aux_var2(klon) ! auxiliary variable to replace traceur
+    real aux_var3(klon, klev) ! auxiliary variable to replace traceur
+    real d_tr(klon, klev, nbtr)    ! traceur  tendance
+    real sconc_seri(klon, nbtr) ! surface concentration of traceur
+
+    integer nbjour
+    save nbjour
+    !$OMP THREADPRIVATE(nbjour)
+
+    INTEGER  masque_aqua_cur(klon)
+    INTEGER  masque_terra_cur(klon)
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_aqua  !mask for 1 day
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: masque_terra !
+    !$OMP THREADPRIVATE(masque_aqua,masque_terra)
+
+    INTEGER, SAVE :: nbreg_dust, nbreg_ind, nbreg_bb, nbreg_ss, nbreg_wstardust
+    !$OMP THREADPRIVATE(nbreg_dust, nbreg_ind, nbreg_bb,nbreg_ss,nbreg_wstardust)
+
+    REAL lmt_dms(klon)           ! emissions de dms
+
+    !JE20150518<<
+    REAL, DIMENSION(klon_glo) :: aod550_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_tr2_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_ss_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dust_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dustsco_terra_glo  ! AOD at terra overpass time ( 10.30 local hour)
+
+    REAL, DIMENSION(klon_glo) :: aod550_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod550_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod670_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_tr2_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_ss_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dust_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    REAL, DIMENSION(klon_glo) :: aod865_dustsco_aqua_glo  ! AOD at aqua overpass time ( 13.30 local hour)
+    !!!!!!!!!!!!!
+    !JE20150518>>
+
+    real, intent(in) :: paprs(klon, klev + 1)  ! pression pour chaque inter-couche (en Pa)
+    real, intent(in) :: pplay(klon, klev)  ! pression pour le mileu de chaque couche (en Pa)
+    real, intent(in) :: RHcl(klon, klev)  ! humidite relativen ciel clair
+    real znivsig(klev)  ! indice des couches
+    real paire(klon)
+    real, intent(in) :: pphis(klon)
+    real, intent(in) :: pctsrf(klon, nbsrf)
+    logical, intent(in) :: debutphy   ! le flag de l'initialisation de la physique
+
+    !  Scaling Parameters:
+    !  ----------------------
+
+    CHARACTER*50 c_Directory
+    CHARACTER*80 c_FileName1
+    CHARACTER*80 c_FileName2
+    CHARACTER*130 c_FullName1
+    CHARACTER*130 c_FullName2
+    INTEGER :: xidx, yidx
+    INTEGER, DIMENSION(klon) :: mask_bbreg
+    INTEGER, DIMENSION(klon) :: mask_ffso2reg
+    INTEGER :: aux_mask1
+    INTEGER :: aux_mask2
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_so4 !Defines regions for SO4 ; AS: PAS UTILISE!
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_ind  !Defines regions for SO2, BC & OM
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_bb   !Defines regions for SO2, BC & OM
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_dust !Defines  dust regions
+    INTEGER, DIMENSION(:), ALLOCATABLE, SAVE :: iregion_wstardust !Defines  dust regions
+    !$OMP THREADPRIVATE(iregion_so4,iregion_ind,iregion_bb,iregion_dust,iregion_wstardust)
+
+    !  Emissions:
+
+    !---------------------------- SEA SALT & DUST emissions ------------------------
+    REAL lmt_sea_salt(klon, ss_bins) !Sea salt 0.03-8.0 um
+    REAL u10m_ec1(klon), v10m_ec1(klon)
+    REAL u10m_ec2(klon), v10m_ec2(klon), dust_ec2(klon)
+    REAL dust_ec(klon)
+    !     new dust emission chimere je20140522
+    REAL, DIMENSION(klon), INTENT(IN) :: zu10m
+    REAL, DIMENSION(klon), INTENT(IN) :: zv10m
+    REAL, DIMENSION(klon), INTENT(IN) :: wstar, ale_bl, ale_wake
+
+    !  Rem : nbtr : nombre de vrais traceurs est defini dans dimphy.h
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !Dynamique
+    !--------
+    REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: d_tr_dyn
+
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !  convection:
+    !  -----------
+
+    REAL, intent(in) :: pmfu(klon, klev)  ! flux de masse dans le panache montant
+    REAL, intent(in) :: pmfd(klon, klev)  ! flux de masse dans le panache descendant
+    REAL, intent(in) :: pen_u(klon, klev) ! flux entraine dans le panache montant
+    REAL, intent(in) :: pde_u(klon, klev) ! flux detraine dans le panache montant
+    REAL, intent(in) :: pen_d(klon, klev) ! flux entraine dans le panache descendant
+    REAL, intent(in) :: pde_d(klon, klev) ! flux detraine dans le panache descendant
+
+    !  Convection KE scheme:
+    !  ---------------------
+
+    !! Variables pour le lessivage convectif
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: da
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi2
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: d1a, dam
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: mp
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd      ! saturated
+    !            updraft mass flux
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: dnwd      ! saturated
+    !            downdraft mass flux
+    INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con
+    INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con
+    REAL, DIMENSION(klon, klev) :: evapls
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainA
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainM
+
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: ep
+    REAL, DIMENSION(klon), INTENT(IN) :: sigd
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: sij
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: clw
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: elij
+    REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: epmlmMm
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: eplaMm
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: wght_cvfd          !RL
+
+
+    !     KE: Tendances de traceurs (Td) et flux de traceurs:
+    !     ------------------------
+    REAL, DIMENSION(klon, klev) :: Mint
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfd1a
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfdam
+    REAL, DIMENSION(klon, klev, nbtr) :: zmfphi2
+
+    !                                                        !tra dans pluie LS a la surf.
+    !      outputs for cvltr_spl
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cv_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_trsp_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sscav_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_sat_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_uscav_o
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_insc_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_bcscav_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_evapls_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_ls_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_dyn_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_cl_o
+    REAL, DIMENSION(:, :, :), ALLOCATABLE, SAVE :: d_tr_th_o
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!
+
+    !$OMP THREADPRIVATE(d_tr_cv_o,d_tr_trsp_o,d_tr_sscav_o,d_tr_sat_o,d_tr_uscav_o)
+    !$OMP THREADPRIVATE(d_tr_insc_o,d_tr_bcscav_o,d_tr_evapls_o,d_tr_ls_o)
+    !$OMP THREADPRIVATE(d_tr_dyn_o,d_tr_cl_o,d_tr_th_o)
+
+    INTEGER :: nsplit
+
+    !  Lessivage
+    !  ---------
+
+    REAL, intent(in) :: pmflxr(klon, klev + 1), pmflxs(klon, klev + 1)   !--convection
+    REAL, intent(in) :: prfl(klon, klev + 1), psfl(klon, klev + 1)     !--large-scale
+    REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
+    REAL :: ql_incloud_ref    ! ref value of in-cloud condensed water content
+
+    REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb    ! fraction nuageuse (grande echelle)
+
+    REAL, DIMENSION(klon, klev) :: beta_fisrt ! taux de conversion
+    !                                                          ! de l'eau cond (de fisrtilp)
+    REAL, DIMENSION(klon, klev) :: beta_v1    ! -- (originale version)
+    INTEGER, SAVE :: iflag_lscav_omp, iflag_lscav
+    !$OMP THREADPRIVATE(iflag_lscav_omp,iflag_lscav)
+
+
+
+
+    !Thermiques:
+    !----------
+    REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: fm_therm
+    REAL, DIMENSION(klon, klev), INTENT(INOUT) :: entr_therm
+
+    !  Couche limite:
+    !  --------------
+
+    REAL, intent(in) :: coefh(klon, klev) ! coeff melange CL
+    REAL, intent(in) :: cdragh(klon), cdragm(klon)
+    REAL, intent(in) :: yu1(klon)        ! vent dans la 1iere couche
+    REAL, intent(in) :: yv1(klon)        ! vent dans la 1iere couche
+
+
+    !----------------------------------------------------------------------
+    REAL his_ds(klon, nbtr)
+    REAL his_dh(klon, nbtr)
+    REAL his_dhlsc(klon, nbtr)        ! in-cloud scavenging lsc
+    REAL his_dhcon(klon, nbtr)       ! in-cloud scavenging con
+    REAL his_dhbclsc(klon, nbtr)      ! below-cloud scavenging lsc
+    REAL his_dhbccon(klon, nbtr)      ! below-cloud scavenging con
+    REAL trm(klon, nbtr)
+
+    REAL u10m_ec(klon), v10m_ec(klon)
+
+    REAL his_th(klon, nbtr)
+    REAL his_dhkecv(klon, nbtr)
+    REAL his_dhkelsc(klon, nbtr)
+
+    !  Coordonnees
+    !  -----------
+
+    REAL, intent(in) :: rlat(klon)       ! latitudes pour chaque point
+    REAL, intent(in) :: rlon(klon)       ! longitudes pour chaque point
+
+    INTEGER i, k, iq, itr, j, ig
+
+    ! DEFINITION OF DIAGNOSTIC VARIABLES
+
+    REAL diag_trm(nbtr), diag_drydep(nbtr)
+    REAL diag_wetdep(nbtr), diag_cvtdep(nbtr)
+    REAL diag_emissn(nbtr), diag_g2part
+    REAL diag_sedimt
+    REAL trm_aux(nbtr), src_aux(nbtr)
+
+    ! Variables locales pour effectuer les appels en serie
+    !----------------------------------------------------
+    REAL source_tr(klon, nbtr)
+    REAL flux_tr(klon, nbtr)
+    REAL m_conc(klon, klev)
+    REAL henry(nbtr)  !--cste de Henry  mol/l/atm
+    REAL kk(nbtr)     !--coefficient de var avec T (K)
+    REAL alpha_r(nbtr)!--coefficient d'impaction pour la pluie
+    REAL alpha_s(nbtr)!--coefficient d'impaction pour la neige
+    REAL vdep_oce(nbtr), vdep_sic(nbtr)
+    REAL vdep_ter(nbtr), vdep_lic(nbtr)
+    REAL ccntrAA_spla(nbtr)
+    REAL ccntrENV_spla(nbtr)
+    REAL coefcoli_spla(nbtr)
+    REAL dtrconv(klon, nbtr)
+    REAL zrho(klon, klev), zdz(klon, klev)
+    REAL zalt(klon, klev)
+    REAL, DIMENSION(klon, klev) :: zmasse    ! densité atmosphérique
+    !     .                                              Kg/m2
+    REAL, DIMENSION(klon, klev) :: ztra_th
+    REAL qmin, qmax, aux
+    !      PARAMETER (qmin=0.0, qmax=1.e33)
+    PARAMETER (qmin = 1.e33, qmax = -1.e33)
+
+    ! Variables to save data into file
+    !----------------------------------
+
+    CHARACTER*2 str2
+    !!AS:      LOGICAL ok_histrac
+    !!!JE2014124      PARAMETER (ok_histrac=.true.)
+    !!      PARAMETER (ok_histrac=.false.)
+    INTEGER ndex2d(iim * (jjm + 1)), ndex3d(iim * (jjm + 1) * klev)
+    INTEGER nhori1, nhori2, nhori3, nhori4, nhori5, nvert
+    INTEGER nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
+    SAVE nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5
+    !$OMP THREADPRIVATE(nid_tra1, nid_tra2, nid_tra3, nid_tra4, nid_tra5)
+    INTEGER itra
+    SAVE itra                    ! compteur pour la physique
+    !$OMP THREADPRIVATE(itra)
+    INTEGER ecrit_tra, ecrit_tra_h, ecrit_tra_m
+    SAVE ecrit_tra, ecrit_tra_h, ecrit_tra_m
+    !$OMP THREADPRIVATE(ecrit_tra, ecrit_tra_h, ecrit_tra_m)
+    REAL presnivs(klev) ! pressions approximat. des milieux couches ( en PA)
+    REAL zx_tmp_2d(iim, jjm + 1), zx_tmp_3d(iim, jjm + 1, klev)
+    REAL zx_tmp_fi2d(klon), zx_tmp_fi3d(klon, klev)
+    REAL zx_lon_glo(nbp_lon, nbp_lat), zx_lat_glo(nbp_lon, nbp_lat)
+    REAL zsto, zout, zout_h, zout_m, zjulian
+
+    !------Molar Masses
+    REAL masse(nbtr)
+
+    REAL fracso2emis                              !--fraction so2 emis en so2
+    PARAMETER (fracso2emis = 0.95)
+    REAL frach2sofso2                             !--fraction h2s from so2
+    PARAMETER (frach2sofso2 = 0.0426)
+
+    !  Controles
+    !-------------
+    LOGICAL convection, lessivage, lminmax, lcheckmass
+    DATA convection, lessivage, lminmax, lcheckmass &
+            /.true., .true., .true., .false./
+
+    REAL xconv(nbtr)
+
+    LOGICAL anthropo, bateau, edgar
+    DATA anthropo, bateau, edgar/.true., .true., .true./
+
+    !c bc_source
+    INTEGER kminbc, kmaxbc
+    !JE20150715      PARAMETER (kminbc=3, kmaxbc=5)
+    PARAMETER (kminbc = 4, kmaxbc = 7)
+
+    REAL tr1_cont, tr2_cont, tr3_cont, tr4_cont
+
+    ! JE for updating in  cltrac
+    REAL, DIMENSION(klon, klev) :: delp     ! epaisseur de couche (Pa)
+    !! JE for include gas to particle conversion in output
+    !      REAL his_g2pgas(klon)      ! gastoparticle in gas units (check!)
+    !      REAL his_g2paer(klon)      ! gastoparticle in aerosol units (check!)
+
+    INTEGER, intent(in) :: iflag_conv
+    LOGICAL iscm3  ! debug variable. for checkmass ! JE
+
+    !------------------------------------------------------------------------
+    !  only to compute time consumption of each process
+    !----
+    INTEGER clock_start, clock_end, clock_rate, clock_start_spla
+    INTEGER clock_end_outphytracr, clock_start_outphytracr
+    INTEGER ti_init, dife, ti_inittype, ti_inittwrite
+    INTEGER ti_spla, ti_emis, ti_depo, ti_cltr, ti_ther
+    INTEGER ti_sedi, ti_gasp, ti_wetap, ti_cvltr, ti_lscs, ti_brop, ti_outs
+    INTEGER ti_nophytracr, clock_per_max
+    REAL tia_init, tia_inittype, tia_inittwrite
+    REAL tia_spla, tia_emis, tia_depo, tia_cltr, tia_ther
+    REAL tia_sedi, tia_gasp, tia_wetap, tia_cvltr, tia_lscs
+    REAL tia_brop, tia_outs
+    REAL tia_nophytracr
+
+    SAVE tia_init, tia_inittype, tia_inittwrite
+    SAVE tia_spla, tia_emis, tia_depo, tia_cltr, tia_ther
+    SAVE tia_sedi, tia_gasp, tia_wetap, tia_cvltr, tia_lscs
+    SAVE tia_brop, tia_outs
+    SAVE ti_nophytracr
+    SAVE tia_nophytracr
+    SAVE clock_end_outphytracr, clock_start_outphytracr
+    SAVE clock_per_max
+    LOGICAL logitime
+    !$OMP THREADPRIVATE(tia_init,tia_inittype,tia_inittwrite)
+    !$OMP THREADPRIVATE(tia_spla,tia_emis,tia_depo,tia_cltr,tia_ther)
+    !$OMP THREADPRIVATE(tia_sedi,tia_gasp,tia_wetap,tia_cvltr,tia_lscs)
+    !$OMP THREADPRIVATE(tia_brop,tia_outs)
+    !$OMP THREADPRIVATE(ti_nophytracr)
+    !$OMP THREADPRIVATE(tia_nophytracr)
+    !$OMP THREADPRIVATE(clock_end_outphytracr,clock_start_outphytracr)
+    !$OMP THREADPRIVATE(clock_per_max)
+
+    !     utils parallelization
+    REAL :: auxklon_glo(klon_glo)
+    INTEGER :: iauxklon_glo(klon_glo)
+    REAL, DIMENSION(klon_glo, nbp_lev) :: auxklonnbp_lev
+    REAL, DIMENSION(klon_glo, nbp_lev, nbtr) :: auxklonklevnbtr_glo
+    REAL, DIMENSION(nbp_lon, nbp_lat) :: zx_tmp_2d_glo
+    REAL, DIMENSION(nbp_lon, nbp_lat, nbp_lev) :: zx_tmp_3d_glo
+    REAL, DIMENSION(klon_glo) :: zx_tmp_fi2d_glo
+    REAL, DIMENSION(klon_glo, nbp_lev) :: zx_tmp_fi3d_glo
+    REAL, DIMENSION(klon_glo, nbtr) :: auxklonnbtr_glo
+
+    source_tr = 0.
+
+    if (debutphy) then
 #ifdef IOPHYS_DUST
          CALL iophys_ini(pdtphys)
 #endif
-         nbreg_ind=1
-         nbreg_bb=1
-         nbreg_dust=1
-         nbreg_wstardust=1
-         CALL phytracr_spl_ini(klon,nbreg_ind,nbreg_bb,nbreg_dust,nbreg_wstardust)
-      endif
+      nbreg_ind = 1
+      nbreg_bb = 1
+      nbreg_dust = 1
+      nbreg_wstardust = 1
+      CALL phytracr_spl_ini(klon, nbreg_ind, nbreg_bb, nbreg_dust, nbreg_wstardust)
+    endif
 
 
@@ -1271,862 +1235,834 @@
 #endif
 
-  
-
-
-  ijulday=jD_cur-jD_1jan+1
-  nbjour = 1
-
-  paramname_ind='ind'
-  paramname_bb='bb'
-  paramname_ff='ind'
-  paramname_dustacc='dustacc'
-  paramname_dustcoa='dustcoasco'
-  paramname_dustsco='dustcoasco'
-!  paramname_dustacc='dust'
-!  paramname_dustcoa='dust'
-!  paramname_dustsco='dust'
-  paramname_wstarBL='pwstarbl'
-  paramname_wstarWAKE='pwstarwake'
-  paramname_ssacc='ssacc'
-  paramname_sscoa='sscoa'
-
-  filescaleparams='modvalues.nc'
-!AS: debranchage de lecture des coefs d'assmilation de Jeronimo Escribano
-  IF("ASSIM"=="YES") THEN
-    CALL readscaleparamsnc_spl(scale_param_ind,                        &
-        nbreg_ind, paramname_ind,                                    &
-        scale_param_ff, nbreg_ind,paramname_ff,                      &
-        scale_param_bb, nbreg_bb,paramname_bb,                       &
-        scale_param_dustacc, nbreg_dust,paramname_dustacc,           &
-        scale_param_dustcoa, nbreg_dust,paramname_dustcoa,           &
-        scale_param_dustsco, nbreg_dust,paramname_dustsco,           &
-        param_wstarBLperregion, nbreg_wstardust, paramname_wstarBL, &
-        param_wstarWAKEperregion, nbreg_wstardust, paramname_wstarWAKE, &
-        scale_param_ssacc  ,  paramname_ssacc,                    &
-        scale_param_sscoa  ,  paramname_sscoa,                    &
-           filescaleparams,ijulday,jH_cur, pdtphys,debutphy)
-  ENDIF ! ASSIM
-!AS: le commentaire suivant "add seasalt" ne semble pas avoir ete mis en pratique.
-! Des fichiers regions_ssacc et _sscoa existent mais ne semblent pas lus.
-! Ca reste donc aux valeurs initialisées: nbreg_ss=1, scale_param_ss*=1, cf fichiers ss et modvalues
-!! add seasalt
-
-  print *,'JE : check scale_params'
-
-  print *, 'nbreg_ind', nbreg_ind   
-  print *, 'nbreg_dust', nbreg_dust  
-  print *, 'nbreg_bb', nbreg_bb   
-  print *, 'ind', scale_param_ind   
-  print *, 'dustacc', scale_param_dustacc  
-  print *, 'dustcoa', scale_param_dustcoa  
-  print *, 'dustsco', scale_param_dustsco
-  print *, 'wstardustBL', param_wstarBLperregion
-  print *, 'wstardustWAKE', param_wstarWAKEperregion
-  print *, 'ff', scale_param_ff  
-  print *, 'bb', scale_param_bb  
-  print *, 'ssacc', scale_param_ssacc
-  print *, 'sscoa', scale_param_sscoa
-
-  print *,'JE: before read_newemissions '
-  print *,'JE: jD_cur:',jD_cur,' ijulday:',ijulday,' jH_cur:',jH_cur,' pdtphys:',pdtphys
-  print *,'JE: now read_newemissions:'
-!AS: La ligne suivante fait planter a l'execution : lmt_so2ff_l pas initialise
-!  print *,'lmt_so2ff_l AVANT' , MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
-  call read_newemissions(ijulday,jH_cur ,edgar, flag_dms,debutphy, & !I
-                         pdtphys, lafin, nbjour, pctsrf,  &       !I
-                         t_seri, rlat, rlon, &                         !I
-                         pmflxr, pmflxs, prfl, psfl, &            !I
-                                 u10m_ec, v10m_ec, dust_ec, &     !O
-                                 lmt_sea_salt, lmt_so2ff_l, &     !O
-                                 lmt_so2ff_h, lmt_so2nff, &       !O
-                                 lmt_so2ba, lmt_so2bb_l, lmt_so2bb_h, &  !O
-                                 lmt_so2volc_cont, lmt_altvolc_cont, &   !O
-                                 lmt_so2volc_expl, lmt_altvolc_expl, &   !O
-                                 lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &  !O
-                                 lmt_bcff, lmt_bcnff, lmt_bcbb_l, &      !O
-                                 lmt_bcbb_h, lmt_bcba, lmt_omff, &       !O
-                                 lmt_omnff, lmt_ombb_l, lmt_ombb_h, &    !O
-                                 lmt_omnat, lmt_omba)                    !O
-
-
-  print *,'Check emissions'
-  print *,'lmt_so2ff_l' , MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
-  print *,'lmt_so2ff_h' , MINVAL(lmt_so2ff_h), MAXVAL(lmt_so2ff_h)
-  print *,'lmt_so2nff' , MINVAL(lmt_so2nff), MAXVAL(lmt_so2nff)
-  print *,'lmt_so2ba' , MINVAL(lmt_so2ba), MAXVAL(lmt_so2ba)
-  print *,'lmt_so2bb_l' , MINVAL(lmt_so2bb_l), MAXVAL(lmt_so2bb_l)
-  print *,'lmt_so2bb_h' , MINVAL(lmt_so2bb_h), MAXVAL(lmt_so2bb_h)
-  print *,'lmt_so2volc_cont' , MINVAL(lmt_so2volc_cont), MAXVAL(lmt_so2volc_cont)
-  print *,'lmt_altvolc_cont' , MINVAL(lmt_altvolc_cont), MAXVAL(lmt_altvolc_cont)
-  print *,'lmt_so2volc_expl' , MINVAL(lmt_so2volc_expl), MAXVAL(lmt_so2volc_expl)
-  print *,'lmt_altvolc_expl' , MINVAL(lmt_altvolc_expl), MAXVAL(lmt_altvolc_expl)
-  print *,'lmt_dmsbio' , MINVAL(lmt_dmsbio), MAXVAL(lmt_dmsbio)
-  print *,'lmt_h2sbio' , MINVAL(lmt_h2sbio), MAXVAL(lmt_h2sbio)
-  print *,'lmt_dmsconc' , MINVAL(lmt_dmsconc), MAXVAL(lmt_dmsconc)
-  print *,'lmt_bcff' , MINVAL(lmt_bcff), MAXVAL(lmt_bcff)
-  print *,'lmt_bcnff' , MINVAL(lmt_bcnff), MAXVAL(lmt_bcnff)
-  print *,'lmt_bcbb_l' , MINVAL(lmt_bcbb_l), MAXVAL(lmt_bcbb_l)
-  print *,'lmt_bcbb_h' , MINVAL(lmt_bcbb_h), MAXVAL(lmt_bcbb_h)
-  print *,'lmt_bcba' , MINVAL(lmt_bcba), MAXVAL(lmt_bcba)
-  print *,'lmt_omff' , MINVAL(lmt_omff), MAXVAL(lmt_omff)
-  print *,'lmt_omnff' , MINVAL(lmt_omnff), MAXVAL(lmt_omnff)
-  print *,'lmt_ombb_l' , MINVAL(lmt_ombb_l), MAXVAL(lmt_ombb_l)
-  print *,'lmt_ombb_h' , MINVAL(lmt_ombb_h), MAXVAL(lmt_ombb_h)
-  print *,'lmt_omnat' , MINVAL(lmt_omnat), MAXVAL(lmt_omnat)
-  print *,'lmt_omba' , MINVAL(lmt_omba), MAXVAL(lmt_omba)
-  print *,'JE iflag_con',iflag_conv
-
-
-!JE_dbg
-   do i=1,klon
-      tsol(i)=0.0
-      do j=1,nbsrf
-          tsol(i)=tsol(i)+ftsol(i,j)*pctsrf(i,j)
+
+
+
+    ijulday = jD_cur - jD_1jan + 1
+    nbjour = 1
+
+    paramname_ind = 'ind'
+    paramname_bb = 'bb'
+    paramname_ff = 'ind'
+    paramname_dustacc = 'dustacc'
+    paramname_dustcoa = 'dustcoasco'
+    paramname_dustsco = 'dustcoasco'
+    !  paramname_dustacc='dust'
+    !  paramname_dustcoa='dust'
+    !  paramname_dustsco='dust'
+    paramname_wstarBL = 'pwstarbl'
+    paramname_wstarWAKE = 'pwstarwake'
+    paramname_ssacc = 'ssacc'
+    paramname_sscoa = 'sscoa'
+
+    filescaleparams = 'modvalues.nc'
+    !AS: debranchage de lecture des coefs d'assmilation de Jeronimo Escribano
+    IF("ASSIM"=="YES") THEN
+      CALL readscaleparamsnc_spl(scale_param_ind, &
+              nbreg_ind, paramname_ind, &
+              scale_param_ff, nbreg_ind, paramname_ff, &
+              scale_param_bb, nbreg_bb, paramname_bb, &
+              scale_param_dustacc, nbreg_dust, paramname_dustacc, &
+              scale_param_dustcoa, nbreg_dust, paramname_dustcoa, &
+              scale_param_dustsco, nbreg_dust, paramname_dustsco, &
+              param_wstarBLperregion, nbreg_wstardust, paramname_wstarBL, &
+              param_wstarWAKEperregion, nbreg_wstardust, paramname_wstarWAKE, &
+              scale_param_ssacc, paramname_ssacc, &
+              scale_param_sscoa, paramname_sscoa, &
+              filescaleparams, ijulday, jH_cur, pdtphys, debutphy)
+    ENDIF ! ASSIM
+    !AS: le commentaire suivant "add seasalt" ne semble pas avoir ete mis en pratique.
+    ! Des fichiers regions_ssacc et _sscoa existent mais ne semblent pas lus.
+    ! Ca reste donc aux valeurs initialisées: nbreg_ss=1, scale_param_ss*=1, cf fichiers ss et modvalues
+    !! add seasalt
+
+    print *, 'JE : check scale_params'
+
+    print *, 'nbreg_ind', nbreg_ind
+    print *, 'nbreg_dust', nbreg_dust
+    print *, 'nbreg_bb', nbreg_bb
+    print *, 'ind', scale_param_ind
+    print *, 'dustacc', scale_param_dustacc
+    print *, 'dustcoa', scale_param_dustcoa
+    print *, 'dustsco', scale_param_dustsco
+    print *, 'wstardustBL', param_wstarBLperregion
+    print *, 'wstardustWAKE', param_wstarWAKEperregion
+    print *, 'ff', scale_param_ff
+    print *, 'bb', scale_param_bb
+    print *, 'ssacc', scale_param_ssacc
+    print *, 'sscoa', scale_param_sscoa
+
+    print *, 'JE: before read_newemissions '
+    print *, 'JE: jD_cur:', jD_cur, ' ijulday:', ijulday, ' jH_cur:', jH_cur, ' pdtphys:', pdtphys
+    print *, 'JE: now read_newemissions:'
+    !AS: La ligne suivante fait planter a l'execution : lmt_so2ff_l pas initialise
+    !  print *,'lmt_so2ff_l AVANT' , MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
+    call read_newemissions(ijulday, jH_cur, edgar, flag_dms, debutphy, & !I
+            pdtphys, lafin, nbjour, pctsrf, &       !I
+            t_seri, rlat, rlon, &                         !I
+            pmflxr, pmflxs, prfl, psfl, &            !I
+            u10m_ec, v10m_ec, dust_ec, &     !O
+            lmt_sea_salt, lmt_so2ff_l, &     !O
+            lmt_so2ff_h, lmt_so2nff, &       !O
+            lmt_so2ba, lmt_so2bb_l, lmt_so2bb_h, &  !O
+            lmt_so2volc_cont, lmt_altvolc_cont, &   !O
+            lmt_so2volc_expl, lmt_altvolc_expl, &   !O
+            lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, &  !O
+            lmt_bcff, lmt_bcnff, lmt_bcbb_l, &      !O
+            lmt_bcbb_h, lmt_bcba, lmt_omff, &       !O
+            lmt_omnff, lmt_ombb_l, lmt_ombb_h, &    !O
+            lmt_omnat, lmt_omba)                    !O
+
+    print *, 'Check emissions'
+    print *, 'lmt_so2ff_l', MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
+    print *, 'lmt_so2ff_h', MINVAL(lmt_so2ff_h), MAXVAL(lmt_so2ff_h)
+    print *, 'lmt_so2nff', MINVAL(lmt_so2nff), MAXVAL(lmt_so2nff)
+    print *, 'lmt_so2ba', MINVAL(lmt_so2ba), MAXVAL(lmt_so2ba)
+    print *, 'lmt_so2bb_l', MINVAL(lmt_so2bb_l), MAXVAL(lmt_so2bb_l)
+    print *, 'lmt_so2bb_h', MINVAL(lmt_so2bb_h), MAXVAL(lmt_so2bb_h)
+    print *, 'lmt_so2volc_cont', MINVAL(lmt_so2volc_cont), MAXVAL(lmt_so2volc_cont)
+    print *, 'lmt_altvolc_cont', MINVAL(lmt_altvolc_cont), MAXVAL(lmt_altvolc_cont)
+    print *, 'lmt_so2volc_expl', MINVAL(lmt_so2volc_expl), MAXVAL(lmt_so2volc_expl)
+    print *, 'lmt_altvolc_expl', MINVAL(lmt_altvolc_expl), MAXVAL(lmt_altvolc_expl)
+    print *, 'lmt_dmsbio', MINVAL(lmt_dmsbio), MAXVAL(lmt_dmsbio)
+    print *, 'lmt_h2sbio', MINVAL(lmt_h2sbio), MAXVAL(lmt_h2sbio)
+    print *, 'lmt_dmsconc', MINVAL(lmt_dmsconc), MAXVAL(lmt_dmsconc)
+    print *, 'lmt_bcff', MINVAL(lmt_bcff), MAXVAL(lmt_bcff)
+    print *, 'lmt_bcnff', MINVAL(lmt_bcnff), MAXVAL(lmt_bcnff)
+    print *, 'lmt_bcbb_l', MINVAL(lmt_bcbb_l), MAXVAL(lmt_bcbb_l)
+    print *, 'lmt_bcbb_h', MINVAL(lmt_bcbb_h), MAXVAL(lmt_bcbb_h)
+    print *, 'lmt_bcba', MINVAL(lmt_bcba), MAXVAL(lmt_bcba)
+    print *, 'lmt_omff', MINVAL(lmt_omff), MAXVAL(lmt_omff)
+    print *, 'lmt_omnff', MINVAL(lmt_omnff), MAXVAL(lmt_omnff)
+    print *, 'lmt_ombb_l', MINVAL(lmt_ombb_l), MAXVAL(lmt_ombb_l)
+    print *, 'lmt_ombb_h', MINVAL(lmt_ombb_h), MAXVAL(lmt_ombb_h)
+    print *, 'lmt_omnat', MINVAL(lmt_omnat), MAXVAL(lmt_omnat)
+    print *, 'lmt_omba', MINVAL(lmt_omba), MAXVAL(lmt_omba)
+    print *, 'JE iflag_con', iflag_conv
+
+
+    !JE_dbg
+    do i = 1, klon
+      tsol(i) = 0.0
+      do j = 1, nbsrf
+        tsol(i) = tsol(i) + ftsol(i, j) * pctsrf(i, j)
       enddo
-   enddo
-
-
-!======================================================================
-!  INITIALISATIONS
-!======================================================================
-!             CALL checknanqfi(da(:,:),1.,-1.,' da_ before
-!     . phytracr_inphytracr')
-
-!
-! computing time
-!        logitime=.true.
-        logitime=.false.
-        IF (logitime) THEN
-        clock_start=0
-        clock_end=0
-        clock_rate=0
-       CALL SYSTEM_CLOCK(COUNT_RATE=clock_rate,COUNT_MAX=clock_per_max)
-        CALL SYSTEM_CLOCK(COUNT=clock_start_spla)
-        clock_start=clock_start_spla
-        clock_end_outphytracr=clock_start_spla
-        ENDIF
-
-
-! Definition of tracers index.
-      print*,'OK ON PASSSE BIEN LA'
-      CALL minmaxsource(source_tr,qmin,qmax,'A1 maxsource init phytracr')
-
-
-      IF (debutphy) THEN
-        id_prec=-1
-        id_fine=-1
-        id_coss=-1
-        id_codu=-1
-        id_scdu=-1
-        itr = 0
-        do iq=1,nqtot
-          IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-          itr = itr+1
-          print *, itr, TRIM(tracers(iq)%name)
-          SELECT CASE(tracers(iq)%name)
-            CASE('PREC'); id_prec=itr
-            CASE('FINE'); id_fine=itr
-            CASE('COSS'); id_coss=itr
-            CASE('CODU'); id_codu=itr
-            CASE('SCDU'); id_scdu=itr
-          END SELECT
-        enddo
-        ! check consistency with dust emission scheme:
-        if (ok_chimeredust) then
-          if (.not.( id_scdu>0 .and. id_codu>0 .and. id_fine>0)) then
-             call abort_gcm('phytracr_mod', 'pb in ok_chimdust 0',1)
-          endif
-        else 
-          if (id_scdu>0) then 
-       call abort_gcm('phytracr_mod', 'pb in ok_chimdust 1 SCDU',1)
-          endif
-          if ( (id_codu <= 0) .or. ( id_fine<=0)  ) then
-          call abort_gcm('phytracr_mod', 'pb in ok_chimdust 1',1) 
-          endif
-       endif
-
-
-       !print *,id_prec,id_fine,id_coss,id_codu,id_scdu
-       ENDIF
-
-
-
-
-
-
-!---fraction of tracer that is convected (Tiedke)
-      xconv(:)=0.
-      if(id_prec>0)  xconv(id_prec)=0.8
-      if(id_fine>0)  xconv(id_fine)=0.5
-      if(id_coss>0)  xconv(id_coss)=0.5
-      if(id_codu>0)  xconv(id_codu)=0.6
-      if(id_scdu>0)  xconv(id_scdu)=0.6  !!JE fix
-
-      masse(:)=1.
-      if(id_prec>0)  masse(id_prec)=32.
-      if(id_fine>0)  masse(id_fine)=6.02e23
-      if(id_coss>0)  masse(id_coss)=6.02e23
-      if(id_codu>0)  masse(id_codu)=6.02e23 
-      if(id_scdu>0)  masse(id_scdu)=6.02e23 
-
-      henry(:)=0.
-      if(id_prec>0)  henry(id_prec)=1.4
-      if(id_fine>0)  henry(id_fine)=0.0
-      if(id_coss>0)  henry(id_coss)=0.0
-      if(id_codu>0)  henry(id_codu)=0.0
-      if(id_scdu>0)  henry(id_scdu)=0.0
-      !henry= (/1.4, 0.0, 0.0, 0.0/)
-      kk(:)=0.
-      if(id_prec>0)  kk(id_prec)=2900.
-      if(id_fine>0)  kk(id_fine)=0.0
-      if(id_coss>0)  kk(id_coss)=0.0
-      if(id_codu>0)  kk(id_codu)=0.0
-      if(id_scdu>0)  kk(id_scdu)=0.0
-      !kk = (/2900., 0., 0., 0./)
-      alpha_r(:)=0.
-      if(id_prec>0)  alpha_r(id_prec)=0.0
-      if(id_fine>0)  alpha_r(id_fine)=0.001
-      if(id_coss>0)  alpha_r(id_coss)=0.001
-      if(id_codu>0)  alpha_r(id_codu)=0.001
-      if(id_scdu>0)  alpha_r(id_scdu)=0.001  !JE fix
-      alpha_s(:)=0.
-      if(id_prec>0)  alpha_s(id_prec)=0.0
-      if(id_fine>0)  alpha_s(id_fine)=0.01
-      if(id_coss>0)  alpha_s(id_coss)=0.01
-      if(id_codu>0)  alpha_s(id_codu)=0.01
-      if(id_scdu>0)  alpha_s(id_scdu)=0.01  !JE fix
-
-!      alpha_r =  (/0., 0.001, 0.001, 0.001/)
-!      alpha_s = (/0., 0.01, 0.01, 0.01/)
-
-! nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
-! nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
-      !vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
-      vdep_oce(:)=0.
-      if(id_prec>0)  vdep_oce(id_prec) = 0.28
-      if(id_fine>0)  vdep_oce(id_fine) = 0.28
-      if(id_coss>0)  vdep_oce(id_coss) = 1.2
-      if(id_codu>0)  vdep_oce(id_codu) = 1.2
-      if(id_scdu>0)  vdep_oce(id_scdu) = 1.2
-      vdep_sic(:)=0.
-      if(id_prec>0)  vdep_sic(id_prec) = 0.2
-      if(id_fine>0)  vdep_sic(id_fine) = 0.17
-      if(id_coss>0)  vdep_sic(id_coss) = 1.2
-      if(id_codu>0)  vdep_sic(id_codu) = 1.2
-      if(id_scdu>0)  vdep_sic(id_scdu) = 1.2
-
-      !vdep_sic = (/0.2, 0.17, 1.2, 1.2/)     
-      !vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
-      vdep_ter(:)=0.
-      if(id_prec>0)  vdep_ter(id_prec) = 0.3
-      if(id_fine>0)  vdep_ter(id_fine) = 0.14
-      if(id_coss>0)  vdep_ter(id_coss) = 1.2
-      if(id_codu>0)  vdep_ter(id_codu) = 1.2
-      if(id_scdu>0)  vdep_ter(id_scdu) = 1.2
-
-      vdep_lic(:)=0.
-      if(id_prec>0)  vdep_lic(id_prec) = 0.2
-      if(id_fine>0)  vdep_lic(id_fine) = 0.17
-      if(id_coss>0)  vdep_lic(id_coss) = 1.2
-      if(id_codu>0)  vdep_lic(id_codu) = 1.2
-      if(id_scdu>0)  vdep_lic(id_scdu) = 1.2
-
-
-      ! convective KE lessivage aer params:
-      ! AS: #DFB (Binta) a aussi teste ccntrAA_spla=ccntrENV_spla=0.9/1.0/0.9/0.9
-      !     mais effet negligeable sur l'AOD
-      ccntrAA_spla(:)=0.
-      if(id_prec>0)  ccntrAA_spla(id_prec)=-9999.
-      if(id_fine>0)  ccntrAA_spla(id_fine)=0.7
-      if(id_coss>0)  ccntrAA_spla(id_coss)=1.0
-      if(id_codu>0)  ccntrAA_spla(id_codu)=0.7
-      if(id_scdu>0)  ccntrAA_spla(id_scdu)=0.7
-
-      ccntrENV_spla(:)=0.
-      if(id_prec>0)  ccntrENV_spla(id_prec)=-9999.
-      if(id_fine>0)  ccntrENV_spla(id_fine)=0.7
-      if(id_coss>0)  ccntrENV_spla(id_coss)=1.0
-      if(id_codu>0)  ccntrENV_spla(id_codu)=0.7
-      if(id_scdu>0)  ccntrENV_spla(id_scdu)=0.7
-      ! #DFB
-      coefcoli_spla(:)=0.
-      if(id_prec>0)  coefcoli_spla(id_prec)=-9999.
-      if(id_fine>0)  coefcoli_spla(id_fine)=0.001
-      if(id_coss>0)  coefcoli_spla(id_coss)=0.001
-      if(id_codu>0)  coefcoli_spla(id_codu)=0.001
-      if(id_scdu>0)  coefcoli_spla(id_scdu)=0.001
-
-      !vdep_lic = (/0.2, 0.17, 1.2, 1.2/)      
-!
-
-      iscm3=.false.
-      if (debutphy) then
-!$OMP MASTER
-         CALL suphel
-         print *, 'let s check nbtr=', nbtr
-! JE before put in zero
+    enddo
+
+
+    !======================================================================
+    !  INITIALISATIONS
+    !======================================================================
+    !             CALL checknanqfi(da(:,:),1.,-1.,' da_ before
+    !     . phytracr_inphytracr')
+
+    ! computing time
+    !        logitime=.true.
+    logitime = .false.
+    IF (logitime) THEN
+      clock_start = 0
+      clock_end = 0
+      clock_rate = 0
+      CALL SYSTEM_CLOCK(COUNT_RATE = clock_rate, COUNT_MAX = clock_per_max)
+      CALL SYSTEM_CLOCK(COUNT = clock_start_spla)
+      clock_start = clock_start_spla
+      clock_end_outphytracr = clock_start_spla
+    ENDIF
+
+
+    ! Definition of tracers index.
+    print*, 'OK ON PASSSE BIEN LA'
+    CALL minmaxsource(source_tr, qmin, qmax, 'A1 maxsource init phytracr')
+
+    IF (debutphy) THEN
+      id_prec = -1
+      id_fine = -1
+      id_coss = -1
+      id_codu = -1
+      id_scdu = -1
+      itr = 0
+      do iq = 1, nqtot
+        IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+        itr = itr + 1
+        print *, itr, TRIM(tracers(iq)%name)
+        SELECT CASE(tracers(iq)%name)
+        CASE('PREC'); id_prec = itr
+        CASE('FINE'); id_fine = itr
+        CASE('COSS'); id_coss = itr
+        CASE('CODU'); id_codu = itr
+        CASE('SCDU'); id_scdu = itr
+        END SELECT
+      enddo
+      ! check consistency with dust emission scheme:
+      if (ok_chimeredust) then
+        if (.not.(id_scdu>0 .and. id_codu>0 .and. id_fine>0)) then
+          call abort_gcm('phytracr_mod', 'pb in ok_chimdust 0', 1)
+        endif
+      else
+        if (id_scdu>0) then
+          call abort_gcm('phytracr_mod', 'pb in ok_chimdust 1 SCDU', 1)
+        endif
+        if ((id_codu <= 0) .or. (id_fine<=0)) then
+          call abort_gcm('phytracr_mod', 'pb in ok_chimdust 1', 1)
+        endif
+      endif
+
+
+      !print *,id_prec,id_fine,id_coss,id_codu,id_scdu
+    ENDIF
+
+
+
+
+
+
+    !---fraction of tracer that is convected (Tiedke)
+    xconv(:) = 0.
+    if(id_prec>0)  xconv(id_prec) = 0.8
+    if(id_fine>0)  xconv(id_fine) = 0.5
+    if(id_coss>0)  xconv(id_coss) = 0.5
+    if(id_codu>0)  xconv(id_codu) = 0.6
+    if(id_scdu>0)  xconv(id_scdu) = 0.6  !!JE fix
+
+    masse(:) = 1.
+    if(id_prec>0)  masse(id_prec) = 32.
+    if(id_fine>0)  masse(id_fine) = 6.02e23
+    if(id_coss>0)  masse(id_coss) = 6.02e23
+    if(id_codu>0)  masse(id_codu) = 6.02e23
+    if(id_scdu>0)  masse(id_scdu) = 6.02e23
+
+    henry(:) = 0.
+    if(id_prec>0)  henry(id_prec) = 1.4
+    if(id_fine>0)  henry(id_fine) = 0.0
+    if(id_coss>0)  henry(id_coss) = 0.0
+    if(id_codu>0)  henry(id_codu) = 0.0
+    if(id_scdu>0)  henry(id_scdu) = 0.0
+    !henry= (/1.4, 0.0, 0.0, 0.0/)
+    kk(:) = 0.
+    if(id_prec>0)  kk(id_prec) = 2900.
+    if(id_fine>0)  kk(id_fine) = 0.0
+    if(id_coss>0)  kk(id_coss) = 0.0
+    if(id_codu>0)  kk(id_codu) = 0.0
+    if(id_scdu>0)  kk(id_scdu) = 0.0
+    !kk = (/2900., 0., 0., 0./)
+    alpha_r(:) = 0.
+    if(id_prec>0)  alpha_r(id_prec) = 0.0
+    if(id_fine>0)  alpha_r(id_fine) = 0.001
+    if(id_coss>0)  alpha_r(id_coss) = 0.001
+    if(id_codu>0)  alpha_r(id_codu) = 0.001
+    if(id_scdu>0)  alpha_r(id_scdu) = 0.001  !JE fix
+    alpha_s(:) = 0.
+    if(id_prec>0)  alpha_s(id_prec) = 0.0
+    if(id_fine>0)  alpha_s(id_fine) = 0.01
+    if(id_coss>0)  alpha_s(id_coss) = 0.01
+    if(id_codu>0)  alpha_s(id_codu) = 0.01
+    if(id_scdu>0)  alpha_s(id_scdu) = 0.01  !JE fix
+
+    !      alpha_r =  (/0., 0.001, 0.001, 0.001/)
+    !      alpha_s = (/0., 0.01, 0.01, 0.01/)
+
+    ! nhl      DATA vdep_oce /0.7, 0.05, 1.2, 1.2/
+    ! nhl vdep_oce for tr1 is a weighted average of dms and so2 dep velocities
+    !vdep_oce = (/0.28, 0.28, 1.2, 1.2/)
+    vdep_oce(:) = 0.
+    if(id_prec>0)  vdep_oce(id_prec) = 0.28
+    if(id_fine>0)  vdep_oce(id_fine) = 0.28
+    if(id_coss>0)  vdep_oce(id_coss) = 1.2
+    if(id_codu>0)  vdep_oce(id_codu) = 1.2
+    if(id_scdu>0)  vdep_oce(id_scdu) = 1.2
+    vdep_sic(:) = 0.
+    if(id_prec>0)  vdep_sic(id_prec) = 0.2
+    if(id_fine>0)  vdep_sic(id_fine) = 0.17
+    if(id_coss>0)  vdep_sic(id_coss) = 1.2
+    if(id_codu>0)  vdep_sic(id_codu) = 1.2
+    if(id_scdu>0)  vdep_sic(id_scdu) = 1.2
+
+    !vdep_sic = (/0.2, 0.17, 1.2, 1.2/)
+    !vdep_ter = (/0.3, 0.14, 1.2, 1.2/)
+    vdep_ter(:) = 0.
+    if(id_prec>0)  vdep_ter(id_prec) = 0.3
+    if(id_fine>0)  vdep_ter(id_fine) = 0.14
+    if(id_coss>0)  vdep_ter(id_coss) = 1.2
+    if(id_codu>0)  vdep_ter(id_codu) = 1.2
+    if(id_scdu>0)  vdep_ter(id_scdu) = 1.2
+
+    vdep_lic(:) = 0.
+    if(id_prec>0)  vdep_lic(id_prec) = 0.2
+    if(id_fine>0)  vdep_lic(id_fine) = 0.17
+    if(id_coss>0)  vdep_lic(id_coss) = 1.2
+    if(id_codu>0)  vdep_lic(id_codu) = 1.2
+    if(id_scdu>0)  vdep_lic(id_scdu) = 1.2
+
+
+    ! convective KE lessivage aer params:
+    ! AS: #DFB (Binta) a aussi teste ccntrAA_spla=ccntrENV_spla=0.9/1.0/0.9/0.9
+    !     mais effet negligeable sur l'AOD
+    ccntrAA_spla(:) = 0.
+    if(id_prec>0)  ccntrAA_spla(id_prec) = -9999.
+    if(id_fine>0)  ccntrAA_spla(id_fine) = 0.7
+    if(id_coss>0)  ccntrAA_spla(id_coss) = 1.0
+    if(id_codu>0)  ccntrAA_spla(id_codu) = 0.7
+    if(id_scdu>0)  ccntrAA_spla(id_scdu) = 0.7
+
+    ccntrENV_spla(:) = 0.
+    if(id_prec>0)  ccntrENV_spla(id_prec) = -9999.
+    if(id_fine>0)  ccntrENV_spla(id_fine) = 0.7
+    if(id_coss>0)  ccntrENV_spla(id_coss) = 1.0
+    if(id_codu>0)  ccntrENV_spla(id_codu) = 0.7
+    if(id_scdu>0)  ccntrENV_spla(id_scdu) = 0.7
+    ! #DFB
+    coefcoli_spla(:) = 0.
+    if(id_prec>0)  coefcoli_spla(id_prec) = -9999.
+    if(id_fine>0)  coefcoli_spla(id_fine) = 0.001
+    if(id_coss>0)  coefcoli_spla(id_coss) = 0.001
+    if(id_codu>0)  coefcoli_spla(id_codu) = 0.001
+    if(id_scdu>0)  coefcoli_spla(id_scdu) = 0.001
+
+    !vdep_lic = (/0.2, 0.17, 1.2, 1.2/)
+
+    iscm3 = .false.
+    if (debutphy) then
+      !$OMP MASTER
+      CALL suphel
+      print *, 'let s check nbtr=', nbtr
+      ! JE before put in zero
       IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan init phytracr')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'minmax init phytracr')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'maxsource init phytracr')
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan init phytracr')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'minmax init phytracr')
+        ENDDO
+        CALL minmaxsource(source_tr, qmin, qmax, 'maxsource init phytracr')
       ENDIF
-! JE   initializon to cero the tracers     
-!         DO itr=1,nbtr
-!            tr_seri(:,:,itr)=0.0
-!         ENDDO
-! JE end     
-! Initializing to zero tr_seri for comparison purposes
-!        tr_seri(:,:,:)=0.0
-!
-!        DO itr=1,nbtr
-!           trm_aux(itr)=0.0
-!           src_aux(itr)=0.0
-!           diag_trm(itr)=0.0
-!           diag_drydep(itr)=0.0
-!           diag_wetdep(itr)=0.0
-!           diag_cvtdep(itr)=0.0
-!           diag_emissn(itr)=0.0
-!        ENDDO
-!        diag_g2part=0.0
-         print *,'PREPARE FILES TO SAVE VARIABLES'
-!
-         nbjour=30
-         ecrit_tra =   NINT(86400./pdtphys)                    !--1-day  average
-         ecrit_tra_h = NINT(86400./pdtphys*0.25)               !--6-hour average
-         ecrit_tra_m = NINT(86400./pdtphys*FLOAT(nbjour))      !--1-mth  average
-         print *,'ecrit_tra=', pdtphys, ecrit_tra
-
-!!AS deleting lines
-!!         IF (ok_histrac) THEN
-!!           IF (is_mpi_root .AND. is_omp_root) THEN
-!!-----many deleted lines----
-!!!       nbjour=1
-!!         ENDIF ! mpi root
-!!         ENDIF !--ok_histrac
-
-!$OMP END MASTER
-!$OMP BARRIER
-      endif ! debutphy
-!
-!======================================================================
-! Initialisations
-!======================================================================
-!
-!
-! je  KE init
-      IF (debutphy) THEN
-!$OMP MASTER
-
-      ALLOCATE(d_tr_dry(klon,nbtr))
-      ALLOCATE(flux_tr_dry(klon,nbtr),d_tr_dec(klon,klev,nbtr))
-      ALLOCATE(qPrls(klon,nbtr),qPr(klon,klev,nbtr))
-      ALLOCATE(qDi(klon,klev,nbtr))
-      ALLOCATE(qPa(klon,klev,nbtr),qMel(klon,klev,nbtr))
-      ALLOCATE(qTrdi(klon,klev,nbtr),dtrcvMA(klon,klev,nbtr))
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ALLOCATE(d_tr_cv_o(klon,klev,nbtr))
-       ALLOCATE(d_tr_trsp_o(klon,klev,nbtr))
-       ALLOCATE(d_tr_sscav_o(klon,klev,nbtr), &
-                d_tr_sat_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_uscav_o(klon,klev,nbtr))
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        ALLOCATE(d_tr_insc_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_bcscav_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_evapls_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_ls_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_dyn_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_cl_o(klon,klev,nbtr))
-        ALLOCATE(d_tr_th_o(klon,klev,nbtr))
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        ALLOCATE(iregion_so4(klon))
-        ALLOCATE(iregion_bb(klon))
-        ALLOCATE(iregion_ind(klon))
-        ALLOCATE(iregion_dust(klon))
-        ALLOCATE(iregion_wstardust(klon))
-
-!JE20150518<<
-       ALLOCATE(masque_aqua(klon))  
-       ALLOCATE(masque_terra(klon))  
- 
-
-       masque_aqua(:)=0
-       masque_terra(:)=0
-
-      aod550_terra(:)=0.  
-      aod550_tr2_terra(:)=0.  
-      aod550_ss_terra(:)=0.   
-      aod550_dust_terra(:)=0.   
-      aod550_dustsco_terra(:)=0.   
-      aod670_terra(:)=0.   
-      aod670_tr2_terra(:)=0.  
-      aod670_ss_terra(:)=0.  
-      aod670_dust_terra(:)=0.  
-      aod670_dustsco_terra(:)=0.  
-      aod865_terra(:)=0.   
-      aod865_tr2_terra(:)=0.  
-      aod865_ss_terra(:)=0.  
-      aod865_dust_terra(:)=0.  
-      aod865_dustsco_terra(:)=0.  
-      aod550_aqua(:)=0.  
-      aod550_tr2_aqua(:)=0.  
-      aod550_ss_aqua(:)=0.   
-      aod550_dust_aqua(:)=0.   
-      aod550_dustsco_aqua(:)=0.   
-      aod670_aqua(:)=0.   
-      aod670_tr2_aqua(:)=0.  
-      aod670_ss_aqua(:)=0.  
-      aod670_dust_aqua(:)=0.  
-      aod670_dustsco_aqua(:)=0.  
-      aod865_aqua(:)=0.   
-      aod865_tr2_aqua(:)=0.  
-      aod865_ss_aqua(:)=0.  
-      aod865_dust_aqua(:)=0.  
-      aod865_dustsco_aqua(:)=0.  
-!JE20150518>>
-
-
-
-
-
-!
-!Config Key  = iflag_lscav
-!Config Desc = Large scale scavenging parametrization: 0=none,
-!1=old(Genthon92),
-!              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
-!Config Def  = 4
-!Config
-        iflag_lscav_omp=4
-        call getin('iflag_lscav', iflag_lscav_omp)
-        iflag_lscav=iflag_lscav_omp
-! initialiation for time computation
-
-        tia_spla=0.
-        tia_emis=0.
-        tia_depo=0.
-        tia_cltr=0.
-        tia_ther=0.
-        tia_sedi=0.
-        tia_gasp=0.
-        tia_wetap=0.
-        tia_cvltr=0.
-        tia_lscs=0.
-        tia_brop=0.
-        tia_outs=0.
-        tia_nophytracr=0.
-        clock_start_outphytracr=clock_end_outphytracr+1
-!$OMP END MASTER
-!$OMP BARRIER
-       ENDIF ! debutphy
-     
-      lmt_dms(:)=0.0
-      aux_var2(:)=0.0
-      aux_var3(:,:)=0.0
-      source_tr(:,:)=0.0
-      flux_tr(:,:)=0.0
-      flux_sparam_bb(:)=0.0
-      flux_sparam_ff(:)=0.0
-      flux_sparam_ind(:)=0.0
-      flux_sparam_ddfine(:)=0.0
-      flux_sparam_ddcoa(:)=0.0
-      flux_sparam_ddsco(:)=0.0
-      flux_sparam_ssfine(:)=0.0
-      flux_sparam_sscoa(:)=0.0
-
-! initialiation for time computation
-        
-        ti_spla=0
-        ti_emis=0
-        ti_depo=0
-        ti_cltr=0
-        ti_ther=0
-        ti_sedi=0
-        ti_gasp=0
-        ti_wetap=0
-        ti_cvltr=0
-        ti_lscs=0
-        ti_brop=0
-        ti_outs=0
-
-
-       DO k=1,klev
-        DO i=1,klon
-         Mint(i,k)=0.
+      ! JE   initializon to cero the tracers
+      !         DO itr=1,nbtr
+      !            tr_seri(:,:,itr)=0.0
+      !         ENDDO
+      ! JE end
+      ! Initializing to zero tr_seri for comparison purposes
+      !        tr_seri(:,:,:)=0.0
+
+      !        DO itr=1,nbtr
+      !           trm_aux(itr)=0.0
+      !           src_aux(itr)=0.0
+      !           diag_trm(itr)=0.0
+      !           diag_drydep(itr)=0.0
+      !           diag_wetdep(itr)=0.0
+      !           diag_cvtdep(itr)=0.0
+      !           diag_emissn(itr)=0.0
+      !        ENDDO
+      !        diag_g2part=0.0
+      print *, 'PREPARE FILES TO SAVE VARIABLES'
+
+      nbjour = 30
+      ecrit_tra = NINT(86400. / pdtphys)                    !--1-day  average
+      ecrit_tra_h = NINT(86400. / pdtphys * 0.25)               !--6-hour average
+      ecrit_tra_m = NINT(86400. / pdtphys * FLOAT(nbjour))      !--1-mth  average
+      print *, 'ecrit_tra=', pdtphys, ecrit_tra
+
+      !!AS deleting lines
+      !!         IF (ok_histrac) THEN
+      !!           IF (is_mpi_root .AND. is_omp_root) THEN
+      !!-----many deleted lines----
+      !!!       nbjour=1
+      !!         ENDIF ! mpi root
+      !!         ENDIF !--ok_histrac
+
+      !$OMP END MASTER
+      !$OMP BARRIER
+    endif ! debutphy
+
+    !======================================================================
+    ! Initialisations
+    !======================================================================
+
+
+    ! je  KE init
+    IF (debutphy) THEN
+      !$OMP MASTER
+
+      ALLOCATE(d_tr_dry(klon, nbtr))
+      ALLOCATE(flux_tr_dry(klon, nbtr), d_tr_dec(klon, klev, nbtr))
+      ALLOCATE(qPrls(klon, nbtr), qPr(klon, klev, nbtr))
+      ALLOCATE(qDi(klon, klev, nbtr))
+      ALLOCATE(qPa(klon, klev, nbtr), qMel(klon, klev, nbtr))
+      ALLOCATE(qTrdi(klon, klev, nbtr), dtrcvMA(klon, klev, nbtr))
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ALLOCATE(d_tr_cv_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_trsp_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_sscav_o(klon, klev, nbtr), &
+              d_tr_sat_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_uscav_o(klon, klev, nbtr))
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ALLOCATE(d_tr_insc_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_bcscav_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_evapls_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_ls_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_dyn_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_cl_o(klon, klev, nbtr))
+      ALLOCATE(d_tr_th_o(klon, klev, nbtr))
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ALLOCATE(iregion_so4(klon))
+      ALLOCATE(iregion_bb(klon))
+      ALLOCATE(iregion_ind(klon))
+      ALLOCATE(iregion_dust(klon))
+      ALLOCATE(iregion_wstardust(klon))
+
+      !JE20150518<<
+      ALLOCATE(masque_aqua(klon))
+      ALLOCATE(masque_terra(klon))
+
+      masque_aqua(:) = 0
+      masque_terra(:) = 0
+
+      aod550_terra(:) = 0.
+      aod550_tr2_terra(:) = 0.
+      aod550_ss_terra(:) = 0.
+      aod550_dust_terra(:) = 0.
+      aod550_dustsco_terra(:) = 0.
+      aod670_terra(:) = 0.
+      aod670_tr2_terra(:) = 0.
+      aod670_ss_terra(:) = 0.
+      aod670_dust_terra(:) = 0.
+      aod670_dustsco_terra(:) = 0.
+      aod865_terra(:) = 0.
+      aod865_tr2_terra(:) = 0.
+      aod865_ss_terra(:) = 0.
+      aod865_dust_terra(:) = 0.
+      aod865_dustsco_terra(:) = 0.
+      aod550_aqua(:) = 0.
+      aod550_tr2_aqua(:) = 0.
+      aod550_ss_aqua(:) = 0.
+      aod550_dust_aqua(:) = 0.
+      aod550_dustsco_aqua(:) = 0.
+      aod670_aqua(:) = 0.
+      aod670_tr2_aqua(:) = 0.
+      aod670_ss_aqua(:) = 0.
+      aod670_dust_aqua(:) = 0.
+      aod670_dustsco_aqua(:) = 0.
+      aod865_aqua(:) = 0.
+      aod865_tr2_aqua(:) = 0.
+      aod865_ss_aqua(:) = 0.
+      aod865_dust_aqua(:) = 0.
+      aod865_dustsco_aqua(:) = 0.
+      !JE20150518>>
+
+      !Config Key  = iflag_lscav
+      !Config Desc = Large scale scavenging parametrization: 0=none,
+      !1=old(Genthon92),
+      !              2=1+PHeinrich, 3=Reddy_Boucher2004, 4=3+RPilon.
+      !Config Def  = 4
+      !Config
+      iflag_lscav_omp = 4
+      call getin('iflag_lscav', iflag_lscav_omp)
+      iflag_lscav = iflag_lscav_omp
+      ! initialiation for time computation
+
+      tia_spla = 0.
+      tia_emis = 0.
+      tia_depo = 0.
+      tia_cltr = 0.
+      tia_ther = 0.
+      tia_sedi = 0.
+      tia_gasp = 0.
+      tia_wetap = 0.
+      tia_cvltr = 0.
+      tia_lscs = 0.
+      tia_brop = 0.
+      tia_outs = 0.
+      tia_nophytracr = 0.
+      clock_start_outphytracr = clock_end_outphytracr + 1
+      !$OMP END MASTER
+      !$OMP BARRIER
+    ENDIF ! debutphy
+
+    lmt_dms(:) = 0.0
+    aux_var2(:) = 0.0
+    aux_var3(:, :) = 0.0
+    source_tr(:, :) = 0.0
+    flux_tr(:, :) = 0.0
+    flux_sparam_bb(:) = 0.0
+    flux_sparam_ff(:) = 0.0
+    flux_sparam_ind(:) = 0.0
+    flux_sparam_ddfine(:) = 0.0
+    flux_sparam_ddcoa(:) = 0.0
+    flux_sparam_ddsco(:) = 0.0
+    flux_sparam_ssfine(:) = 0.0
+    flux_sparam_sscoa(:) = 0.0
+
+    ! initialiation for time computation
+
+    ti_spla = 0
+    ti_emis = 0
+    ti_depo = 0
+    ti_cltr = 0
+    ti_ther = 0
+    ti_sedi = 0
+    ti_gasp = 0
+    ti_wetap = 0
+    ti_cvltr = 0
+    ti_lscs = 0
+    ti_brop = 0
+    ti_outs = 0
+
+    DO k = 1, klev
+      DO i = 1, klon
+        Mint(i, k) = 0.
+      END DO
+    END DO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_cv(i, k, itr) = 0.
+          d_tr_trsp(i, k, itr) = 0.
+          d_tr_sscav(i, k, itr) = 0.
+          d_tr_sat(i, k, itr) = 0.
+          d_tr_uscav(i, k, itr) = 0.
+          d_tr(i, k, itr) = 0.
+          d_tr_insc(i, k, itr) = 0.
+          d_tr_bcscav(i, k, itr) = 0.
+          d_tr_evapls(i, k, itr) = 0.
+          d_tr_ls(i, k, itr) = 0.
+          d_tr_cl(i, k, itr) = 0.
+          d_tr_th(i, k, itr) = 0.
+
+          d_tr_cv_o(i, k, itr) = 0.
+          d_tr_trsp_o(i, k, itr) = 0.
+          d_tr_sscav_o(i, k, itr) = 0.
+          d_tr_sat_o(i, k, itr) = 0.
+          d_tr_uscav_o(i, k, itr) = 0.
+
+          qDi(i, k, itr) = 0.
+          qPr(i, k, itr) = 0.
+          qPa(i, k, itr) = 0.
+          qMel(i, k, itr) = 0.
+          qTrdi(i, k, itr) = 0.
+          dtrcvMA(i, k, itr) = 0.
+          zmfd1a(i, k, itr) = 0.
+          zmfdam(i, k, itr) = 0.
+          zmfphi2(i, k, itr) = 0.
         END DO
-       END DO
-
-
-!
-      DO itr=1,nbtr
-       DO k=1,klev
-        DO i=1,klon
-         d_tr_cv(i,k,itr)=0.
-         d_tr_trsp(i,k,itr)=0.
-         d_tr_sscav(i,k,itr)=0.
-         d_tr_sat(i,k,itr)=0.
-         d_tr_uscav(i,k,itr)=0.
-         d_tr(i,k,itr)=0.
-         d_tr_insc(i,k,itr)=0.
-         d_tr_bcscav(i,k,itr)=0.
-         d_tr_evapls(i,k,itr)=0.
-         d_tr_ls(i,k,itr)=0.
-         d_tr_cl(i,k,itr)=0.
-         d_tr_th(i,k,itr)=0.
-  
-         d_tr_cv_o(i,k,itr)=0.
-         d_tr_trsp_o(i,k,itr)=0.
-         d_tr_sscav_o(i,k,itr)=0.
-         d_tr_sat_o(i,k,itr)=0.
-         d_tr_uscav_o(i,k,itr)=0.
-
-
-         qDi(i,k,itr)=0.
-         qPr(i,k,itr)=0.
-         qPa(i,k,itr)=0.
-         qMel(i,k,itr)=0.
-         qTrdi(i,k,itr)=0.
-         dtrcvMA(i,k,itr)=0.
-         zmfd1a(i,k,itr)=0.
-         zmfdam(i,k,itr)=0.
-         zmfphi2(i,k,itr)=0.
-        END DO
-       END DO
       END DO
-
-
-      DO itr=1,nbtr
-       DO i=1,klon
-          qPrls(i,itr)=0.0
-          dtrconv(i,itr)=0.0
-!JE20140507<<
-          d_tr_dry(i,itr)=0.0
-          flux_tr_dry(i,itr)=0.0
-!JE20140507>>
-       ENDDO
-      ENDDO
-
-      DO itr=1,nbtr
-      DO i=1, klon 
-        his_dh(i,itr)=0.0
-        his_dhlsc(i,itr)=0.0
-        his_dhcon(i,itr)=0.0
-        his_dhbclsc(i,itr)=0.0
-        his_dhbccon(i,itr)=0.0
-        trm(i,itr)=0.0
-        his_th(i,itr)=0.0
-        his_dhkecv(i,itr)=0.0
-        his_ds(i,itr)=0.0
-        his_dhkelsc(i,itr)=0.0
-
-      ENDDO
-      ENDDO
-!JE:      
-      DO i=1, klon 
-         his_g2pgas(i) = 0.0
-         his_g2paer(i) = 0.0
-      ENDDO
-! endJE
-!
-
-      DO k=1, klev
+    END DO
+
+    DO itr = 1, nbtr
       DO i = 1, klon
-        zrho(i,k)=pplay(i,k)/t_seri(i,k)/RD
-        zdz(i,k)=(paprs(i,k)-paprs(i,k+1))/zrho(i,k)/RG
-        zmasse(i,k)=(paprs(i,k)-paprs(i,k+1))/RG
-      ENDDO
-      ENDDO
-!
+        qPrls(i, itr) = 0.0
+        dtrconv(i, itr) = 0.0
+        !JE20140507<<
+        d_tr_dry(i, itr) = 0.0
+        flux_tr_dry(i, itr) = 0.0
+        !JE20140507>>
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
       DO i = 1, klon
-        zalt(i,1)=pphis(i)/RG
-      ENDDO
-      DO k=1, klev-1
+        his_dh(i, itr) = 0.0
+        his_dhlsc(i, itr) = 0.0
+        his_dhcon(i, itr) = 0.0
+        his_dhbclsc(i, itr) = 0.0
+        his_dhbccon(i, itr) = 0.0
+        trm(i, itr) = 0.0
+        his_th(i, itr) = 0.0
+        his_dhkecv(i, itr) = 0.0
+        his_ds(i, itr) = 0.0
+        his_dhkelsc(i, itr) = 0.0
+
+      ENDDO
+    ENDDO
+    !JE:
+    DO i = 1, klon
+      his_g2pgas(i) = 0.0
+      his_g2paer(i) = 0.0
+    ENDDO
+    ! endJE
+
+    DO k = 1, klev
       DO i = 1, klon
-        zalt(i,k+1)=zalt(i,k)+zdz(i,k)
-      ENDDO
-      ENDDO
-
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_init=dife*MAX(0,SIGN(1,dife)) &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_init=tia_init+REAL(ti_init)/REAL(clock_rate)
-      ENDIF
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-      IF (debutphy) then
-
-! AS: initialisation des indices par point de grille physique iregion_*
-! (variables tenant de l'assimilation, a eliminer dans un 2eme temps) 
-       iregion_dust(:)=1
-       iregion_ind(:)=1
-       iregion_bb(:)=1
-       iregion_wstardust(:)=1
-
-!AS: lecture des indices dans fichiers "regions_*" eliminee par IF("ASSIM"="YES") (faux donc)
-       IF("ASSIM"=="YES") THEN
-      c_FullName1='regions_dustacc'
-      !c_FullName1='regions_dust'
-      call readregions_spl(iregion_dust,c_FullName1)
-      c_FullName1='regions_ind'
-      call readregions_spl(iregion_ind,c_FullName1)
-      c_FullName1='regions_bb'
-      call readregions_spl(iregion_bb,c_FullName1)
-      c_FullName1='regions_pwstarwake'
-      call readregions_spl(iregion_wstardust,c_FullName1)
-
-!$OMP MASTER
+        zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD
+        zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
+        zmasse(i, k) = (paprs(i, k) - paprs(i, k + 1)) / RG
+      ENDDO
+    ENDDO
+
+    DO i = 1, klon
+      zalt(i, 1) = pphis(i) / RG
+    ENDDO
+    DO k = 1, klev - 1
+      DO i = 1, klon
+        zalt(i, k + 1) = zalt(i, k) + zdz(i, k)
+      ENDDO
+    ENDDO
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_init = dife * MAX(0, SIGN(1, dife)) &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_init = tia_init + REAL(ti_init) / REAL(clock_rate)
+    ENDIF
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    IF (debutphy) then
+
+      ! AS: initialisation des indices par point de grille physique iregion_*
+      ! (variables tenant de l'assimilation, a eliminer dans un 2eme temps)
+      iregion_dust(:) = 1
+      iregion_ind(:) = 1
+      iregion_bb(:) = 1
+      iregion_wstardust(:) = 1
+
+      !AS: lecture des indices dans fichiers "regions_*" eliminee par IF("ASSIM"="YES") (faux donc)
+      IF("ASSIM"=="YES") THEN
+        c_FullName1 = 'regions_dustacc'
+        !c_FullName1='regions_dust'
+        call readregions_spl(iregion_dust, c_FullName1)
+        c_FullName1 = 'regions_ind'
+        call readregions_spl(iregion_ind, c_FullName1)
+        c_FullName1 = 'regions_bb'
+        call readregions_spl(iregion_bb, c_FullName1)
+        c_FullName1 = 'regions_pwstarwake'
+        call readregions_spl(iregion_wstardust, c_FullName1)
+
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+
+          OPEN(25, FILE = 'dustregions_pyvar_je.data')
+          OPEN(55, FILE = 'indregions_pyvar_je.data')
+          OPEN(75, FILE = 'bbregions_pyvar_je.data')
+          OPEN(95, FILE = 'wstardustregions_pyvar_je.data')
+          OPEN(76, FILE = 'xlat.data')
+          OPEN(77, FILE = 'xlon.data')
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+
+        CALL gather(iregion_dust, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(25, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(iregion_ind, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(55, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(iregion_bb, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(75, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(iregion_wstardust, iauxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(95, '(i10)') iauxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+
+        CALL gather(rlat, auxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(76, *) auxklon_glo(k)
+          ENDDO
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+        CALL gather(rlon, auxklon_glo)
+        !$OMP MASTER
+        IF (is_mpi_root .AND. is_omp_root) THEN
+          DO k = 1, klon_glo
+            WRITE(77, *) auxklon_glo(k)
+          ENDDO
+
+          CLOSE(25)
+          CLOSE(55)
+          CLOSE(75)
+          CLOSE(76)
+          CLOSE(77)
+          CLOSE(95)
+
+        ENDIF ! mpi root
+        !$OMP END MASTER
+        !$OMP BARRIER
+
+      ENDIF  ! ASSIM
+
+    ENDIF  ! debutphy
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_inittype = dife * MAX(0, SIGN(1, dife)) &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_inittype = tia_inittype + REAL(ti_inittype) / REAL(clock_rate)
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    !=======================================================================
+    ! SAVING SURFACE TYPE
+    !=======================================================================
+    IF (debutphy) THEN
+      !$OMP MASTER
       IF (is_mpi_root .AND. is_omp_root) THEN
-     
-      OPEN(25,FILE='dustregions_pyvar_je.data')
-      OPEN(55,FILE='indregions_pyvar_je.data')
-      OPEN(75,FILE='bbregions_pyvar_je.data')
-      OPEN(95,FILE='wstardustregions_pyvar_je.data')
-      OPEN(76,FILE='xlat.data')
-      OPEN(77,FILE='xlon.data')
+
+        OPEN(35, FILE = 'surface_ocean.data')
+        OPEN(45, FILE = 'surface_seaice.data')
+        OPEN(65, FILE = 'surface_land.data')
+        OPEN(85, FILE = 'surface_landice.data')
       ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-
-      CALL gather(iregion_dust,iauxklon_glo)
-!$OMP MASTER
+      !$OMP END MASTER
+      !$OMP BARRIER
+      do i = 1, klon
+        aux_var2(i) = pctsrf(i, is_oce)
+      enddo
+      call gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
       IF (is_mpi_root .AND. is_omp_root) THEN
-      DO k=1,klon_glo
-        WRITE(25,'(i10)') iauxklon_glo(k)
-      ENDDO
+        DO i = 1, klon_glo
+          WRITE (35, 103)  auxklon_glo(i)
+        ENDDO
       ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-      CALL gather(iregion_ind,iauxklon_glo)
-!$OMP MASTER
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+      do i = 1, klon
+        aux_var2(i) = pctsrf(i, is_sic)
+      enddo
+      call gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
       IF (is_mpi_root .AND. is_omp_root) THEN
-      DO k=1,klon_glo
-        WRITE(55,'(i10)') iauxklon_glo(k)
-      ENDDO
+        DO i = 1, klon_glo
+          WRITE (45, 103)  auxklon_glo(i)
+        ENDDO
       ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-      CALL gather(iregion_bb,iauxklon_glo)
-!$OMP MASTER
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+      do i = 1, klon
+        aux_var2(i) = pctsrf(i, is_ter)
+      enddo
+      call gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
       IF (is_mpi_root .AND. is_omp_root) THEN
-      DO k=1,klon_glo
-        WRITE(75,'(i10)') iauxklon_glo(k)
-      ENDDO
+        DO i = 1, klon_glo
+          WRITE (65, 103)  auxklon_glo(i)
+        ENDDO
       ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-      CALL gather(iregion_wstardust,iauxklon_glo)
-!$OMP MASTER
+      !$OMP END MASTER
+      !$OMP BARRIER
+
+      do i = 1, klon
+        aux_var2(i) = pctsrf(i, is_lic)
+      enddo
+      call gather(aux_var2, auxklon_glo)
+      !$OMP MASTER
       IF (is_mpi_root .AND. is_omp_root) THEN
-      DO k=1,klon_glo
-        WRITE(95,'(i10)') iauxklon_glo(k)
-      ENDDO
+        DO i = 1, klon_glo
+          WRITE (85, 103)  auxklon_glo(i)
+        ENDDO
+
+        !      DO i = 1, klon
+        !         WRITE (35,103) pctsrf(i,is_oce)
+        !         WRITE (45,103) pctsrf(i,is_sic)
+        !         WRITE (65,103) pctsrf(i,is_ter)
+        !         WRITE (85,103) pctsrf(i,is_lic)
+        !      ENDDO
+        CLOSE(35)
+        CLOSE(45)
+        CLOSE(65)
+        CLOSE(85)
+        103   FORMAT (f6.2)
       ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-
-
-      CALL gather(rlat,auxklon_glo)
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      DO k=1,klon_glo
-        WRITE(76,*) auxklon_glo(k)
-      ENDDO
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-      CALL gather(rlon,auxklon_glo)
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      DO k=1,klon_glo
-        WRITE(77,*) auxklon_glo(k)
-      ENDDO
-
-      CLOSE(25)
-      CLOSE(55)
-      CLOSE(75)
-      CLOSE(76)
-      CLOSE(77)
-      CLOSE(95)
-
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-
-      ENDIF  ! ASSIM 
-
-      ENDIF  ! debutphy
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_inittype=dife*MAX(0,SIGN(1,dife)) &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_inittype=tia_inittype+REAL(ti_inittype)/REAL(clock_rate)
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-!
-!=======================================================================
-! SAVING SURFACE TYPE
-!=======================================================================
-      IF (debutphy) THEN
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-
-      OPEN(35,FILE='surface_ocean.data')
-      OPEN(45,FILE='surface_seaice.data')
-      OPEN(65,FILE='surface_land.data')
-      OPEN(85,FILE='surface_landice.data')
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-      do i = 1, klon
-                aux_var2(i) = pctsrf(i,is_oce) 
-      enddo
-      call gather(aux_var2,auxklon_glo)
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      DO i = 1, klon_glo
-         WRITE (35,103)  auxklon_glo(i)
-      ENDDO
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-
-      do i = 1, klon
-                aux_var2(i) = pctsrf(i,is_sic) 
-      enddo
-      call gather(aux_var2,auxklon_glo)
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      DO i = 1, klon_glo
-         WRITE (45,103)  auxklon_glo(i)
-      ENDDO
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-
-      do i = 1, klon
-                aux_var2(i) = pctsrf(i,is_ter) 
-      enddo
-      call gather(aux_var2,auxklon_glo)
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      DO i = 1, klon_glo
-         WRITE (65,103)  auxklon_glo(i)
-      ENDDO
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-
-      do i = 1, klon
-                aux_var2(i) = pctsrf(i,is_lic) 
-      enddo
-      call gather(aux_var2,auxklon_glo)
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      DO i = 1, klon_glo
-         WRITE (85,103)  auxklon_glo(i)
-      ENDDO
-!
-!      DO i = 1, klon
-!         WRITE (35,103) pctsrf(i,is_oce)
-!         WRITE (45,103) pctsrf(i,is_sic)
-!         WRITE (65,103) pctsrf(i,is_ter)
-!         WRITE (85,103) pctsrf(i,is_lic)
-!      ENDDO
-      CLOSE(35)
-      CLOSE(45)
-      CLOSE(65)
-      CLOSE(85)
-103   FORMAT (f6.2)
-      ENDIF ! mpi root
-!$OMP END MASTER
-!$OMP BARRIER
-      ENDIF ! debutphy
-
-!      stop
-!
-!=======================================================================
-!
-      DO itr=1,nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-      iscm3=.true.
-
-!=======================================================================
-!
-      DO k=1, klev
-      DO i=1, klon
-        m_conc(i,k)=pplay(i,k)/t_seri(i,k)/RKBOL*1.e-6
-      ENDDO
-      ENDDO
-
-!
-!
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_avt_coarem')
-        ENDDO        
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'avt coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: avt coarem')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_inittwrite=dife*MAX(0,SIGN(1,dife))  &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_inittwrite=tia_inittwrite+REAL(ti_inittwrite)/REAL(clock_rate)
-      ENDIF
-
-!
-!
-!=======================================================================
-!                     EMISSIONS OF COARSE AEROSOLS
-!=======================================================================
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-
-!      
-      print *,'Number of tracers = ',nbtr
-
-      print *,'AT BEGINNING OF PHYTRACR_SPL'
-!      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
-!     .                                         MAXVAL(tr_seri(:,:,3))
+      !$OMP END MASTER
+      !$OMP BARRIER
+    ENDIF ! debutphy
+
+    !      stop
+
+    !=======================================================================
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .true.
+
+    !=======================================================================
+
+    DO k = 1, klev
+      DO i = 1, klon
+        m_conc(i, k) = pplay(i, k) / t_seri(i, k) / RKBOL * 1.e-6
+      ENDDO
+    ENDDO
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_avt_coarem')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'avt coarem')
+      ENDDO
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: avt coarem')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_inittwrite = dife * MAX(0, SIGN(1, dife))  &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_inittwrite = tia_inittwrite + REAL(ti_inittwrite) / REAL(clock_rate)
+    ENDIF
+
+
+    !=======================================================================
+    !                     EMISSIONS OF COARSE AEROSOLS
+    !=======================================================================
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    print *, 'Number of tracers = ', nbtr
+
+    print *, 'AT BEGINNING OF PHYTRACR_SPL'
+    !      print *,'tr_seri = ',SUM(tr_seri(:,:,3)),MINVAL(tr_seri(:,:,3)),
+    !     .                                         MAXVAL(tr_seri(:,:,3))
 #ifdef IOPHYS_DUST
       do itr=1,nbtr
@@ -2142,23 +2078,23 @@
 
 
-      CALL coarsemission(pctsrf,pdtphys,t_seri,                            &
-                        pmflxr,pmflxs,prfl,psfl,                           &
-                        rlat,rlon,debutphy,                                & 
-                        zu10m,zv10m,wstar,ale_bl,ale_wake,                 &
-                        scale_param_ssacc,scale_param_sscoa,               & 
-                        scale_param_dustacc,scale_param_dustcoa,           &
-                        scale_param_dustsco,                               & 
-                        nbreg_dust,                                        &
-                        iregion_dust,dust_ec,                              & 
-                        param_wstarBLperregion,param_wstarWAKEperregion,   &
-                        nbreg_wstardust,                                   &
-                        iregion_wstardust,                                 &
-                        lmt_sea_salt,qmin,qmax,                            &
-                                  flux_sparam_ddfine,flux_sparam_ddcoa,    & 
-                                  flux_sparam_ddsco,                       &
-                                  flux_sparam_ssfine,flux_sparam_sscoa,    & 
-                              id_prec,id_fine,id_coss,id_codu,id_scdu,     &
-                              ok_chimeredust,                           &
-                                                     source_tr,flux_tr)    
+    CALL coarsemission(pctsrf, pdtphys, t_seri, &
+            pmflxr, pmflxs, prfl, psfl, &
+            rlat, rlon, debutphy, &
+            zu10m, zv10m, wstar, ale_bl, ale_wake, &
+            scale_param_ssacc, scale_param_sscoa, &
+            scale_param_dustacc, scale_param_dustcoa, &
+            scale_param_dustsco, &
+            nbreg_dust, &
+            iregion_dust, dust_ec, &
+            param_wstarBLperregion, param_wstarWAKEperregion, &
+            nbreg_wstardust, &
+            iregion_wstardust, &
+            lmt_sea_salt, qmin, qmax, &
+            flux_sparam_ddfine, flux_sparam_ddcoa, &
+            flux_sparam_ddsco, &
+            flux_sparam_ssfine, flux_sparam_sscoa, &
+            id_prec, id_fine, id_coss, id_codu, id_scdu, &
+            ok_chimeredust, &
+            source_tr, flux_tr)
 
 #ifdef IOPHYS_DUST
@@ -2170,21 +2106,20 @@
 #endif
 
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_coarem')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after coarem')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after coarem')
-      ENDIF
-
-!
-!
-!
-!======================================================================
-!                   EMISSIONS OF AEROSOL PRECURSORS      
-!======================================================================
-!
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_coarem')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after coarem')
+      ENDDO
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after coarem')
+    ENDIF
+
+
+
+    !======================================================================
+    !                   EMISSIONS OF AEROSOL PRECURSORS
+    !======================================================================
+
 #ifdef IOPHYS_DUST
       print *,'INPUT TO PRECUREMISSION'
@@ -2229,36 +2164,36 @@
 
 
-     print*,'ON PASSE DANS precuremission'
-     CALL precuremission(ftsol,u10m_ec,v10m_ec,pctsrf,                  &
-                         u_seri,v_seri,paprs,pplay,cdragh,cdragm,       &
-                         t_seri,q_seri,tsol,fracso2emis,frach2sofso2,   &
-                         bateau,zdz,zalt,kminbc,kmaxbc,pdtphys,         &
-                         scale_param_bb,scale_param_ind,                &
-                         iregion_ind, iregion_bb,                       &
-                         nbreg_ind, nbreg_bb,                           &
-                         lmt_so2ff_l,lmt_so2ff_h, lmt_so2nff,lmt_so2ba, &
-                         lmt_so2bb_l,lmt_so2bb_h,                       &
-                         lmt_so2volc_cont,lmt_altvolc_cont,             &
-                         lmt_so2volc_expl,lmt_altvolc_expl,             &
-                         lmt_dmsbio,lmt_h2sbio, lmt_dmsconc, lmt_dms,   &
-                         id_prec,id_fine,                               &
-                                       flux_sparam_ind, flux_sparam_bb, &
-                                       source_tr,flux_tr,tr_seri)       
-!
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after precur')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after precur')
-        ENDDO
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after precur')
-      ENDIF
-
-!=======================================================================
-!                      EMISSIONS OF FINE AEROSOLS
-!=======================================================================
+    print*, 'ON PASSE DANS precuremission'
+    CALL precuremission(ftsol, u10m_ec, v10m_ec, pctsrf, &
+            u_seri, v_seri, paprs, pplay, cdragh, cdragm, &
+            t_seri, q_seri, tsol, fracso2emis, frach2sofso2, &
+            bateau, zdz, zalt, kminbc, kmaxbc, pdtphys, &
+            scale_param_bb, scale_param_ind, &
+            iregion_ind, iregion_bb, &
+            nbreg_ind, nbreg_bb, &
+            lmt_so2ff_l, lmt_so2ff_h, lmt_so2nff, lmt_so2ba, &
+            lmt_so2bb_l, lmt_so2bb_h, &
+            lmt_so2volc_cont, lmt_altvolc_cont, &
+            lmt_so2volc_expl, lmt_altvolc_expl, &
+            lmt_dmsbio, lmt_h2sbio, lmt_dmsconc, lmt_dms, &
+            id_prec, id_fine, &
+            flux_sparam_ind, flux_sparam_bb, &
+            source_tr, flux_tr, tr_seri)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after precur')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after precur')
+      ENDDO
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after precur')
+    ENDIF
+
+    !=======================================================================
+    !                      EMISSIONS OF FINE AEROSOLS
+    !=======================================================================
 #ifdef IOPHYS_DUST
-!
+
       do itr=1,nbtr
          write(str2,'(i2.2)') itr
@@ -2268,41 +2203,38 @@
 #endif
 
-      CALL finemission(zdz,pdtphys,zalt,kminbc,kmaxbc,                     & 
-                      scale_param_bb,scale_param_ff,                       &
-                      iregion_ind,iregion_bb,                              & 
-                      nbreg_ind,nbreg_bb,                                  & 
-                      lmt_bcff, lmt_bcnff, lmt_bcbb_l,lmt_bcbb_h,          & 
-                      lmt_bcba, lmt_omff, lmt_omnff,                       & 
-                      lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba,         & 
-                      id_fine,                                             & 
-                                       flux_sparam_bb, flux_sparam_ff,     & 
-                                             source_tr,flux_tr,tr_seri)     
-!
-!
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_fineem')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after fineem')
-        ENDDO
+    CALL finemission(zdz, pdtphys, zalt, kminbc, kmaxbc, &
+            scale_param_bb, scale_param_ff, &
+            iregion_ind, iregion_bb, &
+            nbreg_ind, nbreg_bb, &
+            lmt_bcff, lmt_bcnff, lmt_bcbb_l, lmt_bcbb_h, &
+            lmt_bcba, lmt_omff, lmt_omnff, &
+            lmt_ombb_l, lmt_ombb_h, lmt_omnat, lmt_omba, &
+            id_fine, &
+            flux_sparam_bb, flux_sparam_ff, &
+            source_tr, flux_tr, tr_seri)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_fineem')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after fineem')
+      ENDDO
       IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,   &
-           pplay,t_seri,iscm3,'after fineem')                  
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after fineem')
         ENDDO
       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after fineem')
-      ENDIF
-
-!
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_emis=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_emis=tia_emis+REAL(ti_emis)/REAL(clock_rate)
-      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after fineem')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_emis = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_emis = tia_emis + REAL(ti_emis) / REAL(clock_rate)
+    ENDIF
 
 
@@ -2314,56 +2246,52 @@
       enddo
 #endif
-!
-!
-
-
-
-!
-!=======================================================================
-!                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
-!=======================================================================
-!
-!        DO itr=1,nbtr
-!         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,
-!     .      pplay,t_seri,iscm3,'')
-!        ENDDO
-
-!======================================================================
-!    -- Dry deposition --
-!======================================================================
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+
+
+    !=======================================================================
+    !                 DRY DEPOSITION AND BOUNDARY LAYER MIXING
+    !=======================================================================
+
+    !        DO itr=1,nbtr
+    !         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,
+    !     .      pplay,t_seri,iscm3,'')
+    !        ENDDO
+
+    !======================================================================
+    !    -- Dry deposition --
+    !======================================================================
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL cm3_to_kg(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .false.
+    !----------------------------
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_depo')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before depo')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'before depo')
+        ENDDO
       ENDIF
-
-      DO itr=1,nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-      iscm3=.false.
-!----------------------------
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before_depo')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before depo')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz, &
-           pplay,t_seri,iscm3,'before depo')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before depo')
-      ENDIF
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: before depo')
+    ENDIF
 
 #ifdef IOPHYS_DUST
@@ -2374,38 +2302,36 @@
 #endif
 
-      CALL deposition(vdep_oce,vdep_sic,vdep_ter,vdep_lic,pctsrf,      &
-                     zrho,zdz,pdtphys,RHcl,masse,t_seri,pplay,paprs,  &
-                     lminmax,qmin,qmax,                               &
-                              his_ds,source_tr,tr_seri)
-!
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_depo')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after depo')
-        ENDDO
+    CALL deposition(vdep_oce, vdep_sic, vdep_ter, vdep_lic, pctsrf, &
+            zrho, zdz, pdtphys, RHcl, masse, t_seri, pplay, paprs, &
+            lminmax, qmin, qmax, &
+            his_ds, source_tr, tr_seri)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_depo')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after depo')
+      ENDDO
       IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,   &
-           pplay,t_seri,iscm3,'after depo')
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after depo')
         ENDDO
       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after depo')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_depo=dife*MAX(0,SIGN(1,dife))                      &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_depo=tia_depo+REAL(ti_depo)/REAL(clock_rate)
-      ENDIF
-
-
-!
-!======================================================================
-!    -- Boundary layer mixing --
-!======================================================================
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after depo')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_depo = dife * MAX(0, SIGN(1, dife))                      &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_depo = tia_depo + REAL(ti_depo) / REAL(clock_rate)
+    ENDIF
+
+    !======================================================================
+    !    -- Boundary layer mixing --
+    !======================================================================
 
 #ifdef IOPHYS_DUST
@@ -2418,65 +2344,63 @@
 
 
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO k = 1, klev
+      DO i = 1, klon
+        delp(i, k) = paprs(i, k) - paprs(i, k + 1)
+      END DO
+    END DO
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+          aux_var2(i) = source_tr(i, itr)
+        ENDDO
+      ENDDO
+      IF (iflag_conv==2) THEN
+        ! Tiedke
+        CALL cltrac_spl(pdtphys, coefh, yu1, yv1, t_seri, tmp_var, &
+                aux_var2, paprs, pplay, aux_var3)
+
+      ELSE IF (iflag_conv>=3) THEN
+        !KE
+        CALL cltrac(pdtphys, coefh, t_seri, tmp_var, aux_var2, paprs, pplay, &
+                delp, aux_var3, d_tr_dry, flux_tr_dry(:, itr))
       ENDIF
 
-!
-
-       DO k = 1, klev
+      DO i = 1, klon
+        DO j = 1, klev
+          tr_seri(i, j, itr) = tmp_var(i, j)
+          d_tr(i, j, itr) = aux_var3(i, j)
+          d_tr_cl(i, j, itr) = d_tr(i, j, itr)
+        ENDDO
+      ENDDO
+      DO k = 1, klev
         DO i = 1, klon
-         delp(i,k) = paprs(i,k)-paprs(i,k+1)
-        END DO
-      END DO
-!
-      DO itr=1,nbtr
-      DO j=1, klev
-      DO i=1, klon
-        tmp_var(i,j)=tr_seri(i,j,itr)
-        aux_var2(i)=source_tr(i,itr)
-      ENDDO
-      ENDDO
-      IF (iflag_conv==2) THEN
-! Tiedke
-      CALL cltrac_spl(pdtphys,coefh,yu1,yv1,t_seri,tmp_var,  &
-                 aux_var2,paprs,pplay,aux_var3)
-
-      ELSE IF (iflag_conv>=3) THEN
-!KE
-      CALL cltrac(pdtphys, coefh,t_seri,tmp_var,aux_var2,paprs,pplay,  &
-                 delp,aux_var3,d_tr_dry,flux_tr_dry(:,itr))
+          tr_seri(i, k, itr) = tr_seri(i, k, itr) + d_tr(i, k, itr)
+        ENDDO
+      ENDDO
+      print *, ' AFTER Cltrac'
+      IF (lminmax) THEN
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after cltrac')
       ENDIF
-
-      DO i=1, klon
-      DO j=1, klev
-        tr_seri(i,j,itr)=tmp_var(i,j)
-        d_tr(i,j,itr)=aux_var3(i,j)
-        d_tr_cl(i,j,itr)=d_tr(i,j,itr)
-      ENDDO
-      ENDDO
-      DO k = 1, klev
-      DO i = 1, klon
-         tr_seri(i,k,itr) = tr_seri(i,k,itr) + d_tr(i,k,itr)
-      ENDDO
-      ENDDO
-      print *,' AFTER Cltrac'
-      IF (lminmax) THEN
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after cltrac')
-      ENDIF
-      ENDDO !--end itr loop
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_cltr=dife*MAX(0,SIGN(1,dife))     &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_cltr=tia_cltr+REAL(ti_cltr)/REAL(clock_rate)
-      ENDIF
-
-
-
-!======================================================================
-!    -- Calcul de l'effet des thermiques for KE--
-!======================================================================
+    ENDDO !--end itr loop
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_cltr = dife * MAX(0, SIGN(1, dife))     &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_cltr = tia_cltr + REAL(ti_cltr) / REAL(clock_rate)
+    ENDIF
+
+
+
+    !======================================================================
+    !    -- Calcul de l'effet des thermiques for KE--
+    !======================================================================
 
 #ifdef IOPHYS_DUST
@@ -2494,194 +2418,187 @@
 
 
-      IF (iflag_conv>=3) THEN
+    IF (iflag_conv>=3) THEN
 
       IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+        CALL SYSTEM_CLOCK(COUNT = clock_start)
       ENDIF
 
-
-
-
-      
-       IF (lminmax) THEN
-        DO itr=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before therm')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before therm')
-        ENDDO
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before therm')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before therm')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'before therm')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'before therm')
+      ENDIF
+
+      DO itr = 1, nbtr
+        DO k = 1, klev
+          DO i = 1, klon
+            tmp_var3(i, k, itr) = tr_seri(i, k, itr)
+            d_tr_th(i, k, itr) = 0.
+            tr_seri(i, k, itr) = MAX(tr_seri(i, k, itr), 0.)
+            !JE: precursor >>1e10         tr_seri(i,k,itr)=MIN(tr_seri(i,k,itr),1.e10)
+          END DO
+        END DO
+      END DO
+
+      !JE  new implicit scheme 20140323
+      DO itr = 1, nbtr
+        CALL thermcell_dq(klon, klev, 1, pdtphys, fm_therm, entr_therm, &
+                zmasse, tr_seri(1:klon, 1:klev, itr), &
+                d_tr(1:klon, 1:klev, itr), ztra_th, 0)
+
+        DO k = 1, klev
+          DO i = 1, klon
+            d_tr(i, k, itr) = pdtphys * d_tr(i, k, itr)
+            d_tr_th(i, k, itr) = d_tr_th(i, k, itr) + d_tr(i, k, itr)
+            tr_seri(i, k, itr) = MAX(tr_seri(i, k, itr) + d_tr(i, k, itr), 0.)
+          END DO
+        END DO
+
+      ENDDO
+
+      ! old scheme explicit
+      !       nsplit=10
+      !       DO itr=1,nbtr
+      !          DO isplit=1,nsplit
+      !              CALL dqthermcell(klon,klev,pdtphys/nsplit,
+      !     .            fm_therm,entr_therm,zmasse,
+      !     .            tr_seri(1:klon,1:klev,itr),
+      !     .            d_tr(1:klon,1:klev,itr),ztra_th)
+      !            DO k=1,klev
+      !               DO i=1,klon
+      !                  d_tr(i,k,itr)=pdtphys*d_tr(i,k,itr)/nsplit
+      !                  d_tr_th(i,k,itr)=d_tr_th(i,k,itr)+d_tr(i,k,itr)
+      !                  tr_seri(i,k,itr)=MAX(tr_seri(i,k,itr)+d_tr(i,k,itr),0.)
+      !               END DO
+      !            END DO
+      !         END DO ! nsplit1
+      !      END DO ! it
+      !JE end modif 20140323
+
+      DO itr = 1, nbtr
+        DO k = 1, klev
+          DO i = 1, klon
+            tmp_var(i, k) = tr_seri(i, k, itr) - tmp_var3(i, k, itr)
+          ENDDO
+        ENDDO
+        IF (lminmax) THEN
+          IF (lcheckmass) THEN
+            CALL checkmass(tmp_var(:, :), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'dtr therm ')
+          ENDIF
+        ENDIF
+        CALL kg_to_cm3(pplay, t_seri, tmp_var)
+
+        DO k = 1, klev
+          DO i = 1, klon
+            his_th(i, itr) = his_th(i, itr) + &
+                    (tmp_var(i, k)) / RNAVO * &
+                            masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+          END DO !klon
+        END DO !klev
+
+      END DO !it
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after therm')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after therm')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'after therm')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'after therm')
+      ENDIF
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_end)
+        dife = clock_end - clock_start
+        ti_ther = dife * MAX(0, SIGN(1, dife))   &
+                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+        tia_ther = tia_ther + REAL(ti_ther) / REAL(clock_rate)
+      ENDIF
+
+    ENDIF ! iflag_conv KE
+    !------------------------------------
+    !      Sedimentation
+    !-----------------------------------
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO !--end itr loop
+    iscm3 = .true.
+    !--------------------------------------
+    print *, ' BEFORE Sediment'
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_sedi')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before sedi')
+      ENDDO
       IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'before therm')
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'before sedi')
         ENDDO
       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'before therm')
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: before sedi')
+    ENDIF
+
+    print *, 'SPLA VERSION OF SEDIMENTATION IS USED'
+    CALL sediment_mod(t_seri, pplay, zrho, paprs, pdtphys, RHcl, &
+            id_coss, id_codu, id_scdu, &
+            ok_chimeredust, &
+            sed_ss, sed_dust, sed_dustsco, &
+            sed_ss3D, sed_dust3D, sed_dustsco3D, tr_seri)
+    CALL cm3_to_kg(pplay, t_seri, sed_ss3D)
+    CALL cm3_to_kg(pplay, t_seri, sed_dust3D)
+    CALL cm3_to_kg(pplay, t_seri, sed_dustsco3D)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_sedi')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after sedi')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after sedi')
+        ENDDO
       ENDIF
-
-      DO itr=1,nbtr
-         DO k=1,klev
-            DO i=1,klon
-               tmp_var3(i,k,itr)=tr_seri(i,k,itr)
-               d_tr_th(i,k,itr)=0.
-               tr_seri(i,k,itr)=MAX(tr_seri(i,k,itr),0.)
-!JE: precursor >>1e10         tr_seri(i,k,itr)=MIN(tr_seri(i,k,itr),1.e10)
-            END DO
-         END DO
-      END DO
-
-!JE  new implicit scheme 20140323
-      DO itr=1,nbtr
-        CALL thermcell_dq(klon,klev,1,pdtphys,fm_therm,entr_therm,  &
-                         zmasse,tr_seri(1:klon,1:klev,itr),         &
-                         d_tr(1:klon,1:klev,itr),ztra_th,0 )
-
-        DO k=1,klev
-           DO i=1,klon
-              d_tr(i,k,itr)=pdtphys*d_tr(i,k,itr)
-              d_tr_th(i,k,itr)=d_tr_th(i,k,itr)+d_tr(i,k,itr)
-              tr_seri(i,k,itr)=MAX(tr_seri(i,k,itr)+d_tr(i,k,itr),0.)
-              END DO
-        END DO
-
-      ENDDO
-
-! old scheme explicit
-!       nsplit=10
-!       DO itr=1,nbtr
-!          DO isplit=1,nsplit
-!              CALL dqthermcell(klon,klev,pdtphys/nsplit, 
-!     .            fm_therm,entr_therm,zmasse, 
-!     .            tr_seri(1:klon,1:klev,itr),
-!     .            d_tr(1:klon,1:klev,itr),ztra_th)
-!            DO k=1,klev
-!               DO i=1,klon
-!                  d_tr(i,k,itr)=pdtphys*d_tr(i,k,itr)/nsplit
-!                  d_tr_th(i,k,itr)=d_tr_th(i,k,itr)+d_tr(i,k,itr)
-!                  tr_seri(i,k,itr)=MAX(tr_seri(i,k,itr)+d_tr(i,k,itr),0.)
-!               END DO
-!            END DO
-!         END DO ! nsplit1
-!      END DO ! it
-!JE end modif 20140323
-
-      DO itr=1,nbtr
-         DO k=1,klev
-            DO i=1,klon
-          tmp_var(i,k)=tr_seri(i,k,itr)-tmp_var3(i,k,itr)
-            ENDDO
-         ENDDO
-       IF (lminmax) THEN
-      IF (lcheckmass) THEN
-         CALL checkmass(tmp_var(:,:),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'dtr therm ')
-      ENDIF
-       ENDIF
-         CALL kg_to_cm3(pplay,t_seri,tmp_var)
-
-         DO k=1,klev
-            DO i=1,klon
-               his_th(i,itr)=his_th(i,itr)+    &
-                           (tmp_var(i,k))/RNAVO*   &
-                     masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys
-            END DO !klon
-         END DO !klev
-
-      END DO !it
-       IF (lminmax) THEN
-        DO itr=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after therm')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after therm')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,   &
-           pplay,t_seri,iscm3,'after therm')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'after therm')
-       ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_ther=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_ther=tia_ther+REAL(ti_ther)/REAL(clock_rate)
-      ENDIF
-
-
-      ENDIF ! iflag_conv KE
-!------------------------------------
-!      Sedimentation
-!-----------------------------------
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-
-      DO itr=1,nbtr
-      DO j=1,klev
-      DO i=1,klon
-         tmp_var(i,j)=tr_seri(i,j,itr)
-      ENDDO
-      ENDDO
-      CALL kg_to_cm3(pplay,t_seri,tmp_var)
-      DO j=1,klev
-      DO i=1,klon
-         tr_seri(i,j,itr)=tmp_var(i,j)
-      ENDDO
-      ENDDO
-      ENDDO !--end itr loop
-      iscm3=.true.
-!--------------------------------------
-      print *,' BEFORE Sediment'
-
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before_sedi')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before sedi')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,   &
-           pplay,t_seri,iscm3,'before sedi')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before sedi')
-      ENDIF
-
-      print *,'SPLA VERSION OF SEDIMENTATION IS USED'
-      CALL sediment_mod(t_seri,pplay,zrho,paprs,pdtphys,RHcl,   & 
-                                     id_coss,id_codu,id_scdu,  &
-                                     ok_chimeredust,           &
-                         sed_ss,sed_dust,sed_dustsco,          &
-                         sed_ss3D,sed_dust3D,sed_dustsco3D,tr_seri)
-      CALL cm3_to_kg(pplay,t_seri,sed_ss3D)
-      CALL cm3_to_kg(pplay,t_seri,sed_dust3D)
-      CALL cm3_to_kg(pplay,t_seri,sed_dustsco3D)
-
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_sedi')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after sedi')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'after sedi')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after sedi')
-      ENDIF
-
-!
-!=======================================================================
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after sedi')
+    ENDIF
+
+    !=======================================================================
 #ifdef IOPHYS_DUST
       do itr=1,nbtr
@@ -2691,90 +2608,83 @@
 #endif
 
-
-
-!
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_sedi=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_sedi=tia_sedi+REAL(ti_sedi)/REAL(clock_rate)
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_sedi = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_sedi = tia_sedi + REAL(ti_sedi) / REAL(clock_rate)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL cm3_to_kg(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .false.
+
+
+    !======================================================================
+    !                      GAS TO PARTICLE CONVERSION
+    !======================================================================
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_beforegastopar')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before gastopar')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'before gastopar')
+        ENDDO
       ENDIF
-
-      DO itr=1,nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-      iscm3=.false.
-!
-!
-!======================================================================
-!                      GAS TO PARTICLE CONVERSION      
-!======================================================================
-!
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: before gastopar')
+    ENDIF
+
+    CALL gastoparticle(pdtphys, zdz, zrho, rlat, &
+            pplay, t_seri, id_prec, id_fine, &
+            tr_seri, his_g2pgas, his_g2paer)
+
+    IF (lminmax) THEN
+      DO itr = 1, nbtr
+        CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_gastopar')
+      ENDDO
+      DO itr = 1, nbtr
+        CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after gastopar')
+      ENDDO
+      IF (lcheckmass) THEN
+        DO itr = 1, nbtr
+          CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                  pplay, t_seri, iscm3, 'after gastopar')
+        ENDDO
       ENDIF
-
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_beforegastopar')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before gastopar')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'before gastopar')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before gastopar')
-      ENDIF
-
-      CALL gastoparticle(pdtphys,zdz,zrho,rlat, &
-                   pplay,t_seri,id_prec,id_fine, &
-                   tr_seri,his_g2pgas ,his_g2paer) 
-!
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_gastopar')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after gastopar')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'after gastopar')
-        ENDDO
-       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after gastopar')
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_gasp=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_gasp=tia_gasp+REAL(ti_gasp)/REAL(clock_rate)
-      ENDIF
-
-
-!
-!======================================================================
-!          EFFECT OF PRECIPITATION: iflag_conv=2
-!======================================================================
-!
+      CALL minmaxsource(source_tr, qmin, qmax, 'src: after gastopar')
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_gasp = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_gasp = tia_gasp + REAL(ti_gasp) / REAL(clock_rate)
+    ENDIF
+
+    !======================================================================
+    !          EFFECT OF PRECIPITATION: iflag_conv=2
+    !======================================================================
 
 #ifdef IOPHYS_DUST
@@ -2786,171 +2696,161 @@
 
 
-      IF (iflag_conv==2) THEN
+    IF (iflag_conv==2) THEN
 
       IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+        CALL SYSTEM_CLOCK(COUNT = clock_start)
       ENDIF
 
-
-
-
-       DO itr=1,nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-       iscm3=.true.
-!------------------------------
-
-      print *,'iflag_conv bef lessiv',iflag_conv
+      DO itr = 1, nbtr
+        DO j = 1, klev
+          DO i = 1, klon
+            tmp_var(i, j) = tr_seri(i, j, itr)
+          ENDDO
+        ENDDO
+        CALL kg_to_cm3(pplay, t_seri, tmp_var)
+        DO j = 1, klev
+          DO i = 1, klon
+            tr_seri(i, j, itr) = tmp_var(i, j)
+          ENDDO
+        ENDDO
+      ENDDO
+      iscm3 = .true.
+      !------------------------------
+
+      print *, 'iflag_conv bef lessiv', iflag_conv
       IF (lessivage) THEN
-!
-      print *,' BEFORE Incloud'
-
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before_incloud')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before incloud')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'before incloud')
-        ENDDO
+
+        print *, ' BEFORE Incloud'
+
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_incloud')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before incloud')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'before incloud')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: before incloud')
+        ENDIF
+
+
+        !      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
+        !     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
+
+        !     .                                     his_dhlsc,his_dhcon,tr_seri)
+        print *, 'iflag_conv bef incloud', iflag_conv
+
+        IF (iflag_conv==2) THEN
+          ! Tiedke
+          CALL incloud_scav(.false., qmin, qmax, masse, henry, kk, prfl, &
+                  psfl, pmflxr, pmflxs, zrho, zdz, t_seri, pdtphys, &
+                  his_dhlsc, his_dhcon, tr_seri)
+
+          !---------- to use this option please comment lsc_scav at the end
+          !        ELSE IF (iflag_conv.GE.3) THEN
+
+          !      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
+          !     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
+          !     .                                     his_dhlsc,his_dhcon,tr_seri)
+          !--------------------------------------------------------------
+
+        ENDIF
+
+        print *, ' BEFORE blcloud (after incloud)'
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_blcloud')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before blcloud')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'before blcloud')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: before blcloud')
+        ENDIF
+
+        !      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
+        !     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
+        !     .                                  his_dhbclsc,his_dhbccon,tr_seri)
+
+        IF (iflag_conv==2) THEN
+          ! Tiedke
+
+          CALL blcloud_scav(.false., qmin, qmax, pdtphys, prfl, psfl, &
+                  pmflxr, pmflxs, zdz, alpha_r, alpha_s, masse, &
+                  his_dhbclsc, his_dhbccon, tr_seri)
+
+          !---------- to use this option please comment lsc_scav at the end
+          !           and comment IF iflag=2 after "EFFECT OF PRECIPITATION:"
+
+
+          !        ELSE IF (iflag_conv.GE.3) THEN
+
+          !      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
+          !     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
+          !     .                                  his_dhbclsc,his_dhbccon,tr_seri)
+
+          !----------------------------------------------------------------------
+        ENDIF
+
+        print *, ' AFTER blcloud '
+
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_blcloud')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after blcloud')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'after blcloud')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: after blcloud')
+        ENDIF
+
+      ENDIF !--lessivage
+
+      DO itr = 1, nbtr
+        DO j = 1, klev
+          DO i = 1, klon
+            tmp_var(i, j) = tr_seri(i, j, itr)
+          ENDDO
+        ENDDO
+        CALL cm3_to_kg(pplay, t_seri, tmp_var)
+        DO j = 1, klev
+          DO i = 1, klon
+            tr_seri(i, j, itr) = tmp_var(i, j)
+          ENDDO
+        ENDDO
+      ENDDO
+      iscm3 = .false.
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_end)
+        dife = clock_end - clock_start
+        ti_wetap = dife * MAX(0, SIGN(1, dife))    &
+                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+        tia_wetap = tia_wetap + REAL(ti_wetap) / REAL(clock_rate)
       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before incloud')
-      ENDIF
-
-
-!      CALL incloud_scav(lminmax,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-      print *,'iflag_conv bef incloud',iflag_conv
-
-        IF (iflag_conv==2) THEN
-! Tiedke
-      CALL incloud_scav(.false.,qmin,qmax,masse,henry,kk,prfl,          &
-                       psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,     &
-                                          his_dhlsc,his_dhcon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL incloud_scav_lsc(.false.,qmin,qmax,masse,henry,kk,prfl,
-!     .                  psfl,pmflxr,pmflxs,zrho,zdz,t_seri,pdtphys,
-!     .                                     his_dhlsc,his_dhcon,tr_seri)
-!--------------------------------------------------------------
-
-        ENDIF
-!
-!
-      print *,' BEFORE blcloud (after incloud)'
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before_blcloud')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before blcloud')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,   &
-           pplay,t_seri,iscm3,'before blcloud')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before blcloud')
-      ENDIF
-
-!      CALL blcloud_scav(lminmax,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-
-        IF (iflag_conv==2) THEN
-! Tiedke
-
-      CALL blcloud_scav(.false.,qmin,qmax,pdtphys,prfl,psfl,     &
-                       pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,  &
-                                       his_dhbclsc,his_dhbccon,tr_seri)
-
-!---------- to use this option please comment lsc_scav at the end
-!           and comment IF iflag=2 after "EFFECT OF PRECIPITATION:"
-!        
-!
-!        ELSE IF (iflag_conv.GE.3) THEN
-!
-!      CALL blcloud_scav_lsc(.false.,qmin,qmax,pdtphys,prfl,psfl,
-!     .                  pmflxr,pmflxs,zdz,alpha_r,alpha_s,masse,
-!     .                                  his_dhbclsc,his_dhbccon,tr_seri)
-!
-!----------------------------------------------------------------------
-        ENDIF
-
-
-      print *,' AFTER blcloud '
-
-      IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_blcloud')
-        ENDDO                           
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after blcloud')
-        ENDDO                                  
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'after blcloud')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after blcloud')
-      ENDIF
-
-
-      ENDIF !--lessivage
-
-      DO itr=1,nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-       iscm3=.false.
-!
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_wetap=dife*MAX(0,SIGN(1,dife))    &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_wetap=tia_wetap+REAL(ti_wetap)/REAL(clock_rate)
-      ENDIF
-
-
-
-
-      ENDIF ! iflag_conv=2
-
-!
-!
-!======================================================================
-!                         EFFECT OF CONVECTION 
-!======================================================================
-!
+
+    ENDIF ! iflag_conv=2
+
+
+    !======================================================================
+    !                         EFFECT OF CONVECTION
+    !======================================================================
+
 #ifdef IOPHYS_DUST
       do itr=1,nbtr
@@ -2961,179 +2861,175 @@
 
 
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    IF (convection) THEN
+
+      print *, ' BEFORE trconvect'
+
+      IF (lminmax) THEN
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_trconve')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before trconve')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'before trconve')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'src: before trconve')
       ENDIF
 
 
-      IF (convection) THEN
-!
-      print *,' BEFORE trconvect'
-
+      ! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
+      !     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
+      !     .                                                 dtrconv,tr_seri)
+      ! -------------------------------------------------------------
+      IF (iflag_conv==2) THEN
+        ! Tiedke
+        CALL trconvect(pplay, t_seri, pdtphys, pmfu, pmfd, pen_u, pde_u, &
+                pen_d, pde_d, paprs, zdz, xconv, qmin, qmax, .false., masse, &
+                dtrconv, tr_seri)
+        DO itr = 1, nbtr
+          d_tr_cv(:, :, itr) = 0.
+        ENDDO
+
+      ELSE IF (iflag_conv>=3) THEN
+        ! KE
+        print *, 'JE: KE in phytracr_spl'
+        DO itr = 1, nbtr
+          DO k = 1, klev
+            DO i = 1, klon
+              tmp_var3(i, k, itr) = tr_seri(i, k, itr)
+            END DO
+          END DO
+        ENDDO
+
+        DO itr = 1, nbtr
+          !          routine for aerosols . otherwise, check cvltrorig
+          print *, 'Check sum before cvltr itr)', itr, SUM(tr_seri(:, :, itr))
+          !           IF (.FALSE.) THEN
+          CALL cvltr_spl(pdtphys, da, phi, phi2, d1a, dam, mp, ep, &
+                  sigd, sij, wght_cvfd, clw, elij, epmlmMm, eplaMm, &
+                  pmflxr, pmflxs, evapls, t_seri, wdtrainA, wdtrainM, &
+                  !            paprs,itr,tr_seri,upwd,dnwd,itop_con,ibas_con,        &
+                  paprs, itr, tmp_var3, upwd, dnwd, itop_con, ibas_con, &
+                  henry, kk, zrho, ccntrAA_spla, ccntrENV_spla, coefcoli_spla, &
+                  id_prec, id_fine, id_coss, id_codu, id_scdu, &
+                  d_tr_cv, d_tr_trsp, d_tr_sscav, d_tr_sat, d_tr_uscav, qDi, qPr, &
+                  qPa, qMel, qTrdi, dtrcvMA, Mint, &
+                  zmfd1a, zmfphi2, zmfdam)
+          !           ENDIF
+
+          !           IF (.FALSE.) THEN
+          !           CALL cvltr(pdtphys, da, phi,phi2,d1a,dam, mp,ep,
+          !     .       sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,
+          !     .       pmflxr,pmflxs,evapls,t_seri,wdtrainA,wdtrainM,
+          !     .       paprs,itr,tmp_var3,upwd,dnwd,itop_con,ibas_con,
+          !     .       d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,
+          !     .       qPa,qMel,qTrdi,dtrcvMA,Mint,
+          !     .       zmfd1a,zmfphi2,zmfdam)
+          !!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
+          !           ENDIF
+
+
+
+          !!!!!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
+          !!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
+          !!!     .               upwd,dnwd,d_tr_cv)
+          !             print *,'justbefore cvltrnoscav it= ',it
+          !             CALL checknanqfi(da(:,:),1.,-1.,' da')
+          !             CALL checknanqfi(wght_cvfd(:,:),1.,-1.,'weigth ')
+          !             CALL checknanqfi(mp(:,:),1.,-1.,'mp ')
+          !             CALL checknanqfi(paprs(:,:),1.,-1.,'paprs ')
+          !             CALL checknanqfi(pplay(:,:),1.,-1.,'pplay ')
+          !             CALL checknanqfi(tmp_var3(:,:,itr),1.,-1.,'tmp_var3 ')
+          !             CALL checknanqfi(upwd(:,:),1.,-1.,'upwd ')
+          !             CALL checknanqfi(dnwd(:,:),1.,-1.,'dnwd ')
+          !             CALL checknanqfi(d_tr_cv(:,:,itr),1.,-1.,'d_tr_cv ')
+          !             IF (.TRUE.) THEN
+          !             CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,
+          !     .            pplay,tmp_var3,upwd,dnwd,d_tr_cv)
+          !             ENDIF
+          DO k = 1, klev
+            DO i = 1, klon
+              !               tr_seri(i,k,itr) = tr_seri(i,k,itr) + d_tr_cv(i,k,itr)
+              tr_seri(i, k, itr) = (tmp_var3(i, k, itr) + d_tr_cv(i, k, itr))
+              tmp_var(i, k) = d_tr_cv(i, k, itr)
+
+            END DO
+          END DO
+
+          CALL kg_to_cm3(pplay, t_seri, tmp_var) !just for his_* computation
+
+          DO k = 1, klev
+            DO i = 1, klon
+              dtrconv(i, itr) = 0.0
+              his_dhkecv(i, itr) = his_dhkecv(i, itr) - tmp_var(i, k)  &
+                      / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+            END DO
+          END DO
+
+          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+          CALL kg_to_cm3(pplay, t_seri, tmp_var) !just for his_* computation
+
+          DO k = 1, klev
+            DO i = 1, klon
+              dtrconv(i, itr) = 0.0
+              his_ds(i, itr) = his_ds(i, itr) - tmp_var(i, k)  &
+                      / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+            END DO
+          END DO
+          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+          IF (lminmax) THEN
+
+            print *, 'Check sum after cvltr itr)', itr, SUM(tr_seri(:, :, itr))
+            CALL minmaxqfi2(d_tr_cv(:, :, itr), qmin, qmax, 'd_tr_cv:')
+            CALL minmaxqfi2(d_tr_trsp(:, :, itr), qmin, qmax, 'd_tr_trsp:')
+            CALL minmaxqfi2(d_tr_sscav(:, :, itr), qmin, qmax, 'd_tr_sscav:')
+            CALL minmaxqfi2(d_tr_sat(:, :, itr), qmin, qmax, 'd_tr_sat:')
+            CALL minmaxqfi2(d_tr_uscav(:, :, itr), qmin, qmax, 'd_tr_uscav:')
+            IF (lcheckmass) THEN
+              CALL checkmass(d_tr_cv(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, .false., 'd_tr_cv:')
+            ENDIF
+          ENDIF
+        ENDDO ! it=1,nbtr
+
+      ENDIF ! iflag_conv
       IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before_trconve')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before trconve')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'before trconve')
-        ENDDO
+        DO itr = 1, nbtr
+          CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_trcon')
+        ENDDO
+        DO itr = 1, nbtr
+          CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after trconv')
+        ENDDO
+        IF (lcheckmass) THEN
+          DO itr = 1, nbtr
+            CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                    pplay, t_seri, iscm3, 'after trconv')
+          ENDDO
+        ENDIF
+        CALL minmaxsource(source_tr, qmin, qmax, 'src: after trconv')
       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before trconve')
-      ENDIF
-
-
-! JE        CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,
-!     .             pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,lminmax,masse,
-!     .                                                 dtrconv,tr_seri)
-! -------------------------------------------------------------     
-        IF (iflag_conv==2) THEN
-! Tiedke
-         CALL trconvect(pplay,t_seri,pdtphys,pmfu,pmfd,pen_u,pde_u,  &
-                  pen_d,pde_d,paprs,zdz,xconv,qmin,qmax,.false.,masse, &
-                                                      dtrconv,tr_seri)
-         DO itr=1,nbtr
-           d_tr_cv(:,:,itr)=0.
-         ENDDO
-
-        ELSE IF (iflag_conv>=3) THEN
-! KE
-         print *,'JE: KE in phytracr_spl'
-         DO itr=1,nbtr
-             DO k = 1, klev
-              DO i = 1, klon
-               tmp_var3(i,k,itr)=tr_seri(i,k,itr)
-              END DO
-             END DO
-         ENDDO
-
-         DO itr=1,nbtr
-!          routine for aerosols . otherwise, check cvltrorig
-         print *,'Check sum before cvltr itr)',itr,SUM(tr_seri(:,:,itr))
-!           IF (.FALSE.) THEN 
-           CALL cvltr_spl(pdtphys, da, phi,phi2,d1a,dam, mp,ep,    &
-            sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,           &
-            pmflxr,pmflxs,evapls,t_seri,wdtrainA,wdtrainM,          &
-!            paprs,itr,tr_seri,upwd,dnwd,itop_con,ibas_con,        &
-            paprs,itr,tmp_var3,upwd,dnwd,itop_con,ibas_con,        &
-            henry,kk,zrho,ccntrAA_spla,ccntrENV_spla,coefcoli_spla, &
-            id_prec,id_fine,id_coss, id_codu, id_scdu,              &
-            d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr, &
-            qPa,qMel,qTrdi,dtrcvMA,Mint,                            &
-            zmfd1a,zmfphi2,zmfdam)
-!           ENDIF
-!
-!           IF (.FALSE.) THEN 
-!           CALL cvltr(pdtphys, da, phi,phi2,d1a,dam, mp,ep,
-!     .       sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,
-!     .       pmflxr,pmflxs,evapls,t_seri,wdtrainA,wdtrainM,
-!     .       paprs,itr,tmp_var3,upwd,dnwd,itop_con,ibas_con,
-!     .       d_tr_cv,d_tr_trsp,d_tr_sscav,d_tr_sat,d_tr_uscav,qDi,qPr,
-!     .       qPa,qMel,qTrdi,dtrcvMA,Mint,
-!     .       zmfd1a,zmfphi2,zmfdam)
-!!  pas lessivage convectif pou n'est pas un aerosol (i/else with cvltr)
-!           ENDIF
-
-
-
-!!!!!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tr_seri,
-!!!         CALL cvltrorig(it,pdtphys, da, phi,mp,paprs,pplay,tmp_var3,
-!!!     .               upwd,dnwd,d_tr_cv)
-!             print *,'justbefore cvltrnoscav it= ',it
-!             CALL checknanqfi(da(:,:),1.,-1.,' da')
-!             CALL checknanqfi(wght_cvfd(:,:),1.,-1.,'weigth ')
-!             CALL checknanqfi(mp(:,:),1.,-1.,'mp ')
-!             CALL checknanqfi(paprs(:,:),1.,-1.,'paprs ')
-!             CALL checknanqfi(pplay(:,:),1.,-1.,'pplay ')
-!             CALL checknanqfi(tmp_var3(:,:,itr),1.,-1.,'tmp_var3 ')
-!             CALL checknanqfi(upwd(:,:),1.,-1.,'upwd ')
-!             CALL checknanqfi(dnwd(:,:),1.,-1.,'dnwd ')
-!             CALL checknanqfi(d_tr_cv(:,:,itr),1.,-1.,'d_tr_cv ')
-!             IF (.TRUE.) THEN
-!             CALL cvltr_noscav(it,pdtphys, da, phi,mp,wght_cvfd,paprs,
-!     .            pplay,tmp_var3,upwd,dnwd,d_tr_cv)
-!             ENDIF
-             DO k = 1, klev
-              DO i = 1, klon
-!               tr_seri(i,k,itr) = tr_seri(i,k,itr) + d_tr_cv(i,k,itr)
-               tr_seri(i,k,itr)=(tmp_var3(i,k,itr)+d_tr_cv(i,k,itr))
-               tmp_var(i,k)=d_tr_cv(i,k,itr)
-
-              END DO
-             END DO
-
-        CALL kg_to_cm3(pplay,t_seri,tmp_var) !just for his_* computation
-
-             DO k = 1, klev
-              DO i = 1, klon
-               dtrconv(i,itr)=0.0
-               his_dhkecv(i,itr)=his_dhkecv(i,itr)-tmp_var(i,k)  &
-                     /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys
-              END DO
-             END DO
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        CALL kg_to_cm3(pplay,t_seri,tmp_var) !just for his_* computation
-
-             DO k = 1, klev
-              DO i = 1, klon
-               dtrconv(i,itr)=0.0
-               his_ds(i,itr)=his_ds(i,itr)-tmp_var(i,k)  &
-                     /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys
-              END DO
-             END DO
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       IF (lminmax) THEN
-
-         print *,'Check sum after cvltr itr)',itr,SUM(tr_seri(:,:,itr))
-        CALL minmaxqfi2(d_tr_cv(:,:,itr),qmin,qmax,'d_tr_cv:')
-        CALL minmaxqfi2(d_tr_trsp(:,:,itr),qmin,qmax,'d_tr_trsp:')
-        CALL minmaxqfi2(d_tr_sscav(:,:,itr),qmin,qmax,'d_tr_sscav:')
-        CALL minmaxqfi2(d_tr_sat(:,:,itr),qmin,qmax,'d_tr_sat:')
-        CALL minmaxqfi2(d_tr_uscav(:,:,itr),qmin,qmax,'d_tr_uscav:')
-      IF (lcheckmass) THEN
-        CALL checkmass(d_tr_cv(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,.false.,'d_tr_cv:')
-      ENDIF
-       ENDIF
-         ENDDO ! it=1,nbtr
-
-        ENDIF ! iflag_conv
-       IF (lminmax) THEN
-        DO itr=1,nbtr
-        CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_trcon')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after trconv')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz, &
-           pplay,t_seri,iscm3,'after trconv')
-        ENDDO
-      ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after trconv')
-      ENDIF
-      ENDIF ! convection
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_cvltr=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_cvltr=tia_cvltr+REAL(ti_cvltr)/REAL(clock_rate)
-      ENDIF
-
-
-
-!
-!
-!=======================================================================
-!      LARGE SCALE SCAVENGING KE
-!=======================================================================
-!     
+    ENDIF ! convection
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_cvltr = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_cvltr = tia_cvltr + REAL(ti_cvltr) / REAL(clock_rate)
+    ENDIF
+
+
+    !=======================================================================
+    !      LARGE SCALE SCAVENGING KE
+    !=======================================================================
+
 #ifdef IOPHYS_DUST
       call iophys_ecrit('da',klev,'da','',da)
@@ -3164,122 +3060,117 @@
 
 
-       IF (iflag_conv>=3) THEN
-       IF (logitime) THEN
-       CALL SYSTEM_CLOCK(COUNT=clock_start)
-       ENDIF
-
-
-       IF (lessivage)  THEN
-       print *,' BEFORE lsc_scav '
-       IF (lminmax) THEN
-        DO itr=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_before_lsc_scav')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'before lsc_scav')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz,  &
-           pplay,t_seri,iscm3,'before lsc_scav')
-        ENDDO
+    IF (iflag_conv>=3) THEN
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_start)
       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: before lsc_scav')
+
+      IF (lessivage)  THEN
+        print *, ' BEFORE lsc_scav '
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_before_lsc_scav')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'before lsc_scav')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'before lsc_scav')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: before lsc_scav')
+        ENDIF
+
+        ql_incloud_ref = 10.e-4
+        ql_incloud_ref = 5.e-4
+        ! calcul du contenu en eau liquide au sein du nuage
+        ql_incl = ql_incloud_ref
+        ! choix du lessivage
+        IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN
+          !IF (.false.) THEN  ! test #DFB (Binta) sans lsc_scav_spl
+          print *, 'JE iflag_lscav', iflag_lscav
+          DO itr = 1, nbtr
+
+            !       incloud scavenging and removal by large scale rain ! orig : ql_incl
+            !         was replaced by 0.5e-3 kg/kg
+            !          the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR
+            !         Liu (2001) proposed to use 1.5e-3 kg/kg
+
+            !       CALL lsc_scav_orig(pdtphys,itr,iflag_lscav,ql_incl,prfl,psfl,
+            !     .               rneb,beta_fisrt, beta_v1,pplay,paprs,
+            !     .               t_seri,tr_seri,d_tr_insc,
+            !     .               d_tr_bcscav,d_tr_evapls,qPrls)
+            CALL lsc_scav_spl(pdtphys, itr, iflag_lscav, ql_incl, prfl, psfl, &
+                    rneb, beta_fisrt, beta_v1, pplay, paprs, &
+                    t_seri, tr_seri, d_tr_insc, &
+                    alpha_r, alpha_s, kk, henry, &
+                    id_prec, id_fine, id_coss, id_codu, id_scdu, &
+                    d_tr_bcscav, d_tr_evapls, qPrls)
+
+            !large scale scavenging tendency
+            DO k = 1, klev
+              DO i = 1, klon
+                d_tr_ls(i, k, itr) = d_tr_insc(i, k, itr) + d_tr_bcscav(i, k, itr) &
+                        + d_tr_evapls(i, k, itr)
+                tr_seri(i, k, itr) = tr_seri(i, k, itr) + d_tr_ls(i, k, itr)
+                tmp_var(i, k) = d_tr_ls(i, k, itr)
+              ENDDO
+            ENDDO
+
+            CALL kg_to_cm3(pplay, t_seri, tmp_var)
+
+            DO k = 1, klev
+              DO i = 1, klon
+                his_dhkelsc(i, itr) = his_dhkelsc(i, itr) - tmp_var(i, k)    &
+                        / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+
+              END DO
+            END DO
+
+          END DO  !it=1,nbtr
+
+        ELSE
+          print *, 'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
+          DO itr = 1, nbtr
+            DO i = 1, klon
+              his_dhkelsc(i, itr) = 0.0
+            END DO  ! klon
+          END DO  !it=1,nbtr
+        ENDIF !iflag_lscav
+
+        print *, ' AFTER lsc_scav '
+        IF (lminmax) THEN
+          DO itr = 1, nbtr
+            CALL checknanqfi(tr_seri(:, :, itr), qmin, qmax, 'nan_after_lsc_scav')
+          ENDDO
+          DO itr = 1, nbtr
+            CALL minmaxqfi2(tr_seri(:, :, itr), qmin, qmax, 'after lsc_scav')
+          ENDDO
+          IF (lcheckmass) THEN
+            DO itr = 1, nbtr
+              CALL checkmass(tr_seri(:, :, itr), RNAVO, masse(itr), zdz, &
+                      pplay, t_seri, iscm3, 'after lsc_scav')
+            ENDDO
+          ENDIF
+          CALL minmaxsource(source_tr, qmin, qmax, 'src: after lsc_scav')
+        ENDIF
+
+      ENDIF ! lessivage
+
+      IF (logitime) THEN
+        CALL SYSTEM_CLOCK(COUNT = clock_end)
+        dife = clock_end - clock_start
+        ti_lscs = dife * MAX(0, SIGN(1, dife))   &
+                + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+        tia_lscs = tia_lscs + REAL(ti_lscs) / REAL(clock_rate)
       ENDIF
 
-
-
-       ql_incloud_ref = 10.e-4
-       ql_incloud_ref =  5.e-4
-! calcul du contenu en eau liquide au sein du nuage
-       ql_incl = ql_incloud_ref
-! choix du lessivage
-      IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN
-      !IF (.false.) THEN  ! test #DFB (Binta) sans lsc_scav_spl
-        print *,'JE iflag_lscav',iflag_lscav
-        DO itr=1,nbtr
-
-!       incloud scavenging and removal by large scale rain ! orig : ql_incl
-!         was replaced by 0.5e-3 kg/kg
-!          the value 0.5e-3 kg/kg is from Giorgi and Chameides (1986), JGR
-!         Liu (2001) proposed to use 1.5e-3 kg/kg
-
-!       CALL lsc_scav_orig(pdtphys,itr,iflag_lscav,ql_incl,prfl,psfl,
-!     .               rneb,beta_fisrt, beta_v1,pplay,paprs,
-!     .               t_seri,tr_seri,d_tr_insc, 
-!     .               d_tr_bcscav,d_tr_evapls,qPrls)
-          CALL lsc_scav_spl(pdtphys,itr,iflag_lscav,ql_incl,prfl,psfl,  &
-                    rneb,beta_fisrt, beta_v1,pplay,paprs,      &
-                    t_seri,tr_seri,d_tr_insc,                  &
-                    alpha_r,alpha_s,kk, henry,                 &
-                    id_prec,id_fine,id_coss, id_codu, id_scdu, &
-                    d_tr_bcscav,d_tr_evapls,qPrls)
-
-!large scale scavenging tendency
-          DO k = 1, klev
-           DO i = 1, klon
-                d_tr_ls(i,k,itr)=d_tr_insc(i,k,itr)+d_tr_bcscav(i,k,itr) &
-                        +d_tr_evapls(i,k,itr)
-                tr_seri(i,k,itr)=tr_seri(i,k,itr)+d_tr_ls(i,k,itr)
-                         tmp_var(i,k)=d_tr_ls(i,k,itr)
-           ENDDO
-          ENDDO
-
-          CALL kg_to_cm3(pplay,t_seri,tmp_var)
-
-          DO k=1,klev
-           DO i=1,klon
-            his_dhkelsc(i,itr)=his_dhkelsc(i,itr)-tmp_var(i,k)    &
-                     /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys
-     
-           END DO
-          END DO
-
-        END DO  !it=1,nbtr
-
-      ELSE
-        print *,'WARNING: NO lsc_scav, Please choose iflag_lscav=3 or 4'
-        DO itr=1,nbtr
-          DO i=1,klon
-            his_dhkelsc(i,itr)=0.0
-          END DO  ! klon
-         END DO  !it=1,nbtr
-      ENDIF !iflag_lscav 
-
-       print *,' AFTER lsc_scav '
-       IF (lminmax) THEN
-        DO itr=1,nbtr
-       CALL checknanqfi(tr_seri(:,:,itr),qmin,qmax,'nan_after_lsc_scav')
-        ENDDO
-        DO itr=1,nbtr
-        CALL minmaxqfi2(tr_seri(:,:,itr),qmin,qmax,'after lsc_scav')
-        ENDDO
-      IF (lcheckmass) THEN
-        DO itr=1,nbtr
-         CALL checkmass(tr_seri(:,:,itr),RNAVO,masse(itr),zdz, &
-           pplay,t_seri,iscm3,'after lsc_scav')
-        ENDDO
-       ENDIF
-        CALL minmaxsource(source_tr,qmin,qmax,'src: after lsc_scav')
-      ENDIF
-
-      ENDIF ! lessivage
- 
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_lscs=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_lscs=tia_lscs+REAL(ti_lscs)/REAL(clock_rate)
-      ENDIF
-
-
-
-      ENDIF !iflag_conv
-
- 
-!=======================================================================
-!                         COMPUTING THE BURDEN
-!=======================================================================
+    ENDIF !iflag_conv
+
+
+    !=======================================================================
+    !                         COMPUTING THE BURDEN
+    !=======================================================================
 #ifdef IOPHYS_DUST
       do itr=1,nbtr
@@ -3289,272 +3180,263 @@
 #endif
 
-!   
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
-      ENDIF
-
-  
-      DO itr=1,nbtr
-        DO j=1,klev
-        DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-        DO j=1,klev
-        DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-        ENDDO
-        ENDDO
-      ENDDO
-       iscm3=.true.
-
-!
-! Computing burden in mg/m2
-      DO itr=1,nbtr
-      DO k=1, klev
-      DO i=1, klon
-        trm(i,itr)=trm(i,itr)+tr_seri(i,k,itr)*1.e6*zdz(i,k)*  &
-                 masse(itr)*1.e3/RNAVO     !--mg S/m2
-      ENDDO
-      ENDDO
-      ENDDO
-!
-! Computing Surface concentration in ug/m3
-!
-      DO itr=1,nbtr
-      DO i=1, klon
-        sconc_seri(i,itr)=tr_seri(i,1,itr)*1.e6* &
-                 masse(itr)*1.e3/RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
-      ENDDO
-      ENDDO
-!
-!=======================================================================
-!                  CALCULATION OF OPTICAL PROPERTIES
-!=======================================================================
-!      
-      CALL aeropt_spl(zdz, tr_seri, RHcl,                                 &
-                        id_prec, id_fine, id_coss, id_codu, id_scdu,     &
-                        ok_chimeredust,                                 &
-                    diff_aod550_tot, diag_aod670_tot, diag_aod865_tot,     &
-                    diff_aod550_tr2, diag_aod670_tr2, diag_aod865_tr2,     &
-                    diag_aod550_ss,  diag_aod670_ss,  diag_aod865_ss,        &
-                    diag_aod550_dust,diag_aod670_dust,diag_aod865_dust,  &
-           diag_aod550_dustsco,diag_aod670_dustsco,diag_aod865_dustsco)  
-
-
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-      dife=clock_end-clock_start
-      ti_brop=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_brop=tia_brop+REAL(ti_brop)/REAL(clock_rate)
-      ENDIF
-
-
-!=======================================================================
-!   MODIS terra/aqua simulation output
-!=======================================================================
-      masque_aqua_cur(:)=0
-      masque_terra_cur(:)=0
-
-      CALL satellite_out_spla(jD_cur,jH_cur,pdtphys,rlat,rlon,   &
-                              masque_aqua_cur, masque_terra_cur )
-      IF (jH_cur-pdtphys/86400. < 0.) THEN
-       !new utc day: put in 0 everything
-!JE20150518<<
-       masque_aqua(:) =0
-       masque_terra(:) =0
-       aod550_terra(:)=0.  
-       aod550_tr2_terra(:)=0.  
-       aod550_ss_terra(:)=0.   
-       aod550_dust_terra(:)=0.   
-       aod550_dustsco_terra(:)=0.   
-       aod670_terra(:)=0.   
-       aod670_tr2_terra(:)=0.  
-       aod670_ss_terra(:)=0.  
-       aod670_dust_terra(:)=0.  
-       aod670_dustsco_terra(:)=0.  
-       aod865_terra(:)=0.   
-       aod865_tr2_terra(:)=0.  
-       aod865_ss_terra(:)=0.  
-       aod865_dust_terra(:)=0.  
-       aod865_dustsco_terra(:)=0.  
-       aod550_aqua(:)=0.  
-       aod550_tr2_aqua(:)=0.  
-       aod550_ss_aqua(:)=0.   
-       aod550_dust_aqua(:)=0.   
-       aod550_dustsco_aqua(:)=0.   
-       aod670_aqua(:)=0.   
-       aod670_tr2_aqua(:)=0.  
-       aod670_ss_aqua(:)=0.  
-       aod670_dust_aqua(:)=0.  
-       aod670_dustsco_aqua(:)=0.  
-       aod865_aqua(:)=0.   
-       aod865_tr2_aqua(:)=0.  
-       aod865_ss_aqua(:)=0.  
-       aod865_dust_aqua(:)=0.  
-       aod865_dustsco_aqua(:)=0.  
-!JE20150518>>
-      ENDIF
-
-      DO i=1,klon
-
-       aod550_terra(i)=aod550_terra(i)+   &
-                       masque_terra_cur(i)*diff_aod550_tot(i)
-       aod550_tr2_terra(i)= aod550_tr2_terra(i)+ &
-                       masque_terra_cur(i)*diff_aod550_tr2(i)
-       aod550_ss_terra(i)=aod550_ss_terra(i) + &
-                       masque_terra_cur(i)*diag_aod550_ss(i)
-       aod550_dust_terra(i)=  aod550_dust_terra(i) + &
-                       masque_terra_cur(i)*diag_aod550_dust(i)
-       aod550_dustsco_terra(i)= aod550_dustsco_terra(i) + &
-                       masque_terra_cur(i)*diag_aod550_dustsco(i)
-       aod670_terra(i)=aod670_terra(i)+   &
-                       masque_terra_cur(i)*diag_aod670_tot(i)
-       aod670_tr2_terra(i)= aod670_tr2_terra(i)+ &
-                       masque_terra_cur(i)*diag_aod670_tr2(i)
-       aod670_ss_terra(i)=aod670_ss_terra(i) + &
-                       masque_terra_cur(i)*diag_aod670_ss(i)
-       aod670_dust_terra(i)=  aod670_dust_terra(i) + &
-                       masque_terra_cur(i)*diag_aod670_dust(i)
-       aod670_dustsco_terra(i)= aod670_dustsco_terra(i) + &
-                       masque_terra_cur(i)*diag_aod670_dustsco(i)
-       aod865_terra(i)=aod865_terra(i)+   &
-                       masque_terra_cur(i)*diag_aod865_tot(i)
-       aod865_tr2_terra(i)= aod865_tr2_terra(i)+ &
-                       masque_terra_cur(i)*diag_aod865_tr2(i)
-       aod865_ss_terra(i)=aod865_ss_terra(i) + &
-                       masque_terra_cur(i)*diag_aod865_ss(i)
-       aod865_dust_terra(i)=  aod865_dust_terra(i) + &
-                       masque_terra_cur(i)*diag_aod865_dust(i)
-       aod865_dustsco_terra(i)= aod865_dustsco_terra(i) + &
-                       masque_terra_cur(i)*diag_aod865_dustsco(i)
-
-
-
-       aod550_aqua(i)=aod550_aqua(i)+   &
-                       masque_aqua_cur(i)*diff_aod550_tot(i)
-       aod550_tr2_aqua(i)= aod550_tr2_aqua(i)+ &
-                       masque_aqua_cur(i)*diff_aod550_tr2(i)
-       aod550_ss_aqua(i)=aod550_ss_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod550_ss(i)
-       aod550_dust_aqua(i)=  aod550_dust_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod550_dust(i)
-       aod550_dustsco_aqua(i)= aod550_dustsco_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod550_dustsco(i)
-       aod670_aqua(i)=aod670_aqua(i)+   &
-                       masque_aqua_cur(i)*diag_aod670_tot(i)
-       aod670_tr2_aqua(i)= aod670_tr2_aqua(i)+ &
-                       masque_aqua_cur(i)*diag_aod670_tr2(i)
-       aod670_ss_aqua(i)=aod670_ss_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod670_ss(i)
-       aod670_dust_aqua(i)=  aod670_dust_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod670_dust(i)
-       aod670_dustsco_aqua(i)= aod670_dustsco_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod670_dustsco(i)
-       aod865_aqua(i)=aod865_aqua(i)+   &
-                       masque_aqua_cur(i)*diag_aod865_tot(i)
-       aod865_tr2_aqua(i)= aod865_tr2_aqua(i)+ &
-                       masque_aqua_cur(i)*diag_aod865_tr2(i)
-       aod865_ss_aqua(i)=aod865_ss_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod865_ss(i)
-       aod865_dust_aqua(i)=  aod865_dust_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod865_dust(i)
-       aod865_dustsco_aqua(i)= aod865_dustsco_aqua(i) + &
-                       masque_aqua_cur(i)*diag_aod865_dustsco(i)
-
-               masque_aqua(i)=masque_aqua(i)+masque_aqua_cur(i)
-         masque_terra(i)=masque_terra(i)+masque_terra_cur(i)
-      ENDDO
-
-      IF (jH_cur+pdtphys/86400. >= 1.) THEN
-!          print *,'last step of the day'
-          DO i=1,klon
-               IF (masque_aqua(i)> 0) THEN
-                   aod550_aqua(i)=aod550_aqua(i)/masque_aqua(i)
-                   aod670_aqua(i)=aod670_aqua(i)/masque_aqua(i)
-                   aod865_aqua(i)=aod865_aqua(i)/masque_aqua(i)
-                   aod550_tr2_aqua(i)=aod550_tr2_aqua(i)/masque_aqua(i)
-                   aod670_tr2_aqua(i)=aod670_tr2_aqua(i)/masque_aqua(i)
-                   aod865_tr2_aqua(i)=aod865_tr2_aqua(i)/masque_aqua(i)
-                   aod550_ss_aqua(i)=aod550_ss_aqua(i)/masque_aqua(i)
-                   aod670_ss_aqua(i)=aod670_ss_aqua(i)/masque_aqua(i)
-                   aod865_ss_aqua(i)=aod865_ss_aqua(i)/masque_aqua(i)
-                   aod550_dust_aqua(i)=aod550_dust_aqua(i)/masque_aqua(i)
-                   aod670_dust_aqua(i)=aod670_dust_aqua(i)/masque_aqua(i)
-                   aod865_dust_aqua(i)=aod865_dust_aqua(i)/masque_aqua(i)
-                   aod550_dustsco_aqua(i)=aod550_dustsco_aqua(i)/masque_aqua(i)
-                   aod670_dustsco_aqua(i)=aod670_dustsco_aqua(i)/masque_aqua(i)
-                   aod865_dustsco_aqua(i)=aod865_dustsco_aqua(i)/masque_aqua(i)
-               ELSE 
-                   aod550_aqua(i) = -999.
-                   aod670_aqua(i) = -999.
-                   aod865_aqua(i) = -999.
-                   aod550_tr2_aqua(i)= -999.
-                   aod670_tr2_aqua(i)= -999.
-                   aod865_tr2_aqua(i)= -999.
-                   aod550_ss_aqua(i)= -999.
-                   aod670_ss_aqua(i)= -999.
-                   aod865_ss_aqua(i)= -999.
-                   aod550_dust_aqua(i)= -999.
-                   aod670_dust_aqua(i)= -999.
-                   aod865_dust_aqua(i)= -999.
-                   aod550_dustsco_aqua(i)= -999.
-                   aod670_dustsco_aqua(i)= -999.
-                   aod865_dustsco_aqua(i)= -999.
-               ENDIF
-               IF (masque_terra(i)> 0) THEN
-                   aod550_terra(i)=aod550_terra(i)/masque_terra(i)
-                   aod670_terra(i)=aod670_terra(i)/masque_terra(i)
-                   aod865_terra(i)=aod865_terra(i)/masque_terra(i)
-                   aod550_tr2_terra(i)=aod550_tr2_terra(i)/masque_terra(i)
-                   aod670_tr2_terra(i)=aod670_tr2_terra(i)/masque_terra(i)
-                   aod865_tr2_terra(i)=aod865_tr2_terra(i)/masque_terra(i)
-                   aod550_ss_terra(i)=aod550_ss_terra(i)/masque_terra(i)
-                   aod670_ss_terra(i)=aod670_ss_terra(i)/masque_terra(i)
-                   aod865_ss_terra(i)=aod865_ss_terra(i)/masque_terra(i)
-                   aod550_dust_terra(i)=aod550_dust_terra(i)/masque_terra(i)
-                   aod670_dust_terra(i)=aod670_dust_terra(i)/masque_terra(i)
-                   aod865_dust_terra(i)=aod865_dust_terra(i)/masque_terra(i)
-                   aod550_dustsco_terra(i)=aod550_dustsco_terra(i)/masque_terra(i)
-                   aod670_dustsco_terra(i)=aod670_dustsco_terra(i)/masque_terra(i)
-                   aod865_dustsco_terra(i)=aod865_dustsco_terra(i)/masque_terra(i)
-               ELSE 
-                   aod550_terra(i) = -999.
-                   aod670_terra(i) = -999.
-                   aod865_terra(i) = -999.
-                   aod550_tr2_terra(i)= -999.
-                   aod670_tr2_terra(i)= -999.
-                   aod865_tr2_terra(i)= -999.
-                   aod550_ss_terra(i)= -999.
-                   aod670_ss_terra(i)= -999.
-                   aod865_ss_terra(i)= -999.
-                   aod550_dust_terra(i)= -999.
-                   aod670_dust_terra(i)= -999.
-                   aod865_dust_terra(i)= -999.
-                   aod550_dustsco_terra(i)= -999.
-                   aod670_dustsco_terra(i)= -999.
-                   aod865_dustsco_terra(i)= -999.
-               ENDIF
-          ENDDO          
-
-!!AS deleting lines
-!!      IF (ok_histrac) THEN
-!!!!      write in output file
-!!----many deleted lines
-!!      ENDIF  !mpi_root
-!!!$OMP END MASTER
-!!!$OMP BARRIER
-!!      ENDIF  !--ok_histrac
-
-      ENDIF ! jH_cur...
-
-
-!
-!======================================================================
-!  Stockage sur bande histoire
-!======================================================================
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .true.
+
+    ! Computing burden in mg/m2
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          trm(i, itr) = trm(i, itr) + tr_seri(i, k, itr) * 1.e6 * zdz(i, k) * &
+                  masse(itr) * 1.e3 / RNAVO     !--mg S/m2
+        ENDDO
+      ENDDO
+    ENDDO
+
+    ! Computing Surface concentration in ug/m3
+
+    DO itr = 1, nbtr
+      DO i = 1, klon
+        sconc_seri(i, itr) = tr_seri(i, 1, itr) * 1.e6 * &
+                masse(itr) * 1.e3 / RNAVO     !--mg/m3 (tr_seri ist in g/cm3)
+      ENDDO
+    ENDDO
+
+    !=======================================================================
+    !                  CALCULATION OF OPTICAL PROPERTIES
+    !=======================================================================
+
+    CALL aeropt_spl(zdz, tr_seri, RHcl, &
+            id_prec, id_fine, id_coss, id_codu, id_scdu, &
+            ok_chimeredust, &
+            diff_aod550_tot, diag_aod670_tot, diag_aod865_tot, &
+            diff_aod550_tr2, diag_aod670_tr2, diag_aod865_tr2, &
+            diag_aod550_ss, diag_aod670_ss, diag_aod865_ss, &
+            diag_aod550_dust, diag_aod670_dust, diag_aod865_dust, &
+            diag_aod550_dustsco, diag_aod670_dustsco, diag_aod865_dustsco)
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+      dife = clock_end - clock_start
+      ti_brop = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_brop = tia_brop + REAL(ti_brop) / REAL(clock_rate)
+    ENDIF
+
+
+    !=======================================================================
+    !   MODIS terra/aqua simulation output
+    !=======================================================================
+    masque_aqua_cur(:) = 0
+    masque_terra_cur(:) = 0
+
+    CALL satellite_out_spla(jD_cur, jH_cur, pdtphys, rlat, rlon, &
+            masque_aqua_cur, masque_terra_cur)
+    IF (jH_cur - pdtphys / 86400. < 0.) THEN
+      !new utc day: put in 0 everything
+      !JE20150518<<
+      masque_aqua(:) = 0
+      masque_terra(:) = 0
+      aod550_terra(:) = 0.
+      aod550_tr2_terra(:) = 0.
+      aod550_ss_terra(:) = 0.
+      aod550_dust_terra(:) = 0.
+      aod550_dustsco_terra(:) = 0.
+      aod670_terra(:) = 0.
+      aod670_tr2_terra(:) = 0.
+      aod670_ss_terra(:) = 0.
+      aod670_dust_terra(:) = 0.
+      aod670_dustsco_terra(:) = 0.
+      aod865_terra(:) = 0.
+      aod865_tr2_terra(:) = 0.
+      aod865_ss_terra(:) = 0.
+      aod865_dust_terra(:) = 0.
+      aod865_dustsco_terra(:) = 0.
+      aod550_aqua(:) = 0.
+      aod550_tr2_aqua(:) = 0.
+      aod550_ss_aqua(:) = 0.
+      aod550_dust_aqua(:) = 0.
+      aod550_dustsco_aqua(:) = 0.
+      aod670_aqua(:) = 0.
+      aod670_tr2_aqua(:) = 0.
+      aod670_ss_aqua(:) = 0.
+      aod670_dust_aqua(:) = 0.
+      aod670_dustsco_aqua(:) = 0.
+      aod865_aqua(:) = 0.
+      aod865_tr2_aqua(:) = 0.
+      aod865_ss_aqua(:) = 0.
+      aod865_dust_aqua(:) = 0.
+      aod865_dustsco_aqua(:) = 0.
+      !JE20150518>>
+    ENDIF
+
+    DO i = 1, klon
+
+      aod550_terra(i) = aod550_terra(i) + &
+              masque_terra_cur(i) * diff_aod550_tot(i)
+      aod550_tr2_terra(i) = aod550_tr2_terra(i) + &
+              masque_terra_cur(i) * diff_aod550_tr2(i)
+      aod550_ss_terra(i) = aod550_ss_terra(i) + &
+              masque_terra_cur(i) * diag_aod550_ss(i)
+      aod550_dust_terra(i) = aod550_dust_terra(i) + &
+              masque_terra_cur(i) * diag_aod550_dust(i)
+      aod550_dustsco_terra(i) = aod550_dustsco_terra(i) + &
+              masque_terra_cur(i) * diag_aod550_dustsco(i)
+      aod670_terra(i) = aod670_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_tot(i)
+      aod670_tr2_terra(i) = aod670_tr2_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_tr2(i)
+      aod670_ss_terra(i) = aod670_ss_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_ss(i)
+      aod670_dust_terra(i) = aod670_dust_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_dust(i)
+      aod670_dustsco_terra(i) = aod670_dustsco_terra(i) + &
+              masque_terra_cur(i) * diag_aod670_dustsco(i)
+      aod865_terra(i) = aod865_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_tot(i)
+      aod865_tr2_terra(i) = aod865_tr2_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_tr2(i)
+      aod865_ss_terra(i) = aod865_ss_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_ss(i)
+      aod865_dust_terra(i) = aod865_dust_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_dust(i)
+      aod865_dustsco_terra(i) = aod865_dustsco_terra(i) + &
+              masque_terra_cur(i) * diag_aod865_dustsco(i)
+
+      aod550_aqua(i) = aod550_aqua(i) + &
+              masque_aqua_cur(i) * diff_aod550_tot(i)
+      aod550_tr2_aqua(i) = aod550_tr2_aqua(i) + &
+              masque_aqua_cur(i) * diff_aod550_tr2(i)
+      aod550_ss_aqua(i) = aod550_ss_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod550_ss(i)
+      aod550_dust_aqua(i) = aod550_dust_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod550_dust(i)
+      aod550_dustsco_aqua(i) = aod550_dustsco_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod550_dustsco(i)
+      aod670_aqua(i) = aod670_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_tot(i)
+      aod670_tr2_aqua(i) = aod670_tr2_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_tr2(i)
+      aod670_ss_aqua(i) = aod670_ss_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_ss(i)
+      aod670_dust_aqua(i) = aod670_dust_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_dust(i)
+      aod670_dustsco_aqua(i) = aod670_dustsco_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod670_dustsco(i)
+      aod865_aqua(i) = aod865_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_tot(i)
+      aod865_tr2_aqua(i) = aod865_tr2_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_tr2(i)
+      aod865_ss_aqua(i) = aod865_ss_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_ss(i)
+      aod865_dust_aqua(i) = aod865_dust_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_dust(i)
+      aod865_dustsco_aqua(i) = aod865_dustsco_aqua(i) + &
+              masque_aqua_cur(i) * diag_aod865_dustsco(i)
+
+      masque_aqua(i) = masque_aqua(i) + masque_aqua_cur(i)
+      masque_terra(i) = masque_terra(i) + masque_terra_cur(i)
+    ENDDO
+
+    IF (jH_cur + pdtphys / 86400. >= 1.) THEN
+      !          print *,'last step of the day'
+      DO i = 1, klon
+        IF (masque_aqua(i)> 0) THEN
+          aod550_aqua(i) = aod550_aqua(i) / masque_aqua(i)
+          aod670_aqua(i) = aod670_aqua(i) / masque_aqua(i)
+          aod865_aqua(i) = aod865_aqua(i) / masque_aqua(i)
+          aod550_tr2_aqua(i) = aod550_tr2_aqua(i) / masque_aqua(i)
+          aod670_tr2_aqua(i) = aod670_tr2_aqua(i) / masque_aqua(i)
+          aod865_tr2_aqua(i) = aod865_tr2_aqua(i) / masque_aqua(i)
+          aod550_ss_aqua(i) = aod550_ss_aqua(i) / masque_aqua(i)
+          aod670_ss_aqua(i) = aod670_ss_aqua(i) / masque_aqua(i)
+          aod865_ss_aqua(i) = aod865_ss_aqua(i) / masque_aqua(i)
+          aod550_dust_aqua(i) = aod550_dust_aqua(i) / masque_aqua(i)
+          aod670_dust_aqua(i) = aod670_dust_aqua(i) / masque_aqua(i)
+          aod865_dust_aqua(i) = aod865_dust_aqua(i) / masque_aqua(i)
+          aod550_dustsco_aqua(i) = aod550_dustsco_aqua(i) / masque_aqua(i)
+          aod670_dustsco_aqua(i) = aod670_dustsco_aqua(i) / masque_aqua(i)
+          aod865_dustsco_aqua(i) = aod865_dustsco_aqua(i) / masque_aqua(i)
+        ELSE
+          aod550_aqua(i) = -999.
+          aod670_aqua(i) = -999.
+          aod865_aqua(i) = -999.
+          aod550_tr2_aqua(i) = -999.
+          aod670_tr2_aqua(i) = -999.
+          aod865_tr2_aqua(i) = -999.
+          aod550_ss_aqua(i) = -999.
+          aod670_ss_aqua(i) = -999.
+          aod865_ss_aqua(i) = -999.
+          aod550_dust_aqua(i) = -999.
+          aod670_dust_aqua(i) = -999.
+          aod865_dust_aqua(i) = -999.
+          aod550_dustsco_aqua(i) = -999.
+          aod670_dustsco_aqua(i) = -999.
+          aod865_dustsco_aqua(i) = -999.
+        ENDIF
+        IF (masque_terra(i)> 0) THEN
+          aod550_terra(i) = aod550_terra(i) / masque_terra(i)
+          aod670_terra(i) = aod670_terra(i) / masque_terra(i)
+          aod865_terra(i) = aod865_terra(i) / masque_terra(i)
+          aod550_tr2_terra(i) = aod550_tr2_terra(i) / masque_terra(i)
+          aod670_tr2_terra(i) = aod670_tr2_terra(i) / masque_terra(i)
+          aod865_tr2_terra(i) = aod865_tr2_terra(i) / masque_terra(i)
+          aod550_ss_terra(i) = aod550_ss_terra(i) / masque_terra(i)
+          aod670_ss_terra(i) = aod670_ss_terra(i) / masque_terra(i)
+          aod865_ss_terra(i) = aod865_ss_terra(i) / masque_terra(i)
+          aod550_dust_terra(i) = aod550_dust_terra(i) / masque_terra(i)
+          aod670_dust_terra(i) = aod670_dust_terra(i) / masque_terra(i)
+          aod865_dust_terra(i) = aod865_dust_terra(i) / masque_terra(i)
+          aod550_dustsco_terra(i) = aod550_dustsco_terra(i) / masque_terra(i)
+          aod670_dustsco_terra(i) = aod670_dustsco_terra(i) / masque_terra(i)
+          aod865_dustsco_terra(i) = aod865_dustsco_terra(i) / masque_terra(i)
+        ELSE
+          aod550_terra(i) = -999.
+          aod670_terra(i) = -999.
+          aod865_terra(i) = -999.
+          aod550_tr2_terra(i) = -999.
+          aod670_tr2_terra(i) = -999.
+          aod865_tr2_terra(i) = -999.
+          aod550_ss_terra(i) = -999.
+          aod670_ss_terra(i) = -999.
+          aod865_ss_terra(i) = -999.
+          aod550_dust_terra(i) = -999.
+          aod670_dust_terra(i) = -999.
+          aod865_dust_terra(i) = -999.
+          aod550_dustsco_terra(i) = -999.
+          aod670_dustsco_terra(i) = -999.
+          aod865_dustsco_terra(i) = -999.
+        ENDIF
+      ENDDO
+
+      !!AS deleting lines
+      !!      IF (ok_histrac) THEN
+      !!!!      write in output file
+      !!----many deleted lines
+      !!      ENDIF  !mpi_root
+      !!!$OMP END MASTER
+      !!!$OMP BARRIER
+      !!      ENDIF  !--ok_histrac
+
+    ENDIF ! jH_cur...
+
+    !======================================================================
+    !  Stockage sur bande histoire
+    !======================================================================
 #ifdef IOPHYS_DUST
       do itr=1,nbtr
@@ -3564,1065 +3446,1044 @@
 #endif
 
-
-!
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_start)
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_start)
+    ENDIF
+
+    DO itr = 1, nbtr
+      DO j = 1, klev
+        DO i = 1, klon
+          tmp_var(i, j) = tr_seri(i, j, itr)
+        ENDDO
+      ENDDO
+      CALL cm3_to_kg(pplay, t_seri, tmp_var)
+      DO j = 1, klev
+        DO i = 1, klon
+          tr_seri(i, j, itr) = tmp_var(i, j)
+        ENDDO
+      ENDDO
+    ENDDO
+    iscm3 = .false.
+
+
+    !======================================================================
+    !  SAVING AEROSOL RELATED VARIABLES INTO FILE
+    !======================================================================
+
+    ndex2d = 0
+    ndex3d = 0
+
+    itra = itra + 1
+
+    print *, 'SAVING VARIABLES FOR DAY ', itra
+
+    fluxbb(:) = 0.0
+    fluxff(:) = 0.0
+    fluxbcbb(:) = 0.0
+    fluxbcff(:) = 0.0
+    fluxbcnff(:) = 0.0
+    fluxbcba(:) = 0.0
+    fluxbc(:) = 0.0
+    fluxombb(:) = 0.0
+    fluxomff(:) = 0.0
+    fluxomnat(:) = 0.0
+    fluxomba(:) = 0.0
+    fluxomnff(:) = 0.0
+    fluxom(:) = 0.0
+    fluxh2sff(:) = 0.0
+    fluxh2snff(:) = 0.0
+    fluxh2sbio(:) = 0.0
+    fluxso2ff(:) = 0.0
+    fluxso2nff(:) = 0.0
+    fluxso2bb(:) = 0.0
+    fluxso2vol(:) = 0.0
+    fluxso2ba(:) = 0.0
+    fluxso2(:) = 0.0
+    fluxso4ff(:) = 0.0
+    fluxso4nff(:) = 0.0
+    fluxso4bb(:) = 0.0
+    fluxso4ba(:) = 0.0
+    fluxso4(:) = 0.0
+    fluxdms(:) = 0.0
+    fluxdustec(:) = 0.0
+    fluxddfine(:) = 0.0
+    fluxddcoa(:) = 0.0
+    fluxddsco(:) = 0.0
+    fluxdd(:) = 0.0
+    fluxssfine(:) = 0.0
+    fluxsscoa(:) = 0.0
+    fluxss(:) = 0.0
+    DO i = 1, klon
+      IF (iregion_ind(i)>0) THEN           ! LAND
+        ! SULFUR EMISSIONS
+        fluxh2sff(i) = (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * frach2sofso2 * &
+                scale_param_ind(iregion_ind(i)) * &
+                1.e4 / RNAVO * masse_s * 1.e3         ! mgS/m2/s
+        fluxso2ff(i) = scale_param_ind(iregion_ind(i)) * fracso2emis * &
+                (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * 1.e4 / RNAVO * &
+                masse_s * 1.e3  ! mgS/m2/s
+        ! SULPHATE EMISSIONS
+        fluxso4ff(i) = scale_param_ind(iregion_ind(i)) * (1 - fracso2emis) * &
+                (lmt_so2ff_l(i) + lmt_so2ff_h(i)) * 1.e4 / RNAVO * &
+                masse_s * 1.e3  ! mgS/m2/s
+        ! BLACK CARBON EMISSIONS
+        fluxbcff(i) = scale_param_ff(iregion_ind(i)) * &
+                lmt_bcff(i) * 1.e4 * 1.e3  !/g/m2/s
+        ! ORGANIC MATTER EMISSIONS
+        fluxomff(i) = scale_param_ff(iregion_ind(i)) * &
+                (lmt_omff(i)) * 1.e4 * 1.e3  !/g/m2/s
+        ! FOSSIL FUEL EMISSIONS
+        fluxff(i) = fluxbcff(i) + fluxomff(i)
       ENDIF
-
-      DO itr=1,nbtr
-         DO j=1,klev
-         DO i=1,klon
-           tmp_var(i,j)=tr_seri(i,j,itr)
-         ENDDO 
-         ENDDO
-         CALL cm3_to_kg(pplay,t_seri,tmp_var)
-         DO j=1,klev
-         DO i=1,klon
-           tr_seri(i,j,itr)=tmp_var(i,j)
-         ENDDO 
-         ENDDO
-      ENDDO
-       iscm3=.false.
-
-!
-!
-!======================================================================
-!  SAVING AEROSOL RELATED VARIABLES INTO FILE
-!======================================================================
-!
-      ndex2d = 0
-      ndex3d = 0 
-!
-      itra=itra+1
-
-      print *,'SAVING VARIABLES FOR DAY ',itra
-!
-      fluxbb(:)=0.0
-      fluxff(:)=0.0
-      fluxbcbb(:)=0.0
-      fluxbcff(:)=0.0
-      fluxbcnff(:)=0.0
-      fluxbcba(:)=0.0
-      fluxbc(:)=0.0
-      fluxombb(:)=0.0
-      fluxomff(:)=0.0
-      fluxomnat(:)=0.0
-      fluxomba(:)=0.0
-      fluxomnff(:)=0.0
-      fluxom(:)=0.0
-      fluxh2sff(:)=0.0
-      fluxh2snff(:)=0.0
-      fluxh2sbio(:)=0.0
-      fluxso2ff(:)=0.0
-      fluxso2nff(:)=0.0
-      fluxso2bb(:)=0.0
-      fluxso2vol(:)=0.0
-      fluxso2ba(:)=0.0
-      fluxso2(:)=0.0
-      fluxso4ff(:)=0.0
-      fluxso4nff(:)=0.0
-      fluxso4bb(:)=0.0
-      fluxso4ba(:)=0.0
-      fluxso4(:)=0.0
-      fluxdms(:)=0.0
-      fluxdustec(:)=0.0
-      fluxddfine(:)=0.0
-      fluxddcoa(:)=0.0
-      fluxddsco(:)=0.0
-      fluxdd(:)=0.0
-      fluxssfine(:)=0.0
-      fluxsscoa(:)=0.0
-      fluxss(:)=0.0
-      DO i=1, klon
-         IF (iregion_ind(i)>0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxh2sff(i)= (lmt_so2ff_l(i)+lmt_so2ff_h(i))*frach2sofso2*  &       
-                         scale_param_ind(iregion_ind(i))*               &
-                                    1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-           fluxso2ff(i)=scale_param_ind(iregion_ind(i)) * fracso2emis * &
-                        (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO * &
-                                                    masse_s * 1.e3  ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4ff(i)=scale_param_ind(iregion_ind(i))*(1-fracso2emis)* &
-                         (lmt_so2ff_l(i)+lmt_so2ff_h(i)) * 1.e4/RNAVO * &
-                                                    masse_s * 1.e3  ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcff(i)=scale_param_ff(iregion_ind(i))* &
-                                             lmt_bcff(i)*1.e4*1.e3  !/g/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxomff(i)=scale_param_ff(iregion_ind(i))* &
-                               (lmt_omff(i))*1.e4*1.e3  !/g/m2/s
-           ! FOSSIL FUEL EMISSIONS
-           fluxff(i)=fluxbcff(i)+fluxomff(i)
-         ENDIF
-         IF (iregion_bb(i)>0) THEN           ! LAND
-           ! SULFUR EMISSIONS
-           fluxso2bb(i) =scale_param_bb(iregion_bb(i)) * fracso2emis *  &
-                      (lmt_so2bb_l(i)+lmt_so2bb_h(i))*                 &
-                (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! SULPHATE EMISSIONS
-           fluxso4bb(i) =scale_param_bb(iregion_bb(i))*(1-fracso2emis)* &
-                      (lmt_so2bb_l(i)+lmt_so2bb_h(i))*                 &
-                (1.-pctsrf(i,is_oce))*1.e4/RNAVO*masse_s*1.e3       ! mgS/m2/s
-           ! BLACK CARBON EMISSIONS
-           fluxbcbb(i)=scale_param_bb(iregion_bb(i))*                   &
-                           (lmt_bcbb_l(i)+lmt_bcbb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! ORGANIC MATTER EMISSIONS
-           fluxombb(i)=scale_param_bb(iregion_bb(i))*                   &
-                           (lmt_ombb_l(i)+lmt_ombb_h(i))*1.e4*1.e3  !mg/m2/s
-           ! BIOMASS BURNING EMISSIONS
-           fluxbb(i)=fluxbcbb(i)+fluxombb(i)
-         ENDIF
-         ! H2S EMISSIONS
-         fluxh2sbio(i)=lmt_h2sbio(i)*1.e4/RNAVO*masse_s*1.e3      ! mgS/m2/s
-         fluxh2snff(i)= lmt_so2nff(i)*frach2sofso2*  &
-                                    1.e4/RNAVO*masse_s*1.e3         ! mgS/m2/s
-         ! SULFUR DIOXIDE EMISSIONS
-         fluxso2nff(i)=fracso2emis * lmt_so2nff(i) * 1.e4/RNAVO *  &
-                                                    masse_s * 1.e3  ! mgS/m2/s
-         fluxso2vol(i)=(lmt_so2volc_cont(i)+lmt_so2volc_expl(i))  &
-                      *1.e4/RNAVO*masse_s*1.e3        ! mgS/m2/s
-         fluxso2ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3*      &
-                                                        fracso2emis ! mgS/m2/s
-         fluxso2(i)=fluxso2ff(i)+fluxso2bb(i)+fluxso2nff(i)+   &
-                   fluxso2vol(i)+fluxso2ba(i)
-         ! DMS EMISSIONS
-         fluxdms(i)=( lmt_dms(i)+lmt_dmsbio(i) )              &
-                   *1.e4/RNAVO*masse_s*1.e3          ! mgS/m2/s
-         ! SULPHATE EMISSIONS
-         fluxso4ba(i) =lmt_so2ba(i)*1.e4/RNAVO*masse_s*1.e3        &
-                      *(1-fracso2emis) ! mgS/m2/s
-         fluxso4nff(i)=(1-fracso2emis)*lmt_so2nff(i) * 1.e4/RNAVO *  &
-                                                    masse_s * 1.e3  ! mgS/m2/s
-         fluxso4(i)=fluxso4ff(i)+fluxso4bb(i)+fluxso4ba(i)+fluxso4nff(i)
-         ! BLACK CARBON EMISSIONS
-
-         fluxbcnff(i)=lmt_bcnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxbcba(i)=lmt_bcba(i)*1.e4*1.e3    !mg/m2/s
-         fluxbc(i)=fluxbcbb(i)+fluxbcff(i)+fluxbcnff(i)+fluxbcba(i)
-         ! ORGANIC MATTER EMISSIONS
-         fluxomnat(i)=lmt_omnat(i)*1.e4*1.e3  !mg/m2/s
-         fluxomba(i)=lmt_omba(i)*1.e4*1.e3  !mg/m2/s
-         fluxomnff(i)=lmt_omnff(i)*1.e4*1.e3  !mg/m2/s
-         fluxom(i)=fluxombb(i)+fluxomff(i)+fluxomnat(i)+fluxomba(i)+  &
-                  fluxomnff(i)
-        ! DUST EMISSIONS 
-         fluxdustec(i)=dust_ec(i)*1.e6 ! old dust emission scheme 
-!JE20140605<<         old dust emission version
-!         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
-!     .                                  * dust_ec(i)*0.093*1.e6
-!         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
-!     .                                  * dust_ec(i)*0.905*1.e6
-!         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
-!JE20140605>>
-         fluxddfine(i)=flux_sparam_ddfine(i)
-         fluxddcoa(i)=flux_sparam_ddcoa(i)
-         fluxddsco(i)=flux_sparam_ddsco(i)
-         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)+fluxddsco(i)
-        ! SEA SALT EMISSIONS 
-         fluxssfine(i)=scale_param_ssacc*lmt_sea_salt(i,1)*1.e4*1.e3
-         fluxsscoa(i)=scale_param_sscoa*lmt_sea_salt(i,2)*1.e4*1.e3
-         fluxss(i)=fluxssfine(i)+fluxsscoa(i)
-      ENDDO
-
-!      prepare outputs cvltr
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_cv(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_cv_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_trsp(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_trsp_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_sscav(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_sscav_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_sat(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_sat_o(i,k,itr)=tmp_var(i,k)   &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_uscav(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_uscav_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_insc(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_insc_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-     
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_bcscav(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_bcscav_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_evapls(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_evapls_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_ls(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_ls_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_dyn(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_dyn_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_cl(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_cl_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-
-
-      DO itr=1,nbtr
-        DO k=1,klev
-        DO i=1,klon
-           tmp_var(i,k)=d_tr_th(i,k,itr)
-        ENDDO
-        ENDDO
-        CALL kg_to_cm3(pplay,t_seri,tmp_var)
-       DO k=1,klev
-        DO i=1,klon
-          d_tr_th_o(i,k,itr)=tmp_var(i,k)  &
-                         /RNAVO*masse(itr)*1.e3*1.e6*zdz(i,k)/pdtphys  
-        ENDDO
-       ENDDO
-      ENDDO
-     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-     DO itr=1,nbtr
-      WRITE(str2,'(i2.2)') itr
-       DO i=1, klon                                                        
-        his_dh(i,itr)= his_dhlsc(i,itr)+his_dhcon(i,itr)+               &
-                   his_dhbclsc(i,itr)+his_dhbccon(i,itr)
-
-       ENDDO
-      ENDDO
-
-!AS: commenting out and deleting lines 
-!!      IF (ok_histrac) THEN
-!!
-!! SAVING VARIABLES IN TRACEUR
-!!----- many lines deleted----
-!!      ENDIF ! ok_histrac                                                    
-                                                                            
-
-
-
-!JE20141224
-! saving variables for output
-! 2D outputs
-      DO i=1, klon
-       trm01(i)=0. 
-       trm02(i)=0. 
-       trm03(i)=0. 
-       trm04(i)=0. 
-       trm05(i)=0.
-       sconc01(i)=0. 
-       sconc02(i)=0. 
-       sconc03(i)=0. 
-       sconc04(i)=0. 
-       sconc05(i)=0.
-       flux01(i)=0. 
-       flux02(i)=0. 
-       flux03(i)=0. 
-       flux04(i)=0. 
-       flux05(i)=0.
-       ds01(i)=0. 
-       ds02(i)=0. 
-       ds03(i)=0. 
-       ds04(i)=0. 
-       ds05(i)=0.
-       dh01(i)=0. 
-       dh02(i)=0. 
-       dh03(i)=0. 
-       dh04(i)=0. 
-       dh05(i)=0.
-       dtrconv01(i)=0. 
-       dtrconv02(i)=0. 
-       dtrconv03(i)=0. 
-       dtrconv04(i)=0. 
-       dtrconv05(i)=0.
-       dtherm01(i)=0. 
-       dtherm02(i)=0. 
-       dtherm03(i)=0. 
-       dtherm04(i)=0. 
-       dtherm05(i)=0.
-       dhkecv01(i)=0. 
-       dhkecv02(i)=0. 
-       dhkecv03(i)=0. 
-       dhkecv04(i)=0. 
-       dhkecv05(i)=0.
-       d_tr_ds01(i)=0. 
-       d_tr_ds02(i)=0. 
-       d_tr_ds03(i)=0. 
-       d_tr_ds04(i)=0. 
-       d_tr_ds05(i)=0.
-       dhkelsc01(i)=0. 
-       dhkelsc02(i)=0. 
-       dhkelsc03(i)=0. 
-       dhkelsc04(i)=0. 
-       dhkelsc05(i)=0.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-      if(id_prec>0)  trm01(i)=trm(i,id_prec) 
-      if(id_fine>0)  trm02(i)=trm(i,id_fine) 
-      if(id_coss>0)  trm03(i)=trm(i,id_coss) 
-      if(id_codu>0)  trm04(i)=trm(i,id_codu) 
-      if(id_scdu>0)  trm05(i)=trm(i,id_scdu)
-      if(id_prec>0)    sconc01(i)=sconc_seri(i,id_prec)
-      if(id_fine>0)    sconc02(i)=sconc_seri(i,id_fine)
-      if(id_coss>0)    sconc03(i)=sconc_seri(i,id_coss)
-      if(id_codu>0)    sconc04(i)=sconc_seri(i,id_codu)
-      if(id_scdu>0)    sconc05(i)=sconc_seri(i,id_scdu)
-      if(id_prec>0)    flux01(i)=flux_tr(i,id_prec)
-      if(id_fine>0)    flux02(i)=flux_tr(i,id_fine)
-      if(id_coss>0)    flux03(i)=flux_tr(i,id_coss)
-      if(id_codu>0)    flux04(i)=flux_tr(i,id_codu)
-      if(id_scdu>0)    flux05(i)=flux_tr(i,id_scdu)
-      if(id_prec>0)    ds01(i)=his_ds(i,id_prec)
-      if(id_fine>0)    ds02(i)=his_ds(i,id_fine)
-      if(id_coss>0)    ds03(i)=his_ds(i,id_coss)
-      if(id_codu>0)    ds04(i)=his_ds(i,id_codu)
-      if(id_scdu>0)    ds05(i)=his_ds(i,id_scdu)
-      if(id_prec>0)    dh01(i)=his_dh(i,id_prec)
-      if(id_fine>0)    dh02(i)=his_dh(i,id_fine)
-      if(id_coss>0)    dh03(i)=his_dh(i,id_coss)
-      if(id_codu>0)    dh04(i)=his_dh(i,id_codu)
-      if(id_scdu>0)    dh05(i)=his_dh(i,id_scdu)
-      if(id_prec>0)    dtrconv01(i)=dtrconv(i,id_prec)
-      if(id_fine>0)    dtrconv02(i)=dtrconv(i,id_fine)
-      if(id_coss>0)    dtrconv03(i)=dtrconv(i,id_coss)
-      if(id_codu>0)    dtrconv04(i)=dtrconv(i,id_codu)
-      if(id_scdu>0)    dtrconv05(i)=dtrconv(i,id_scdu)
-      if(id_prec>0)    dtherm01(i)=his_th(i,id_prec)
-      if(id_fine>0)    dtherm02(i)=his_th(i,id_fine)
-      if(id_coss>0)    dtherm03(i)=his_th(i,id_coss)
-      if(id_codu>0)    dtherm04(i)=his_th(i,id_codu)
-      if(id_scdu>0)    dtherm05(i)=his_th(i,id_scdu)
-      if(id_prec>0)    dhkecv01(i)=his_dhkecv(i,id_prec)
-      if(id_fine>0)    dhkecv02(i)=his_dhkecv(i,id_fine)
-      if(id_coss>0)    dhkecv03(i)=his_dhkecv(i,id_coss)
-      if(id_codu>0)    dhkecv04(i)=his_dhkecv(i,id_codu)
-      if(id_scdu>0)    dhkecv05(i)=his_dhkecv(i,id_scdu)
-      if(id_prec>0)    d_tr_ds01(i)=his_ds(i,id_prec)
-      if(id_fine>0)    d_tr_ds02(i)=his_ds(i,id_fine)
-      if(id_coss>0)    d_tr_ds03(i)=his_ds(i,id_coss)
-      if(id_codu>0)    d_tr_ds04(i)=his_ds(i,id_codu)
-      if(id_scdu>0)    d_tr_ds05(i)=his_ds(i,id_scdu)
-      if(id_prec>0)    dhkelsc01(i)=his_dhkelsc(i,id_prec)
-      if(id_fine>0)    dhkelsc02(i)=his_dhkelsc(i,id_fine)
-      if(id_coss>0)    dhkelsc03(i)=his_dhkelsc(i,id_coss)
-      if(id_codu>0)    dhkelsc04(i)=his_dhkelsc(i,id_codu)
-      if(id_scdu>0)    dhkelsc05(i)=his_dhkelsc(i,id_scdu)
-       u10m_ss(i)=u10m_ec(i)
-       v10m_ss(i)=v10m_ec(i)
-      ENDDO
-! 3D outs
-      DO i=1, klon
-        DO k=1,klev
-      d_tr_cv01(i,k)   =0.
-      d_tr_cv02(i,k)   =0.
-      d_tr_cv03(i,k)   =0.
-      d_tr_cv04(i,k)   =0.
-      d_tr_cv05(i,k)   =0.
-      d_tr_trsp01(i,k) =0.
-      d_tr_trsp02(i,k) =0.
-      d_tr_trsp03(i,k) =0.
-      d_tr_trsp04(i,k) =0.
-      d_tr_trsp05(i,k) =0.
-      d_tr_sscav01(i,k)=0.
-      d_tr_sscav02(i,k)=0.
-      d_tr_sscav03(i,k)=0.
-      d_tr_sscav04(i,k)=0.
-      d_tr_sscav05(i,k)=0.
-      d_tr_sat01(i,k)  =0.
-      d_tr_sat02(i,k)  =0.
-      d_tr_sat03(i,k)  =0.
-      d_tr_sat04(i,k)  =0.
-      d_tr_sat05(i,k)  =0.
-      d_tr_uscav01(i,k)=0.
-      d_tr_uscav02(i,k)=0.
-      d_tr_uscav03(i,k)=0.
-      d_tr_uscav04(i,k)=0.
-      d_tr_uscav05(i,k)=0.
-      d_tr_insc01(i,k)=0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      d_tr_insc02(i,k)=0.
-      d_tr_insc03(i,k)=0.
-      d_tr_insc04(i,k)=0.
-      d_tr_insc05(i,k)=0.
-      d_tr_bcscav01(i,k)=0.
-      d_tr_bcscav02(i,k)=0.
-      d_tr_bcscav03(i,k)=0.
-      d_tr_bcscav04(i,k)=0.
-      d_tr_bcscav05(i,k)=0.
-      d_tr_evapls01(i,k)=0.
-      d_tr_evapls02(i,k)=0.
-      d_tr_evapls03(i,k)=0.
-      d_tr_evapls04(i,k)=0.
-      d_tr_evapls05(i,k)=0.
-      d_tr_ls01(i,k)=0.
-      d_tr_ls02(i,k)=0.
-      d_tr_ls03(i,k)=0.
-      d_tr_ls04(i,k)=0.
-      d_tr_ls05(i,k)=0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      d_tr_dyn01(i,k)=0.
-      d_tr_dyn02(i,k)=0.
-      d_tr_dyn03(i,k)=0.
-      d_tr_dyn04(i,k)=0.
-      d_tr_dyn05(i,k)=0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      d_tr_cl01(i,k)=0.
-      d_tr_cl02(i,k)=0.
-      d_tr_cl03(i,k)=0.
-      d_tr_cl04(i,k)=0.
-      d_tr_cl05(i,k)=0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-      d_tr_th01(i,k)=0.
-      d_tr_th02(i,k)=0.
-      d_tr_th03(i,k)=0.
-      d_tr_th04(i,k)=0.
-      d_tr_th05(i,k)=0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-        ENDDO
-      ENDDO
-
-      IF(1==0) THEN 
+      IF (iregion_bb(i)>0) THEN           ! LAND
+        ! SULFUR EMISSIONS
+        fluxso2bb(i) = scale_param_bb(iregion_bb(i)) * fracso2emis * &
+                (lmt_so2bb_l(i) + lmt_so2bb_h(i)) * &
+                (1. - pctsrf(i, is_oce)) * 1.e4 / RNAVO * masse_s * 1.e3       ! mgS/m2/s
+        ! SULPHATE EMISSIONS
+        fluxso4bb(i) = scale_param_bb(iregion_bb(i)) * (1 - fracso2emis) * &
+                (lmt_so2bb_l(i) + lmt_so2bb_h(i)) * &
+                (1. - pctsrf(i, is_oce)) * 1.e4 / RNAVO * masse_s * 1.e3       ! mgS/m2/s
+        ! BLACK CARBON EMISSIONS
+        fluxbcbb(i) = scale_param_bb(iregion_bb(i)) * &
+                (lmt_bcbb_l(i) + lmt_bcbb_h(i)) * 1.e4 * 1.e3  !mg/m2/s
+        ! ORGANIC MATTER EMISSIONS
+        fluxombb(i) = scale_param_bb(iregion_bb(i)) * &
+                (lmt_ombb_l(i) + lmt_ombb_h(i)) * 1.e4 * 1.e3  !mg/m2/s
+        ! BIOMASS BURNING EMISSIONS
+        fluxbb(i) = fluxbcbb(i) + fluxombb(i)
+      ENDIF
+      ! H2S EMISSIONS
+      fluxh2sbio(i) = lmt_h2sbio(i) * 1.e4 / RNAVO * masse_s * 1.e3      ! mgS/m2/s
+      fluxh2snff(i) = lmt_so2nff(i) * frach2sofso2 * &
+              1.e4 / RNAVO * masse_s * 1.e3         ! mgS/m2/s
+      ! SULFUR DIOXIDE EMISSIONS
+      fluxso2nff(i) = fracso2emis * lmt_so2nff(i) * 1.e4 / RNAVO * &
+              masse_s * 1.e3  ! mgS/m2/s
+      fluxso2vol(i) = (lmt_so2volc_cont(i) + lmt_so2volc_expl(i))  &
+              * 1.e4 / RNAVO * masse_s * 1.e3        ! mgS/m2/s
+      fluxso2ba(i) = lmt_so2ba(i) * 1.e4 / RNAVO * masse_s * 1.e3 * &
+              fracso2emis ! mgS/m2/s
+      fluxso2(i) = fluxso2ff(i) + fluxso2bb(i) + fluxso2nff(i) + &
+              fluxso2vol(i) + fluxso2ba(i)
+      ! DMS EMISSIONS
+      fluxdms(i) = (lmt_dms(i) + lmt_dmsbio(i))              &
+              * 1.e4 / RNAVO * masse_s * 1.e3          ! mgS/m2/s
+      ! SULPHATE EMISSIONS
+      fluxso4ba(i) = lmt_so2ba(i) * 1.e4 / RNAVO * masse_s * 1.e3        &
+              * (1 - fracso2emis) ! mgS/m2/s
+      fluxso4nff(i) = (1 - fracso2emis) * lmt_so2nff(i) * 1.e4 / RNAVO * &
+              masse_s * 1.e3  ! mgS/m2/s
+      fluxso4(i) = fluxso4ff(i) + fluxso4bb(i) + fluxso4ba(i) + fluxso4nff(i)
+      ! BLACK CARBON EMISSIONS
+
+      fluxbcnff(i) = lmt_bcnff(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxbcba(i) = lmt_bcba(i) * 1.e4 * 1.e3    !mg/m2/s
+      fluxbc(i) = fluxbcbb(i) + fluxbcff(i) + fluxbcnff(i) + fluxbcba(i)
+      ! ORGANIC MATTER EMISSIONS
+      fluxomnat(i) = lmt_omnat(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxomba(i) = lmt_omba(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxomnff(i) = lmt_omnff(i) * 1.e4 * 1.e3  !mg/m2/s
+      fluxom(i) = fluxombb(i) + fluxomff(i) + fluxomnat(i) + fluxomba(i) + &
+              fluxomnff(i)
+      ! DUST EMISSIONS
+      fluxdustec(i) = dust_ec(i) * 1.e6 ! old dust emission scheme
+      !JE20140605<<         old dust emission version
+      !         fluxddfine(i)=scale_param_dustacc(iregion_dust(i))
+      !     .                                  * dust_ec(i)*0.093*1.e6
+      !         fluxddcoa(i)=scale_param_dustcoa(iregion_dust(i))
+      !     .                                  * dust_ec(i)*0.905*1.e6
+      !         fluxdd(i)=fluxddfine(i)+fluxddcoa(i)
+      !JE20140605>>
+      fluxddfine(i) = flux_sparam_ddfine(i)
+      fluxddcoa(i) = flux_sparam_ddcoa(i)
+      fluxddsco(i) = flux_sparam_ddsco(i)
+      fluxdd(i) = fluxddfine(i) + fluxddcoa(i) + fluxddsco(i)
+      ! SEA SALT EMISSIONS
+      fluxssfine(i) = scale_param_ssacc * lmt_sea_salt(i, 1) * 1.e4 * 1.e3
+      fluxsscoa(i) = scale_param_sscoa * lmt_sea_salt(i, 2) * 1.e4 * 1.e3
+      fluxss(i) = fluxssfine(i) + fluxsscoa(i)
+    ENDDO
+
+    !      prepare outputs cvltr
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_cv(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_cv_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_trsp(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_trsp_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_sscav(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_sscav_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_sat(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_sat_o(i, k, itr) = tmp_var(i, k)   &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_uscav(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_uscav_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_insc(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_insc_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_bcscav(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_bcscav_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_evapls(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_evapls_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_ls(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_ls_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_dyn(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_dyn_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_cl(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_cl_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+
+    DO itr = 1, nbtr
+      DO k = 1, klev
+        DO i = 1, klon
+          tmp_var(i, k) = d_tr_th(i, k, itr)
+        ENDDO
+      ENDDO
+      CALL kg_to_cm3(pplay, t_seri, tmp_var)
+      DO k = 1, klev
+        DO i = 1, klon
+          d_tr_th_o(i, k, itr) = tmp_var(i, k)  &
+                  / RNAVO * masse(itr) * 1.e3 * 1.e6 * zdz(i, k) / pdtphys
+        ENDDO
+      ENDDO
+    ENDDO
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+    DO itr = 1, nbtr
+      WRITE(str2, '(i2.2)') itr
+      DO i = 1, klon
+        his_dh(i, itr) = his_dhlsc(i, itr) + his_dhcon(i, itr) + &
+                his_dhbclsc(i, itr) + his_dhbccon(i, itr)
+
+      ENDDO
+    ENDDO
+
+    !AS: commenting out and deleting lines
+    !!      IF (ok_histrac) THEN
+    !!
+    !! SAVING VARIABLES IN TRACEUR
+    !!----- many lines deleted----
+    !!      ENDIF ! ok_histrac
+
+
+
+
+    !JE20141224
+    ! saving variables for output
+    ! 2D outputs
+    DO i = 1, klon
+      trm01(i) = 0.
+      trm02(i) = 0.
+      trm03(i) = 0.
+      trm04(i) = 0.
+      trm05(i) = 0.
+      sconc01(i) = 0.
+      sconc02(i) = 0.
+      sconc03(i) = 0.
+      sconc04(i) = 0.
+      sconc05(i) = 0.
+      flux01(i) = 0.
+      flux02(i) = 0.
+      flux03(i) = 0.
+      flux04(i) = 0.
+      flux05(i) = 0.
+      ds01(i) = 0.
+      ds02(i) = 0.
+      ds03(i) = 0.
+      ds04(i) = 0.
+      ds05(i) = 0.
+      dh01(i) = 0.
+      dh02(i) = 0.
+      dh03(i) = 0.
+      dh04(i) = 0.
+      dh05(i) = 0.
+      dtrconv01(i) = 0.
+      dtrconv02(i) = 0.
+      dtrconv03(i) = 0.
+      dtrconv04(i) = 0.
+      dtrconv05(i) = 0.
+      dtherm01(i) = 0.
+      dtherm02(i) = 0.
+      dtherm03(i) = 0.
+      dtherm04(i) = 0.
+      dtherm05(i) = 0.
+      dhkecv01(i) = 0.
+      dhkecv02(i) = 0.
+      dhkecv03(i) = 0.
+      dhkecv04(i) = 0.
+      dhkecv05(i) = 0.
+      d_tr_ds01(i) = 0.
+      d_tr_ds02(i) = 0.
+      d_tr_ds03(i) = 0.
+      d_tr_ds04(i) = 0.
+      d_tr_ds05(i) = 0.
+      dhkelsc01(i) = 0.
+      dhkelsc02(i) = 0.
+      dhkelsc03(i) = 0.
+      dhkelsc04(i) = 0.
+      dhkelsc05(i) = 0.
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      if(id_prec>0)  trm01(i) = trm(i, id_prec)
+      if(id_fine>0)  trm02(i) = trm(i, id_fine)
+      if(id_coss>0)  trm03(i) = trm(i, id_coss)
+      if(id_codu>0)  trm04(i) = trm(i, id_codu)
+      if(id_scdu>0)  trm05(i) = trm(i, id_scdu)
+      if(id_prec>0)    sconc01(i) = sconc_seri(i, id_prec)
+      if(id_fine>0)    sconc02(i) = sconc_seri(i, id_fine)
+      if(id_coss>0)    sconc03(i) = sconc_seri(i, id_coss)
+      if(id_codu>0)    sconc04(i) = sconc_seri(i, id_codu)
+      if(id_scdu>0)    sconc05(i) = sconc_seri(i, id_scdu)
+      if(id_prec>0)    flux01(i) = flux_tr(i, id_prec)
+      if(id_fine>0)    flux02(i) = flux_tr(i, id_fine)
+      if(id_coss>0)    flux03(i) = flux_tr(i, id_coss)
+      if(id_codu>0)    flux04(i) = flux_tr(i, id_codu)
+      if(id_scdu>0)    flux05(i) = flux_tr(i, id_scdu)
+      if(id_prec>0)    ds01(i) = his_ds(i, id_prec)
+      if(id_fine>0)    ds02(i) = his_ds(i, id_fine)
+      if(id_coss>0)    ds03(i) = his_ds(i, id_coss)
+      if(id_codu>0)    ds04(i) = his_ds(i, id_codu)
+      if(id_scdu>0)    ds05(i) = his_ds(i, id_scdu)
+      if(id_prec>0)    dh01(i) = his_dh(i, id_prec)
+      if(id_fine>0)    dh02(i) = his_dh(i, id_fine)
+      if(id_coss>0)    dh03(i) = his_dh(i, id_coss)
+      if(id_codu>0)    dh04(i) = his_dh(i, id_codu)
+      if(id_scdu>0)    dh05(i) = his_dh(i, id_scdu)
+      if(id_prec>0)    dtrconv01(i) = dtrconv(i, id_prec)
+      if(id_fine>0)    dtrconv02(i) = dtrconv(i, id_fine)
+      if(id_coss>0)    dtrconv03(i) = dtrconv(i, id_coss)
+      if(id_codu>0)    dtrconv04(i) = dtrconv(i, id_codu)
+      if(id_scdu>0)    dtrconv05(i) = dtrconv(i, id_scdu)
+      if(id_prec>0)    dtherm01(i) = his_th(i, id_prec)
+      if(id_fine>0)    dtherm02(i) = his_th(i, id_fine)
+      if(id_coss>0)    dtherm03(i) = his_th(i, id_coss)
+      if(id_codu>0)    dtherm04(i) = his_th(i, id_codu)
+      if(id_scdu>0)    dtherm05(i) = his_th(i, id_scdu)
+      if(id_prec>0)    dhkecv01(i) = his_dhkecv(i, id_prec)
+      if(id_fine>0)    dhkecv02(i) = his_dhkecv(i, id_fine)
+      if(id_coss>0)    dhkecv03(i) = his_dhkecv(i, id_coss)
+      if(id_codu>0)    dhkecv04(i) = his_dhkecv(i, id_codu)
+      if(id_scdu>0)    dhkecv05(i) = his_dhkecv(i, id_scdu)
+      if(id_prec>0)    d_tr_ds01(i) = his_ds(i, id_prec)
+      if(id_fine>0)    d_tr_ds02(i) = his_ds(i, id_fine)
+      if(id_coss>0)    d_tr_ds03(i) = his_ds(i, id_coss)
+      if(id_codu>0)    d_tr_ds04(i) = his_ds(i, id_codu)
+      if(id_scdu>0)    d_tr_ds05(i) = his_ds(i, id_scdu)
+      if(id_prec>0)    dhkelsc01(i) = his_dhkelsc(i, id_prec)
+      if(id_fine>0)    dhkelsc02(i) = his_dhkelsc(i, id_fine)
+      if(id_coss>0)    dhkelsc03(i) = his_dhkelsc(i, id_coss)
+      if(id_codu>0)    dhkelsc04(i) = his_dhkelsc(i, id_codu)
+      if(id_scdu>0)    dhkelsc05(i) = his_dhkelsc(i, id_scdu)
+      u10m_ss(i) = u10m_ec(i)
+      v10m_ss(i) = v10m_ec(i)
+    ENDDO
+    ! 3D outs
+    DO i = 1, klon
+      DO k = 1, klev
+        d_tr_cv01(i, k) = 0.
+        d_tr_cv02(i, k) = 0.
+        d_tr_cv03(i, k) = 0.
+        d_tr_cv04(i, k) = 0.
+        d_tr_cv05(i, k) = 0.
+        d_tr_trsp01(i, k) = 0.
+        d_tr_trsp02(i, k) = 0.
+        d_tr_trsp03(i, k) = 0.
+        d_tr_trsp04(i, k) = 0.
+        d_tr_trsp05(i, k) = 0.
+        d_tr_sscav01(i, k) = 0.
+        d_tr_sscav02(i, k) = 0.
+        d_tr_sscav03(i, k) = 0.
+        d_tr_sscav04(i, k) = 0.
+        d_tr_sscav05(i, k) = 0.
+        d_tr_sat01(i, k) = 0.
+        d_tr_sat02(i, k) = 0.
+        d_tr_sat03(i, k) = 0.
+        d_tr_sat04(i, k) = 0.
+        d_tr_sat05(i, k) = 0.
+        d_tr_uscav01(i, k) = 0.
+        d_tr_uscav02(i, k) = 0.
+        d_tr_uscav03(i, k) = 0.
+        d_tr_uscav04(i, k) = 0.
+        d_tr_uscav05(i, k) = 0.
+        d_tr_insc01(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_insc02(i, k) = 0.
+        d_tr_insc03(i, k) = 0.
+        d_tr_insc04(i, k) = 0.
+        d_tr_insc05(i, k) = 0.
+        d_tr_bcscav01(i, k) = 0.
+        d_tr_bcscav02(i, k) = 0.
+        d_tr_bcscav03(i, k) = 0.
+        d_tr_bcscav04(i, k) = 0.
+        d_tr_bcscav05(i, k) = 0.
+        d_tr_evapls01(i, k) = 0.
+        d_tr_evapls02(i, k) = 0.
+        d_tr_evapls03(i, k) = 0.
+        d_tr_evapls04(i, k) = 0.
+        d_tr_evapls05(i, k) = 0.
+        d_tr_ls01(i, k) = 0.
+        d_tr_ls02(i, k) = 0.
+        d_tr_ls03(i, k) = 0.
+        d_tr_ls04(i, k) = 0.
+        d_tr_ls05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_dyn01(i, k) = 0.
+        d_tr_dyn02(i, k) = 0.
+        d_tr_dyn03(i, k) = 0.
+        d_tr_dyn04(i, k) = 0.
+        d_tr_dyn05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_cl01(i, k) = 0.
+        d_tr_cl02(i, k) = 0.
+        d_tr_cl03(i, k) = 0.
+        d_tr_cl04(i, k) = 0.
+        d_tr_cl05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        d_tr_th01(i, k) = 0.
+        d_tr_th02(i, k) = 0.
+        d_tr_th03(i, k) = 0.
+        d_tr_th04(i, k) = 0.
+        d_tr_th05(i, k) = 0.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ENDDO
+    ENDDO
+
+    IF(1==0) THEN
       ! calcul in original trunk version; problem: budget not closed. Corrected in "ELSE"
-      DO i=1, klon
-        DO k=1,klev
-
-      if(id_prec>0)        d_tr_cv01(i,k)   =d_tr_cv_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_cv02(i,k)   =d_tr_cv_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_cv03(i,k)   =d_tr_cv_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_cv04(i,k)   =d_tr_cv_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_cv05(i,k)   =d_tr_cv_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_trsp01(i,k) =d_tr_trsp_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_trsp02(i,k) =d_tr_trsp_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_trsp03(i,k) =d_tr_trsp_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_trsp04(i,k) =d_tr_trsp_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_trsp05(i,k) =d_tr_trsp_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_sscav01(i,k)=d_tr_sscav_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_sscav02(i,k)=d_tr_sscav_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_sscav03(i,k)=d_tr_sscav_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_sscav04(i,k)=d_tr_sscav_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_sscav05(i,k)=d_tr_sscav_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_sat01(i,k)  =d_tr_sat_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_sat02(i,k)  =d_tr_sat_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_sat03(i,k)  =d_tr_sat_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_sat04(i,k)  =d_tr_sat_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_sat05(i,k)  =d_tr_sat_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_uscav01(i,k)=d_tr_uscav_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_uscav02(i,k)=d_tr_uscav_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_uscav03(i,k)=d_tr_uscav_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_uscav04(i,k)=d_tr_uscav_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_uscav05(i,k)=d_tr_uscav_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_insc01(i,k)=d_tr_insc_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_insc02(i,k)=d_tr_insc_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_insc03(i,k)=d_tr_insc_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_insc04(i,k)=d_tr_insc_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_insc05(i,k)=d_tr_insc_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_bcscav01(i,k)=d_tr_bcscav_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_bcscav02(i,k)=d_tr_bcscav_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_bcscav03(i,k)=d_tr_bcscav_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_bcscav04(i,k)=d_tr_bcscav_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_bcscav05(i,k)=d_tr_bcscav_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_evapls01(i,k)=d_tr_evapls_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_evapls02(i,k)=d_tr_evapls_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_evapls03(i,k)=d_tr_evapls_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_evapls04(i,k)=d_tr_evapls_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_evapls05(i,k)=d_tr_evapls_o(i,k,id_scdu)
-        ENDDO
-      ENDDO
-      ELSE ! correction pour fermeture de bilan, par FH dans les simus de Binta pour Habib
-      DO i=1, klon
-        DO k=1,klev
-      if(id_prec>0)        d_tr_cv01(i,k)   =d_tr_cv(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_cv02(i,k)   =d_tr_cv(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_cv03(i,k)   =d_tr_cv(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_cv04(i,k)   =d_tr_cv(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_cv05(i,k)   =d_tr_cv(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_trsp01(i,k) =d_tr_trsp(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_trsp02(i,k) =d_tr_trsp(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_trsp03(i,k) =d_tr_trsp(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_trsp04(i,k) =d_tr_trsp(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_trsp05(i,k) =d_tr_trsp(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_sscav01(i,k)=d_tr_sscav(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_sscav02(i,k)=d_tr_sscav(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_sscav03(i,k)=d_tr_sscav(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_sscav04(i,k)=d_tr_sscav(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_sscav05(i,k)=d_tr_sscav(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_sat01(i,k)  =d_tr_sat(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_sat02(i,k)  =d_tr_sat(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_sat03(i,k)  =d_tr_sat(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_sat04(i,k)  =d_tr_sat(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_sat05(i,k)  =d_tr_sat(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_uscav01(i,k)=d_tr_uscav(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_uscav02(i,k)=d_tr_uscav(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_uscav03(i,k)=d_tr_uscav(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_uscav04(i,k)=d_tr_uscav(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_uscav05(i,k)=d_tr_uscav(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_insc01(i,k)=d_tr_insc(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_insc02(i,k)=d_tr_insc(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_insc03(i,k)=d_tr_insc(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_insc04(i,k)=d_tr_insc(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_insc05(i,k)=d_tr_insc(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_bcscav01(i,k)=d_tr_bcscav(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_bcscav02(i,k)=d_tr_bcscav(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_bcscav03(i,k)=d_tr_bcscav(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_bcscav04(i,k)=d_tr_bcscav(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_bcscav05(i,k)=d_tr_bcscav(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_evapls01(i,k)=d_tr_evapls(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_evapls02(i,k)=d_tr_evapls(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_evapls03(i,k)=d_tr_evapls(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_evapls04(i,k)=d_tr_evapls(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_evapls05(i,k)=d_tr_evapls(i,k,id_scdu)/pdtphys
-        ENDDO
-      ENDDO
-      ENDIF 
-
-      IF(1==0) THEN  ! This "if" is as in original trunk
-      DO i=1, klon
-        DO k=1,klev
-      if(id_prec>0)        d_tr_ls01(i,k)=d_tr_ls_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_ls02(i,k)=d_tr_ls_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_ls03(i,k)=d_tr_ls_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_ls04(i,k)=d_tr_ls_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_ls05(i,k)=d_tr_ls_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_dyn01(i,k)=d_tr_dyn_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_dyn02(i,k)=d_tr_dyn_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_dyn03(i,k)=d_tr_dyn_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_dyn04(i,k)=d_tr_dyn_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_dyn05(i,k)=d_tr_dyn_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_cl01(i,k)=d_tr_cl_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_cl02(i,k)=d_tr_cl_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_cl03(i,k)=d_tr_cl_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_cl04(i,k)=d_tr_cl_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_cl05(i,k)=d_tr_cl_o(i,k,id_scdu)
-      if(id_prec>0)        d_tr_th01(i,k)=d_tr_th_o(i,k,id_prec)
-      if(id_fine>0)        d_tr_th02(i,k)=d_tr_th_o(i,k,id_fine)
-      if(id_coss>0)        d_tr_th03(i,k)=d_tr_th_o(i,k,id_coss)
-      if(id_codu>0)        d_tr_th04(i,k)=d_tr_th_o(i,k,id_codu)
-      if(id_scdu>0)        d_tr_th05(i,k)=d_tr_th_o(i,k,id_scdu)
-        ENDDO
-      ENDDO
-      ELSE
-      DO i=1, klon
-        DO k=1,klev
-      if(id_prec>0)        d_tr_ls01(i,k)=d_tr_ls(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_ls02(i,k)=d_tr_ls(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_ls03(i,k)=d_tr_ls(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_ls04(i,k)=d_tr_ls(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_ls05(i,k)=d_tr_ls(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_dyn01(i,k)=d_tr_dyn(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_dyn02(i,k)=d_tr_dyn(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_dyn03(i,k)=d_tr_dyn(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_dyn04(i,k)=d_tr_dyn(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_dyn05(i,k)=d_tr_dyn(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_cl01(i,k)=d_tr_cl(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_cl02(i,k)=d_tr_cl(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_cl03(i,k)=d_tr_cl(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_cl04(i,k)=d_tr_cl(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_cl05(i,k)=d_tr_cl(i,k,id_scdu)/pdtphys
-      if(id_prec>0)        d_tr_th01(i,k)=d_tr_th(i,k,id_prec)/pdtphys
-      if(id_fine>0)        d_tr_th02(i,k)=d_tr_th(i,k,id_fine)/pdtphys
-      if(id_coss>0)        d_tr_th03(i,k)=d_tr_th(i,k,id_coss)/pdtphys
-      if(id_codu>0)        d_tr_th04(i,k)=d_tr_th(i,k,id_codu)/pdtphys
-      if(id_scdu>0)        d_tr_th05(i,k)=d_tr_th(i,k,id_scdu)/pdtphys
-        ENDDO
-      ENDDO
-      ENDIF
-     
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-
-      dife=clock_end-clock_start
-      ti_outs=dife*MAX(0,SIGN(1,dife))   &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_outs=tia_outs+REAL(ti_outs)/REAL(clock_rate)
-      ENDIF
-
-      IF (logitime) THEN
-      CALL SYSTEM_CLOCK(COUNT=clock_end)
-
-      dife=clock_end-clock_start_spla
-      ti_spla=dife*MAX(0,SIGN(1,dife)) &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-
-
-      tia_spla=tia_spla+REAL(ti_spla)/REAL(clock_rate)
-  print *,'times for this timestep:timeproc,timeproc/time_pytracr_spl-'
-     print *,'time spla',REAL(ti_spla)/REAL(clock_rate)                &
-      ,REAL(ti_spla)/REAL(ti_spla)                                      
-     print *,'time init',REAL(ti_init)/REAL(clock_rate)                &
-      ,REAL(ti_init)/REAL(ti_spla)                                      
-     print *,'time inittype',REAL(ti_inittype)/REAL(clock_rate)        &
-      ,REAL(ti_inittype)/REAL(ti_spla)                                  
-     print *,'time inittwrite',REAL(ti_inittwrite)/REAL(clock_rate)    &
-      ,REAL(ti_inittwrite)/REAL(ti_spla)                                
-     print *,'time emis',REAL(ti_emis)/REAL(clock_rate)                &
-      ,REAL(ti_emis)/REAL(ti_spla)                                      
-     print *,'time depo ',REAL(ti_depo)/REAL(clock_rate)               &
-      ,REAL(ti_depo)/REAL(ti_spla)                                      
-     print *,'time cltr',REAL(ti_cltr)/REAL(clock_rate)                &
-      ,REAL(ti_cltr)/REAL(ti_spla)                                      
-     print *,'time ther',REAL(ti_ther)/REAL(clock_rate)                &
-      ,REAL(ti_ther)/REAL(ti_spla)                                      
-     print *,'time sedi',REAL(ti_sedi)/REAL(clock_rate)                &
-      ,REAL(ti_sedi)/REAL(ti_spla)                                      
-     print *,'time gas to part',REAL(ti_gasp)/REAL(clock_rate)         &
-      ,REAL(ti_gasp)/REAL(ti_spla)                                      
-     print *,'time AP wet',REAL(ti_wetap)/REAL(clock_rate)             &
-      ,REAL(ti_wetap)/REAL(ti_spla)                                     
-     print *,'time convective',REAL(ti_cvltr)/REAL(clock_rate)         &
-      ,REAL(ti_cvltr)/REAL(ti_spla)                                     
-     print *,'time NP lsc scav',REAL(ti_lscs)/REAL(clock_rate)         &
-      ,REAL(ti_lscs)/REAL(ti_spla)                                      
-     print *,'time opt,brdn,etc',REAL(ti_brop)/REAL(clock_rate)        &
-      ,REAL(ti_brop)/REAL(ti_spla)                                      
-     print *,'time outputs',REAL(ti_outs)/REAL(clock_rate)             &
-      ,REAL(ti_outs)/REAL(ti_spla)
-
-
-  print *,'--time accumulated: time proc, time proc/time phytracr_spl--'
-      print *,'time spla',tia_spla
-      print *,'time init',tia_init,tia_init/tia_spla
-      print *,'time inittype',tia_inittype,tia_inittype/tia_spla
-      print *,'time inittwrite',tia_inittwrite,tia_inittwrite/tia_spla
-      print *,'time emis',tia_emis,tia_emis/tia_spla
-      print *,'time depo',tia_depo,tia_depo/tia_spla
-      print *,'time cltr',tia_cltr,tia_cltr/tia_spla
-      print *,'time ther',tia_ther,tia_ther/tia_spla
-      print *,'time sedi',tia_sedi,tia_sedi/tia_spla
-      print *,'time gas to part',tia_gasp,tia_gasp/tia_spla
-      print *,'time AP wet',tia_wetap,tia_wetap/tia_spla
-      print *,'time convective',tia_cvltr,tia_cvltr/tia_spla
-      print *,'time NP lsc scav',tia_lscs,tia_lscs/tia_spla
-      print *,'time opt,brdn,etc',tia_brop,tia_brop/tia_spla
-      print *,'time outputs',tia_outs,tia_outs/tia_spla
-
-
-
-      dife=clock_end_outphytracr-clock_start_outphytracr
-      ti_nophytracr=dife*MAX(0,SIGN(1,dife))  &
-      +(dife+clock_per_max)*MAX(0,SIGN(1,-dife))
-      tia_nophytracr=tia_nophytracr+REAL(ti_nophytracr)/REAL(clock_rate)
-      print *,'Time outside phytracr; Time accum outside phytracr'
-      print*,REAL(ti_nophytracr)/REAL(clock_rate),tia_nophytracr
-
-      clock_start_outphytracr=clock_end
-
-      ENDIF      
-      print *,'END PHYTRACR_SPL '
-  print *,'lmt_so2ff_l FIN' , MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
-
-!      CALL abort_gcm('TEST1', 'OK1', 1)
-
-      RETURN
-      END SUBROUTINE phytracr_spl
- 
-      SUBROUTINE readregionsdims2_spl(nbreg,fileregions)
-
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-
-      IMPLICIT NONE
-      CHARACTER*800 fileregions
-      CHARACTER*800 auxstr
-      INTEGER nbreg
- 
-      IF (is_mpi_root .AND. is_omp_root) THEN 
-
-      OPEN (UNIT=1,FILE=trim(adjustl(fileregions)))
-      READ(1,'(a)') auxstr
-      READ(1,'(i10)') nbreg
-      CLOSE(UNIT=1)
-      ENDIF
-      CALL bcast(nbreg)
-
-      END SUBROUTINE readregionsdims2_spl
-
-      SUBROUTINE readregionsdims_spl(nbreg_ind,fileregionsdimsind,   &
-                                    nbreg_dust,fileregionsdimsdust,  &
-                                    nbreg_bb,fileregionsdimsbb)     
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-
-      IMPLICIT NONE
-      CHARACTER*800 fileregionsdimsind
-      CHARACTER*800 fileregionsdimsdust
-      CHARACTER*800 fileregionsdimsbb
-      CHARACTER*800 auxstr
-      INTEGER nbreg_ind,nbreg_dust,nbreg_bb
- 
-      IF (is_mpi_root .AND. is_omp_root) THEN 
-
-      OPEN (UNIT=1,FILE=trim(adjustl(fileregionsdimsind)))
-      READ(1,'(a)') auxstr
-      READ(1,'(i10)') nbreg_ind
-      CLOSE(UNIT=1)
-
-      OPEN (UNIT=1,FILE=trim(adjustl(fileregionsdimsdust)))
-      READ(1,'(a)') auxstr
-      READ(1,'(i10)') nbreg_dust
-      CLOSE(UNIT=1)
-
-      OPEN (UNIT=1,FILE=trim(adjustl(fileregionsdimsbb)))
-      READ(1,'(a)') auxstr
-      READ(1,'(i10)') nbreg_bb
-      CLOSE(UNIT=1)
-      
-
-      ENDIF
-      CALL bcast(nbreg_ind)
-      CALL bcast(nbreg_dust)
-      CALL bcast(nbreg_bb)
-
-      END SUBROUTINE readregionsdims_spl
-
-      SUBROUTINE readregions_spl(iregion,filenameregion)
-      USE dimphy
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-
-      IMPLICIT NONE
-      CHARACTER*(*) filenameregion
-      INTEGER iregion(klon)
-      INTEGER iregion_glo(klon_glo)
-      INTEGER k
-     
-      IF (is_mpi_root .AND. is_omp_root) THEN
-
-      print *,trim(adjustl(filenameregion))
-      OPEN(1,file=trim(adjustl(filenameregion)))
-      DO k=1,klon_glo
-      READ(1,'(i10)') iregion_glo(k)
-      ENDDO
-      CLOSE(UNIT=1)
-      ENDIF
-      CALL scatter(iregion_glo,iregion)
-
-      END SUBROUTINE readregions_spl
-
-!! AS: SUBROUTINE readscaleparams_spl pas appellee
-      SUBROUTINE readscaleparams_spl(scale_param, nbreg, &
-                                             filescaleparams)
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      IMPLICIT NONE
-
-      CHARACTER*800 filescaleparams
-      INTEGER nbreg
-      REAL scale_param(nbreg)
-      INTEGER k
-
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      OPEN(1,file=trim(adjustl(filescaleparams)),form='unformatted')
-      do k=1,nbreg
+      DO i = 1, klon
+        DO k = 1, klev
+
+          if(id_prec>0)        d_tr_cv01(i, k) = d_tr_cv_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_cv02(i, k) = d_tr_cv_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_cv03(i, k) = d_tr_cv_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_cv04(i, k) = d_tr_cv_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_cv05(i, k) = d_tr_cv_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_trsp01(i, k) = d_tr_trsp_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_trsp02(i, k) = d_tr_trsp_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_trsp03(i, k) = d_tr_trsp_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_trsp04(i, k) = d_tr_trsp_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_trsp05(i, k) = d_tr_trsp_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_sscav01(i, k) = d_tr_sscav_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_sscav02(i, k) = d_tr_sscav_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_sscav03(i, k) = d_tr_sscav_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_sscav04(i, k) = d_tr_sscav_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_sscav05(i, k) = d_tr_sscav_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_sat01(i, k) = d_tr_sat_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_sat02(i, k) = d_tr_sat_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_sat03(i, k) = d_tr_sat_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_sat04(i, k) = d_tr_sat_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_sat05(i, k) = d_tr_sat_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_uscav01(i, k) = d_tr_uscav_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_uscav02(i, k) = d_tr_uscav_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_uscav03(i, k) = d_tr_uscav_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_uscav04(i, k) = d_tr_uscav_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_uscav05(i, k) = d_tr_uscav_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_insc01(i, k) = d_tr_insc_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_insc02(i, k) = d_tr_insc_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_insc03(i, k) = d_tr_insc_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_insc04(i, k) = d_tr_insc_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_insc05(i, k) = d_tr_insc_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_bcscav01(i, k) = d_tr_bcscav_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_bcscav02(i, k) = d_tr_bcscav_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_bcscav03(i, k) = d_tr_bcscav_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_bcscav04(i, k) = d_tr_bcscav_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_bcscav05(i, k) = d_tr_bcscav_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_evapls01(i, k) = d_tr_evapls_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_evapls02(i, k) = d_tr_evapls_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_evapls03(i, k) = d_tr_evapls_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_evapls04(i, k) = d_tr_evapls_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_evapls05(i, k) = d_tr_evapls_o(i, k, id_scdu)
+        ENDDO
+      ENDDO
+    ELSE ! correction pour fermeture de bilan, par FH dans les simus de Binta pour Habib
+      DO i = 1, klon
+        DO k = 1, klev
+          if(id_prec>0)        d_tr_cv01(i, k) = d_tr_cv(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_cv02(i, k) = d_tr_cv(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_cv03(i, k) = d_tr_cv(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_cv04(i, k) = d_tr_cv(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_cv05(i, k) = d_tr_cv(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_trsp01(i, k) = d_tr_trsp(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_trsp02(i, k) = d_tr_trsp(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_trsp03(i, k) = d_tr_trsp(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_trsp04(i, k) = d_tr_trsp(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_trsp05(i, k) = d_tr_trsp(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_sscav01(i, k) = d_tr_sscav(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_sscav02(i, k) = d_tr_sscav(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_sscav03(i, k) = d_tr_sscav(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_sscav04(i, k) = d_tr_sscav(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_sscav05(i, k) = d_tr_sscav(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_sat01(i, k) = d_tr_sat(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_sat02(i, k) = d_tr_sat(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_sat03(i, k) = d_tr_sat(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_sat04(i, k) = d_tr_sat(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_sat05(i, k) = d_tr_sat(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_uscav01(i, k) = d_tr_uscav(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_uscav02(i, k) = d_tr_uscav(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_uscav03(i, k) = d_tr_uscav(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_uscav04(i, k) = d_tr_uscav(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_uscav05(i, k) = d_tr_uscav(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_insc01(i, k) = d_tr_insc(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_insc02(i, k) = d_tr_insc(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_insc03(i, k) = d_tr_insc(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_insc04(i, k) = d_tr_insc(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_insc05(i, k) = d_tr_insc(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_bcscav01(i, k) = d_tr_bcscav(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_bcscav02(i, k) = d_tr_bcscav(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_bcscav03(i, k) = d_tr_bcscav(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_bcscav04(i, k) = d_tr_bcscav(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_bcscav05(i, k) = d_tr_bcscav(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_evapls01(i, k) = d_tr_evapls(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_evapls02(i, k) = d_tr_evapls(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_evapls03(i, k) = d_tr_evapls(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_evapls04(i, k) = d_tr_evapls(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_evapls05(i, k) = d_tr_evapls(i, k, id_scdu) / pdtphys
+        ENDDO
+      ENDDO
+    ENDIF
+
+    IF(1==0) THEN  ! This "if" is as in original trunk
+      DO i = 1, klon
+        DO k = 1, klev
+          if(id_prec>0)        d_tr_ls01(i, k) = d_tr_ls_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_ls02(i, k) = d_tr_ls_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_ls03(i, k) = d_tr_ls_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_ls04(i, k) = d_tr_ls_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_ls05(i, k) = d_tr_ls_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_dyn01(i, k) = d_tr_dyn_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_dyn02(i, k) = d_tr_dyn_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_dyn03(i, k) = d_tr_dyn_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_dyn04(i, k) = d_tr_dyn_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_dyn05(i, k) = d_tr_dyn_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_cl01(i, k) = d_tr_cl_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_cl02(i, k) = d_tr_cl_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_cl03(i, k) = d_tr_cl_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_cl04(i, k) = d_tr_cl_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_cl05(i, k) = d_tr_cl_o(i, k, id_scdu)
+          if(id_prec>0)        d_tr_th01(i, k) = d_tr_th_o(i, k, id_prec)
+          if(id_fine>0)        d_tr_th02(i, k) = d_tr_th_o(i, k, id_fine)
+          if(id_coss>0)        d_tr_th03(i, k) = d_tr_th_o(i, k, id_coss)
+          if(id_codu>0)        d_tr_th04(i, k) = d_tr_th_o(i, k, id_codu)
+          if(id_scdu>0)        d_tr_th05(i, k) = d_tr_th_o(i, k, id_scdu)
+        ENDDO
+      ENDDO
+    ELSE
+      DO i = 1, klon
+        DO k = 1, klev
+          if(id_prec>0)        d_tr_ls01(i, k) = d_tr_ls(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_ls02(i, k) = d_tr_ls(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_ls03(i, k) = d_tr_ls(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_ls04(i, k) = d_tr_ls(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_ls05(i, k) = d_tr_ls(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_dyn01(i, k) = d_tr_dyn(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_dyn02(i, k) = d_tr_dyn(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_dyn03(i, k) = d_tr_dyn(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_dyn04(i, k) = d_tr_dyn(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_dyn05(i, k) = d_tr_dyn(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_cl01(i, k) = d_tr_cl(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_cl02(i, k) = d_tr_cl(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_cl03(i, k) = d_tr_cl(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_cl04(i, k) = d_tr_cl(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_cl05(i, k) = d_tr_cl(i, k, id_scdu) / pdtphys
+          if(id_prec>0)        d_tr_th01(i, k) = d_tr_th(i, k, id_prec) / pdtphys
+          if(id_fine>0)        d_tr_th02(i, k) = d_tr_th(i, k, id_fine) / pdtphys
+          if(id_coss>0)        d_tr_th03(i, k) = d_tr_th(i, k, id_coss) / pdtphys
+          if(id_codu>0)        d_tr_th04(i, k) = d_tr_th(i, k, id_codu) / pdtphys
+          if(id_scdu>0)        d_tr_th05(i, k) = d_tr_th(i, k, id_scdu) / pdtphys
+        ENDDO
+      ENDDO
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+
+      dife = clock_end - clock_start
+      ti_outs = dife * MAX(0, SIGN(1, dife))   &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_outs = tia_outs + REAL(ti_outs) / REAL(clock_rate)
+    ENDIF
+
+    IF (logitime) THEN
+      CALL SYSTEM_CLOCK(COUNT = clock_end)
+
+      dife = clock_end - clock_start_spla
+      ti_spla = dife * MAX(0, SIGN(1, dife)) &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+
+      tia_spla = tia_spla + REAL(ti_spla) / REAL(clock_rate)
+      print *, 'times for this timestep:timeproc,timeproc/time_pytracr_spl-'
+      print *, 'time spla', REAL(ti_spla) / REAL(clock_rate)                &
+              , REAL(ti_spla) / REAL(ti_spla)
+      print *, 'time init', REAL(ti_init) / REAL(clock_rate)                &
+              , REAL(ti_init) / REAL(ti_spla)
+      print *, 'time inittype', REAL(ti_inittype) / REAL(clock_rate)        &
+              , REAL(ti_inittype) / REAL(ti_spla)
+      print *, 'time inittwrite', REAL(ti_inittwrite) / REAL(clock_rate)    &
+              , REAL(ti_inittwrite) / REAL(ti_spla)
+      print *, 'time emis', REAL(ti_emis) / REAL(clock_rate)                &
+              , REAL(ti_emis) / REAL(ti_spla)
+      print *, 'time depo ', REAL(ti_depo) / REAL(clock_rate)               &
+              , REAL(ti_depo) / REAL(ti_spla)
+      print *, 'time cltr', REAL(ti_cltr) / REAL(clock_rate)                &
+              , REAL(ti_cltr) / REAL(ti_spla)
+      print *, 'time ther', REAL(ti_ther) / REAL(clock_rate)                &
+              , REAL(ti_ther) / REAL(ti_spla)
+      print *, 'time sedi', REAL(ti_sedi) / REAL(clock_rate)                &
+              , REAL(ti_sedi) / REAL(ti_spla)
+      print *, 'time gas to part', REAL(ti_gasp) / REAL(clock_rate)         &
+              , REAL(ti_gasp) / REAL(ti_spla)
+      print *, 'time AP wet', REAL(ti_wetap) / REAL(clock_rate)             &
+              , REAL(ti_wetap) / REAL(ti_spla)
+      print *, 'time convective', REAL(ti_cvltr) / REAL(clock_rate)         &
+              , REAL(ti_cvltr) / REAL(ti_spla)
+      print *, 'time NP lsc scav', REAL(ti_lscs) / REAL(clock_rate)         &
+              , REAL(ti_lscs) / REAL(ti_spla)
+      print *, 'time opt,brdn,etc', REAL(ti_brop) / REAL(clock_rate)        &
+              , REAL(ti_brop) / REAL(ti_spla)
+      print *, 'time outputs', REAL(ti_outs) / REAL(clock_rate)             &
+              , REAL(ti_outs) / REAL(ti_spla)
+
+      print *, '--time accumulated: time proc, time proc/time phytracr_spl--'
+      print *, 'time spla', tia_spla
+      print *, 'time init', tia_init, tia_init / tia_spla
+      print *, 'time inittype', tia_inittype, tia_inittype / tia_spla
+      print *, 'time inittwrite', tia_inittwrite, tia_inittwrite / tia_spla
+      print *, 'time emis', tia_emis, tia_emis / tia_spla
+      print *, 'time depo', tia_depo, tia_depo / tia_spla
+      print *, 'time cltr', tia_cltr, tia_cltr / tia_spla
+      print *, 'time ther', tia_ther, tia_ther / tia_spla
+      print *, 'time sedi', tia_sedi, tia_sedi / tia_spla
+      print *, 'time gas to part', tia_gasp, tia_gasp / tia_spla
+      print *, 'time AP wet', tia_wetap, tia_wetap / tia_spla
+      print *, 'time convective', tia_cvltr, tia_cvltr / tia_spla
+      print *, 'time NP lsc scav', tia_lscs, tia_lscs / tia_spla
+      print *, 'time opt,brdn,etc', tia_brop, tia_brop / tia_spla
+      print *, 'time outputs', tia_outs, tia_outs / tia_spla
+
+      dife = clock_end_outphytracr - clock_start_outphytracr
+      ti_nophytracr = dife * MAX(0, SIGN(1, dife))  &
+              + (dife + clock_per_max) * MAX(0, SIGN(1, -dife))
+      tia_nophytracr = tia_nophytracr + REAL(ti_nophytracr) / REAL(clock_rate)
+      print *, 'Time outside phytracr; Time accum outside phytracr'
+      print*, REAL(ti_nophytracr) / REAL(clock_rate), tia_nophytracr
+
+      clock_start_outphytracr = clock_end
+
+    ENDIF
+    print *, 'END PHYTRACR_SPL '
+    print *, 'lmt_so2ff_l FIN', MINVAL(lmt_so2ff_l), MAXVAL(lmt_so2ff_l)
+
+    !      CALL abort_gcm('TEST1', 'OK1', 1)
+
+    RETURN
+  END SUBROUTINE phytracr_spl
+
+  SUBROUTINE readregionsdims2_spl(nbreg, fileregions)
+
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+
+    IMPLICIT NONE
+    CHARACTER*800 fileregions
+    CHARACTER*800 auxstr
+    INTEGER nbreg
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregions)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg
+      CLOSE(UNIT = 1)
+    ENDIF
+    CALL bcast(nbreg)
+
+  END SUBROUTINE readregionsdims2_spl
+
+  SUBROUTINE readregionsdims_spl(nbreg_ind, fileregionsdimsind, &
+          nbreg_dust, fileregionsdimsdust, &
+          nbreg_bb, fileregionsdimsbb)
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+
+    IMPLICIT NONE
+    CHARACTER*800 fileregionsdimsind
+    CHARACTER*800 fileregionsdimsdust
+    CHARACTER*800 fileregionsdimsbb
+    CHARACTER*800 auxstr
+    INTEGER nbreg_ind, nbreg_dust, nbreg_bb
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsind)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg_ind
+      CLOSE(UNIT = 1)
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsdust)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg_dust
+      CLOSE(UNIT = 1)
+
+      OPEN (UNIT = 1, FILE = trim(adjustl(fileregionsdimsbb)))
+      READ(1, '(a)') auxstr
+      READ(1, '(i10)') nbreg_bb
+      CLOSE(UNIT = 1)
+
+    ENDIF
+    CALL bcast(nbreg_ind)
+    CALL bcast(nbreg_dust)
+    CALL bcast(nbreg_bb)
+
+  END SUBROUTINE readregionsdims_spl
+
+  SUBROUTINE readregions_spl(iregion, filenameregion)
+    USE dimphy
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+
+    IMPLICIT NONE
+    CHARACTER*(*) filenameregion
+    INTEGER iregion(klon)
+    INTEGER iregion_glo(klon_glo)
+    INTEGER k
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+
+      print *, trim(adjustl(filenameregion))
+      OPEN(1, file = trim(adjustl(filenameregion)))
+      DO k = 1, klon_glo
+        READ(1, '(i10)') iregion_glo(k)
+      ENDDO
+      CLOSE(UNIT = 1)
+    ENDIF
+    CALL scatter(iregion_glo, iregion)
+
+  END SUBROUTINE readregions_spl
+
+  !! AS: SUBROUTINE readscaleparams_spl pas appellee
+  SUBROUTINE readscaleparams_spl(scale_param, nbreg, &
+          filescaleparams)
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+    IMPLICIT NONE
+
+    CHARACTER*800 filescaleparams
+    INTEGER nbreg
+    REAL scale_param(nbreg)
+    INTEGER k
+
+    IF (is_mpi_root .AND. is_omp_root) THEN
+      OPEN(1, file = trim(adjustl(filescaleparams)), form = 'unformatted')
+      do k = 1, nbreg
         read(1)  scale_param(k)
       enddo
-      CLOSE(1)  
-      ENDIF
-      CALL bcast(scale_param)
-!      print *,'holaaaaaaaaaaaa'
-!      print *,scale_param
-
-      END SUBROUTINE readscaleparams_spl
-
-      SUBROUTINE readscaleparamsnc_spl(scale_param_ind,                 &
-        nbreg_ind, paramname_ind,                                       &
-        scale_param_ff, nbreg_ff,paramname_ff,                          &
-        scale_param_bb, nbreg_bb,paramname_bb,                          &
-        scale_param_dustacc, nbreg_dustacc,paramname_dustacc,           &
-        scale_param_dustcoa, nbreg_dustcoa,paramname_dustcoa,           &
-        scale_param_dustsco, nbreg_dustsco,paramname_dustsco,           &
-        param_wstarBLperregion, nbreg_wstardustBL, paramname_wstarBL,     &
-        param_wstarWAKEperregion, nbreg_wstardustWAKE, paramname_wstarWAKE, &
-        scale_param_ssacc  ,  paramname_ssacc,             &
-        scale_param_sscoa  ,  paramname_sscoa,             &
-           filescaleparams,julien,jH_phys, pdtphys,debutphy)
-!      SUBROUTINE readscaleparamsnc_spl(scale_param, nbreg, &
-!                                        filescaleparams,paramname,&
-!                                        julien,jH_phys, pdtphys,debutphy)
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      IMPLICIT NONE
-
-      CHARACTER*800 filescaleparams
-      CHARACTER*100 paramname_ind,paramname_ff,paramname_bb          
-      CHARACTER*100 paramname_dustacc, paramname_dustcoa 
-      CHARACTER*100 paramname_dustsco
-      CHARACTER*100 paramname_ssacc
-      CHARACTER*100 paramname_sscoa
-      CHARACTER*100 paramname_wstarBL
-      CHARACTER*100 paramname_wstarWAKE
-     
-      INTEGER nbreg,iday
-      INTEGER nbreg_ind, nbreg_ff, nbreg_bb , nbreg_dustacc
-      INTEGER nbreg_dustcoa , nbreg_dustsco, nbreg_wstardustBL
-      INTEGER  nbreg_wstardustWAKE
-      INTEGER,PARAMETER ::  nbreg_ssacc=1 
-      INTEGER,PARAMETER :: nbreg_sscoa=1 
-      REAL,PARAMETER :: sca_resol = 24. ! resolution of scalig params in hours
-      REAL scale_param_ind(nbreg_ind)
-      REAL scale_param_bb(nbreg_bb)
-      REAL scale_param_ff(nbreg_ff)
-      REAL scale_param_dustacc(nbreg_dustacc)
-      REAL scale_param_dustcoa(nbreg_dustcoa)
-      REAL scale_param_dustsco(nbreg_dustsco)
-      REAL param_wstarBLperregion(nbreg_wstardustBL)
-      REAL param_wstarWAKEperregion(nbreg_wstardustWAKE)
-      REAL scale_param_ssacc
-      REAL scale_param_ssacc_tmp(nbreg_ssacc)
-      REAL scale_param_sscoa
-      REAL scale_param_sscoa_tmp(nbreg_sscoa)
-
-      INTEGER k,step_sca,test_sca
-      REAL :: jH_phys,  pdtphys
-      REAL,SAVE :: jH_sca, jH_ini
-      INTEGER julien
-      LOGICAL debutphy
-      SAVE step_sca,test_sca,iday
-!$OMP THREADPRIVATE(step_sca,test_sca,iday)
-!$OMP THREADPRIVATE(jH_sca,jH_ini)
-
-      IF (debutphy) THEN
-        iday=julien
-        step_sca=1
-        test_sca=0   
-        jH_ini=jH_phys
-        jH_sca=jH_phys
-      ENDIF
-
-      IF (test_sca == 0 ) THEN
-        ! READ file!!
-        call read_scalenc(filescaleparams,paramname_ind,            &
-                           nbreg_ind,step_sca,                      &
-                           scale_param_ind)
-        call read_scalenc(filescaleparams,paramname_bb,            &
-                           nbreg_bb,step_sca,                      &
-                           scale_param_bb)
-        call read_scalenc(filescaleparams,paramname_ff,            &
-                           nbreg_ff,step_sca,                      &
-                           scale_param_ff)
-        call read_scalenc(filescaleparams,paramname_dustacc,            &
-                           nbreg_dustacc,step_sca,                      &
-                           scale_param_dustacc)
-        call read_scalenc(filescaleparams,paramname_dustcoa,            &
-                           nbreg_dustcoa,step_sca,                      &
-                           scale_param_dustcoa)
-        call read_scalenc(filescaleparams,paramname_dustsco,            &
-                           nbreg_dustsco,step_sca,                      &
-                           scale_param_dustsco)
-        call read_scalenc(filescaleparams,paramname_wstarBL,            &
-                           nbreg_wstardustBL,step_sca,                    &
-                           param_wstarBLperregion)
-        call read_scalenc(filescaleparams,paramname_wstarWAKE,          &
-                           nbreg_wstardustWAKE,step_sca,                    &
-                           param_wstarWAKEperregion)
-        call read_scalenc(filescaleparams,paramname_ssacc,              &
-                           nbreg_ssacc,step_sca,                        &
-                           scale_param_ssacc_tmp)
-        call read_scalenc(filescaleparams,paramname_sscoa,              &
-                           nbreg_sscoa,step_sca,                        &
-                           scale_param_sscoa_tmp)
-         scale_param_ssacc=scale_param_ssacc_tmp(1)
-         scale_param_sscoa=scale_param_sscoa_tmp(1)
-
-       !print *,'JEREADFILE',julien,jH_phys
-        step_sca= step_sca + 1
-        test_sca=1
-      ENDIF
-
-      jH_sca=jH_sca+pdtphys/(24.*3600.)
-      IF (jH_sca>(sca_resol)/24.) THEN
-          test_sca=0
-          jH_sca=jH_ini
-      ENDIF
-
-      END SUBROUTINE readscaleparamsnc_spl
-
-      SUBROUTINE read_scalenc(filescaleparams,paramname,nbreg,step_sca, &
-                          scale_param)
-
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE netcdf, ONLY:nf90_open,nf90_close,nf90_inq_varid,nf90_nowrite,nf90_noerr,nf90_get_var
-      IMPLICIT NONE
-
-      CHARACTER*800 filescaleparams
-      CHARACTER*100 paramname
-      INTEGER nbreg, step_sca
-      REAL scale_param(nbreg)
-      !local vars
-      integer nid,ierr,nvarid
-      real rcode,auxreal
-      integer start(4),count(4), status
-!      local
-      integer debutread,countread
-      CHARACTER*104 varname
-      CHARACTER*2 aux_2s
-      integer i, j, ig
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-          !nci=NCOPN(trim(adjustl(filescaleparams)),NCNOWRIT,rcode)
-         ierr = nf90_open (trim(adjustl(filescaleparams)),nf90_nowrite, nid)
-          if (ierr == nf90_noerr) THEN
-          debutread=step_sca
-          countread=1
-
-           do i=1,nbreg
-            WRITE(aux_2s,'(i2.2)') i
-            varname= trim(adjustl(paramname))//aux_2s
-            print *,varname
-            ierr = nf90_inq_varid (nid,trim(adjustl(varname)), nvarid)
-            ierr = nf90_get_var (nid, nvarid, auxreal, debutread, countread)
-            IF (ierr /= nf90_noerr) THEN
-             PRINT*, 'Pb de lecture pour modvalues'
-       print *,'JE  scale_var, step_sca',trim(adjustl(varname)),step_sca
-             CALL HANDLE_ERR(ierr)
-             print *,'error ierr= ',ierr
-             CALL exit(1) 
-            call abort_gcm('read_scalenc','error reading variable',1)
-      ENDIF
-
-            print *,auxreal
-            scale_param(i)=auxreal 
-           enddo
-
-            ierr = nf90_close(nid)
-          else
-           print *,'File '//trim(adjustl(filescaleparams))//' not found'
-            print *,'doing nothing...'
-          endif
-
-      ENDIF ! mpi_root
-!$OMP END MASTER
-!$OMP BARRIER
-!      CALL scatter(var local _glo,var local) o algo asi
-      call bcast(scale_param)
-      END SUBROUTINE read_scalenc
-
-
-      
-      END MODULE
+      CLOSE(1)
+    ENDIF
+    CALL bcast(scale_param)
+    !      print *,'holaaaaaaaaaaaa'
+    !      print *,scale_param
+
+  END SUBROUTINE readscaleparams_spl
+
+  SUBROUTINE readscaleparamsnc_spl(scale_param_ind, &
+          nbreg_ind, paramname_ind, &
+          scale_param_ff, nbreg_ff, paramname_ff, &
+          scale_param_bb, nbreg_bb, paramname_bb, &
+          scale_param_dustacc, nbreg_dustacc, paramname_dustacc, &
+          scale_param_dustcoa, nbreg_dustcoa, paramname_dustcoa, &
+          scale_param_dustsco, nbreg_dustsco, paramname_dustsco, &
+          param_wstarBLperregion, nbreg_wstardustBL, paramname_wstarBL, &
+          param_wstarWAKEperregion, nbreg_wstardustWAKE, paramname_wstarWAKE, &
+          scale_param_ssacc, paramname_ssacc, &
+          scale_param_sscoa, paramname_sscoa, &
+          filescaleparams, julien, jH_phys, pdtphys, debutphy)
+    !      SUBROUTINE readscaleparamsnc_spl(scale_param, nbreg, &
+    !                                        filescaleparams,paramname,&
+    !                                        julien,jH_phys, pdtphys,debutphy)
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+    IMPLICIT NONE
+
+    CHARACTER*800 filescaleparams
+    CHARACTER*100 paramname_ind, paramname_ff, paramname_bb
+    CHARACTER*100 paramname_dustacc, paramname_dustcoa
+    CHARACTER*100 paramname_dustsco
+    CHARACTER*100 paramname_ssacc
+    CHARACTER*100 paramname_sscoa
+    CHARACTER*100 paramname_wstarBL
+    CHARACTER*100 paramname_wstarWAKE
+
+    INTEGER nbreg, iday
+    INTEGER nbreg_ind, nbreg_ff, nbreg_bb, nbreg_dustacc
+    INTEGER nbreg_dustcoa, nbreg_dustsco, nbreg_wstardustBL
+    INTEGER  nbreg_wstardustWAKE
+    INTEGER, PARAMETER :: nbreg_ssacc = 1
+    INTEGER, PARAMETER :: nbreg_sscoa = 1
+    REAL, PARAMETER :: sca_resol = 24. ! resolution of scalig params in hours
+    REAL scale_param_ind(nbreg_ind)
+    REAL scale_param_bb(nbreg_bb)
+    REAL scale_param_ff(nbreg_ff)
+    REAL scale_param_dustacc(nbreg_dustacc)
+    REAL scale_param_dustcoa(nbreg_dustcoa)
+    REAL scale_param_dustsco(nbreg_dustsco)
+    REAL param_wstarBLperregion(nbreg_wstardustBL)
+    REAL param_wstarWAKEperregion(nbreg_wstardustWAKE)
+    REAL scale_param_ssacc
+    REAL scale_param_ssacc_tmp(nbreg_ssacc)
+    REAL scale_param_sscoa
+    REAL scale_param_sscoa_tmp(nbreg_sscoa)
+
+    INTEGER k, step_sca, test_sca
+    REAL :: jH_phys, pdtphys
+    REAL, SAVE :: jH_sca, jH_ini
+    INTEGER julien
+    LOGICAL debutphy
+    SAVE step_sca, test_sca, iday
+    !$OMP THREADPRIVATE(step_sca,test_sca,iday)
+    !$OMP THREADPRIVATE(jH_sca,jH_ini)
+
+    IF (debutphy) THEN
+      iday = julien
+      step_sca = 1
+      test_sca = 0
+      jH_ini = jH_phys
+      jH_sca = jH_phys
+    ENDIF
+
+    IF (test_sca == 0) THEN
+      ! READ file!!
+      call read_scalenc(filescaleparams, paramname_ind, &
+              nbreg_ind, step_sca, &
+              scale_param_ind)
+      call read_scalenc(filescaleparams, paramname_bb, &
+              nbreg_bb, step_sca, &
+              scale_param_bb)
+      call read_scalenc(filescaleparams, paramname_ff, &
+              nbreg_ff, step_sca, &
+              scale_param_ff)
+      call read_scalenc(filescaleparams, paramname_dustacc, &
+              nbreg_dustacc, step_sca, &
+              scale_param_dustacc)
+      call read_scalenc(filescaleparams, paramname_dustcoa, &
+              nbreg_dustcoa, step_sca, &
+              scale_param_dustcoa)
+      call read_scalenc(filescaleparams, paramname_dustsco, &
+              nbreg_dustsco, step_sca, &
+              scale_param_dustsco)
+      call read_scalenc(filescaleparams, paramname_wstarBL, &
+              nbreg_wstardustBL, step_sca, &
+              param_wstarBLperregion)
+      call read_scalenc(filescaleparams, paramname_wstarWAKE, &
+              nbreg_wstardustWAKE, step_sca, &
+              param_wstarWAKEperregion)
+      call read_scalenc(filescaleparams, paramname_ssacc, &
+              nbreg_ssacc, step_sca, &
+              scale_param_ssacc_tmp)
+      call read_scalenc(filescaleparams, paramname_sscoa, &
+              nbreg_sscoa, step_sca, &
+              scale_param_sscoa_tmp)
+      scale_param_ssacc = scale_param_ssacc_tmp(1)
+      scale_param_sscoa = scale_param_sscoa_tmp(1)
+
+      !print *,'JEREADFILE',julien,jH_phys
+      step_sca = step_sca + 1
+      test_sca = 1
+    ENDIF
+
+    jH_sca = jH_sca + pdtphys / (24. * 3600.)
+    IF (jH_sca>(sca_resol) / 24.) THEN
+      test_sca = 0
+      jH_sca = jH_ini
+    ENDIF
+
+  END SUBROUTINE readscaleparamsnc_spl
+
+  SUBROUTINE read_scalenc(filescaleparams, paramname, nbreg, step_sca, &
+          scale_param)
+
+    USE mod_grid_phy_lmdz
+    USE mod_phys_lmdz_para
+    USE netcdf, ONLY : nf90_open, nf90_close, nf90_inq_varid, nf90_nowrite, nf90_noerr, nf90_get_var
+    IMPLICIT NONE
+
+    CHARACTER*800 filescaleparams
+    CHARACTER*100 paramname
+    INTEGER nbreg, step_sca
+    REAL scale_param(nbreg)
+    !local vars
+    integer nid, ierr, nvarid
+    real rcode, auxreal
+    integer start(4), count(4), status
+    !      local
+    CHARACTER*104 varname
+    CHARACTER*2 aux_2s
+    integer i, j, ig
+    !$OMP MASTER
+    IF (is_mpi_root .AND. is_omp_root) THEN
+      ierr = nf90_open(trim(adjustl(filescaleparams)), nf90_nowrite, nid)
+      if (ierr == nf90_noerr) THEN
+        do i = 1, nbreg
+          WRITE(aux_2s, '(i2.2)') i
+          varname = trim(adjustl(paramname)) // aux_2s
+          print *, varname
+          ierr = nf90_inq_varid(nid, trim(adjustl(varname)), nvarid)
+          ierr = nf90_get_var(nid, nvarid, auxreal, [step_sca])
+          IF (ierr /= nf90_noerr) THEN
+            PRINT*, 'Pb de lecture pour modvalues'
+            print *, 'JE  scale_var, step_sca', trim(adjustl(varname)), step_sca
+            CALL HANDLE_ERR(ierr)
+            print *, 'error ierr= ', ierr
+            CALL exit(1)
+            call abort_gcm('read_scalenc', 'error reading variable', 1)
+          ENDIF
+
+          print *, auxreal
+          scale_param(i) = auxreal
+        enddo
+
+        ierr = nf90_close(nid)
+      else
+        print *, 'File ' // trim(adjustl(filescaleparams)) // ' not found'
+        print *, 'doing nothing...'
+      endif
+
+    ENDIF ! mpi_root
+    !$OMP END MASTER
+    !$OMP BARRIER
+    !      CALL scatter(var local _glo,var local) o algo asi
+    call bcast(scale_param)
+  END SUBROUTINE read_scalenc
+
+
+END MODULE
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.F	(revision 5098)
+++ 	(revision )
@@ -1,79 +1,0 @@
-      SUBROUTINE read_dust(debutphy, step, nbjour, dust_ec)
-      USE dimphy
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE netcdf, ONLY:nf90_get_var
-      IMPLICIT NONE 
-c
-      INCLUDE "dimensions.h"
-      INCLUDE "paramet.h"
-c
-      INTEGER step, nbjour
-      LOGICAL debutphy
-      real dust_ec(klon)
-      real dust_ec_glo(klon_glo)
-c
-c as      real dust_nc(iip1,jjp1)
-      real dust_nc_glo(nbp_lon+1,nbp_lat)
-      real rcode
-      integer ncid1, varid1, ncid2, varid2 
-
-      save ncid1, varid1, ncid2, varid2
-!$OMP THREADPRIVATE(ncid1, varid1, ncid2, varid2)
-      integer start(4),count(4), status
-      integer i, j, ig
-c
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      if (debutphy) then
-c
-         ncid1=NCOPN('dust.nc',NCNOWRIT,rcode)
-         varid1=NCVID(ncid1,'EMISSION',rcode)
-c
-      endif
-c
-      start(1)=1
-      start(2)=1
-      start(4)=0
-
-!      count(1)=iip1
-      count(1)=nbp_lon+1
-!      count(2)=jjp1
-      count(2)=nbp_lat
-      count(3)=1
-      count(4)=0
-c
-      start(3)=step
-
-      status=nf90_get_var(ncid1,varid1,dust_nc_glo,start,count)
-
-!      call correctbid(iim,jjp1,dust_nc)
-      call correctbid(nbp_lon,nbp_lat,dust_nc_glo)
-c
-c--upside down + physical grid
-c
-c--OB=change jjp1 to 1 here ; 
-c----AS: OB's change is needed if lats N to S (90 to -90) in dust.nc
-!      dust_ec(1)=MAX(dust_nc(1,jjp1),0.0)
-      dust_ec_glo(1)=MAX(dust_nc_glo(1,nbp_lat),0.0)
-      ig=2
-!      DO j=2,jjm
-      DO j=2,nbp_lat-1
-!         DO i = 1, iim
-         DO i = 1, nbp_lon
-c--OB=change jjp1+1-j to j here
-!           dust_ec(ig)=MAX(dust_nc(i,jjp1+1-j),0.0)
-           dust_ec_glo(ig)=MAX(dust_nc_glo(i,nbp_lat+1-j),0.0)
-           ig=ig+1 
-         ENDDO
-      ENDDO
-c--OB=change second 1 to jjp1 here
-      dust_ec_glo(ig)=MAX(dust_nc_glo(1,1),0.0)
-!      end if master
-      ENDIF
-!$OMP END MASTER
-!$OMP BARRIER
-      CALL scatter(dust_ec_glo,dust_ec)
-c
-      RETURN 
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_dust.f90	(revision 5099)
@@ -0,0 +1,75 @@
+SUBROUTINE read_dust(debutphy, step, nbjour, dust_ec)
+  USE dimphy
+  USE mod_grid_phy_lmdz
+  USE mod_phys_lmdz_para
+  USE netcdf, ONLY : nf90_get_var, nf90_nowrite, nf90_open, nf90_inq_varid
+  IMPLICIT NONE
+
+  INCLUDE "dimensions.h"
+  INCLUDE "paramet.h"
+
+  INTEGER :: step, nbjour
+  LOGICAL :: debutphy
+  real :: dust_ec(klon)
+  real :: dust_ec_glo(klon_glo)
+
+  ! as      real dust_nc(iip1,jjp1)
+  real :: dust_nc_glo(nbp_lon + 1, nbp_lat)
+  integer :: rcode
+  integer :: ncid1, varid1, ncid2, varid2
+
+  save ncid1, varid1, ncid2, varid2
+  !$OMP THREADPRIVATE(ncid1, varid1, ncid2, varid2)
+  integer :: start(4), count(4), status
+  integer :: i, j, ig
+
+  !$OMP MASTER
+  IF (is_mpi_root .AND. is_omp_root) THEN
+    if (debutphy) then
+      ncid1 = nf90_open('dust.nc', nf90_nowrite, rcode)
+      varid1 = nf90_inq_varid(ncid1, 'EMISSION', rcode)
+    endif
+
+    start(1) = 1
+    start(2) = 1
+    start(4) = 0
+
+    count(1) = nbp_lon + 1
+    count(2) = nbp_lat
+    count(3) = 1
+    count(4) = 0
+
+    start(3) = step
+
+    status = nf90_get_var(ncid1, varid1, dust_nc_glo, start, count)
+
+    ! call correctbid(iim,jjp1,dust_nc)
+    call correctbid(nbp_lon, nbp_lat, dust_nc_glo)
+
+    !--upside down + physical grid
+
+    !--OB=change jjp1 to 1 here ;
+    !----AS: OB's change is needed if lats N to S (90 to -90) in dust.nc
+    !  dust_ec(1)=MAX(dust_nc(1,jjp1),0.0)
+    dust_ec_glo(1) = MAX(dust_nc_glo(1, nbp_lat), 0.0)
+    ig = 2
+    ! DO j=2,jjm
+    DO j = 2, nbp_lat - 1
+      ! DO i = 1, iim
+      DO i = 1, nbp_lon
+        !--OB=change jjp1+1-j to j here
+        ! dust_ec(ig)=MAX(dust_nc(i,jjp1+1-j),0.0)
+        dust_ec_glo(ig) = MAX(dust_nc_glo(i, nbp_lat + 1 - j), 0.0)
+        ig = ig + 1
+      ENDDO
+    ENDDO
+    !--OB=change second 1 to jjp1 here
+    dust_ec_glo(ig) = MAX(dust_nc_glo(1, 1), 0.0)
+    ! end if master
+  ENDIF
+  !$OMP END MASTER
+  !$OMP BARRIER
+  CALL scatter(dust_ec_glo, dust_ec)
+
+  RETURN
+END SUBROUTINE read_dust
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.F	(revision 5099)
@@ -27,9 +27,7 @@
 
       INCLUDE "dimensions.h"
-c      INCLUDE 'dimphy.h'      
-      INCLUDE 'paramet.h'      
+      INCLUDE 'paramet.h'
       INCLUDE 'chem.h'      
       INCLUDE 'chem_spla.h'
-c      INCLUDE 'indicesol.h'
 
       logical debutphy, lafinphy, edgar
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_surface.F90	(revision 5099)
@@ -5,10 +5,9 @@
 ! ------
        USE ioipsl
-!       USE comgeomphy
        USE dimphy
        USE mod_grid_phy_lmdz
        USE mod_phys_lmdz_para
        USE iophy
-       USE netcdf, ONLY:nf90_inq_varid,nf90_noerr,nf90_get_var
+       USE netcdf, ONLY:nf90_inq_varid,nf90_noerr,nf90_get_var,nf90_nowrite,nf90_inq_varid,nf90_open
        IMPLICIT NONE
 
@@ -18,19 +17,17 @@
        character*10 name
        character*10 varname
-!
+
        real tmp_dyn(iip1,jjp1)
        real tmp_dyn_glo(nbp_lon+1,nbp_lat)
-!       real tmp_dyn_glo(nbp_lon,nbp_lat)
        REAL tmp_dyn_invers(iip1,jjp1)
        real tmp_dyn_invers_glo(nbp_lon+1,nbp_lat)
-!       real tmp_dyn_invers_glo(nbp_lon,nbp_lat)
        real tmp_fi(klon)
        real tmp_fi_glo(klon_glo)
        real surfa(klon,5)
        real surfa_glo(klon_glo,5)
-!
+
        integer ncid
        integer varid
-       real rcode
+       integer rcode
        integer start(2),count(2),status
        integer i,j,l,ig
@@ -49,5 +46,5 @@
 
        print*,'Lecture du fichier donnees_lisa.nc' 
-       ncid=NCOPN('donnees_lisa.nc',NCNOWRIT,rcode)
+       ncid=nf90_open('donnees_lisa.nc',nf90_nowrite,rcode)
 
 !JE20140526<<: check if are inversed or not the latitude grid in donnes_lisa
@@ -72,5 +69,5 @@
 !      endj(1)=jjp1
       endj(1)=nbp_lat
-      varid=NCVID(ncid,latstr,rcode)
+      varid=nf90_inq_varid(ncid,latstr,rcode)
 
           status=nf90_get_var(ncid,varid,lats_glo,startj,endj)
@@ -89,6 +86,5 @@
           varname=trim(name)//str1
        print*,'lecture variable:',varname
-          varid=NCVID(ncid,trim(varname),rcode)
-!          varid=NCVID(ncid,varname,rcode)
+          varid=nf90_inq_varid(ncid,trim(varname),rcode)
 
 !  dimensions pour les champs scalaires et le vent zonal
@@ -135,5 +131,5 @@
 !JE20140526>>
 !      call dump2d(iim,jjm-1,tmp_fi(2),'tmp_fi   ')
-!
+
           DO j=1,klon_glo
 
@@ -141,5 +137,5 @@
 
           ENDDO ! Fin de recopie du tableau
-!
+
        ENDDO ! Fin boucle 1 a 5
        print*,'Passage Grille Dyn -> Phys'
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.F	(revision 5098)
+++ 	(revision )
@@ -1,132 +1,0 @@
-      SUBROUTINE read_vent(debutphy, step, nbjour, u10m_ec, v10m_ec)
-      USE dimphy
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE netcdf, ONLY: nf90_get_var
-!      USE write_field_phy
-      IMPLICIT NONE 
-      INCLUDE "dimensions.h"
-c       INCLUDE "dimphy.h"
-      INCLUDE "paramet.h"
-c
-      INTEGER step, nbjour
-      LOGICAL debutphy
-      real u10m_ec(klon), v10m_ec(klon)
-      real u10m_ec_glo(klon_glo), v10m_ec_glo(klon_glo)
-c
-!      real u10m_nc(iip1,jjp1) !, v10m_nc(iip1,jjm) ! dim 97x72
-!      real v10m_nc(iip1,jjp1)  ! dim 97x73
-      real u10m_nc_glo(nbp_lon+1,nbp_lat) !, v10m_nc(iip1,jjm) ! dim 97x72
-      real v10m_nc_glo(nbp_lon+1,nbp_lat)  ! dim 97x73
-      real rcode
-      integer ncidu1, varidu1, ncidv1, varidv1
-      save ncidu1, varidu1, ncidv1, varidv1
-!$OMP THREADPRIVATE(ncidu1, varidu1, ncidv1, varidv1)
-      integer start(4),count(4), status
-      integer i, j, ig
-
-
-c
-!$OMP MASTER
-      IF (is_mpi_root .AND. is_omp_root) THEN
-      if (debutphy) then
-c
-         ncidu1=NCOPN('u10m.nc',NCNOWRIT,rcode)
-         varidu1=NCVID(ncidu1,'U10M',rcode)
-         ncidv1=NCOPN('v10m.nc',NCNOWRIT,rcode)
-         varidv1=NCVID(ncidv1,'V10M',rcode)
-c
-      endif
-c
-      start(1)=1
-      start(2)=1
-      start(4)=0
-
-!      count(1)=iip1
-      count(1)=nbp_lon+1
-!      count(2)=jjp1
-      count(2)=nbp_lat
-      count(3)=1
-      count(4)=0
-c
-      start(3)=step
-
-      status=nf90_get_var(ncidu1,varidu1,u10m_nc_glo,start,count)
-
-      status=nf90_get_var(ncidv1,varidv1,v10m_nc_glo,start,count)
-
-
-!      print *,'beforebidcor u10m_nc', u10m_nc(1,jjp1)
-!      print *,'beforebidcor v10m_nc', v10m_nc(1,jjp1)
-
-!       print *,status
-!      call correctbid(iim,jjp1,u10m_nc)
-!      call correctbid(iim,jjp1,v10m_nc)
-      call correctbid(nbp_lon,nbp_lat,u10m_nc_glo)
-      call correctbid(nbp_lon,nbp_lat,v10m_nc_glo)
-
-!      print *,'afterbidcor u10m_nc', u10m_nc(1,jjp1)
-!      print *,'afterbidcor v10m_nc', v10m_nc(1,jjp1)
-c
-c--upside down + physical grid
-c
-!      u10m_ec(1)=u10m_nc(1,jjp1)
-!      v10m_ec(1)=v10m_nc(1,jjp1)
-      u10m_ec_glo(1)=u10m_nc_glo(1,nbp_lat)
-      v10m_ec_glo(1)=v10m_nc_glo(1,nbp_lat)
-      ig=2
-!      DO j=2,jjm
-!         DO i = 1, iim
-      DO j=2,nbp_lat-1
-         DO i = 1, nbp_lon
-!           u10m_ec(ig)=u10m_nc(i,jjp1+1-j)
-!           v10m_ec(ig)=v10m_nc(i,jjp1+1-j)
-           u10m_ec_glo(ig)=u10m_nc_glo(i,nbp_lat+1-j)
-           v10m_ec_glo(ig)=v10m_nc_glo(i,nbp_lat+1-j)
-           ig=ig+1
-!         print *,u10m_ec(ig) ,v10m_ec(ig) 
-         ENDDO
-      ENDDO
-      u10m_ec_glo(ig)=u10m_nc_glo(1,1)
-      v10m_ec_glo(ig)=v10m_nc_glo(1,1)
-
-
-!      end if master
-      ENDIF 
-!$OMP END MASTER
-!$OMP BARRIER
-      CALL scatter(u10m_ec_glo,u10m_ec)
-      CALL scatter(v10m_ec_glo,v10m_ec)
-
-!      print *,'JE  tamagno viento ig= ', ig
-!      print *,'READ_VENT U = ',SUM(u10m_ec),MINVAL(u10m_ec),
-!     .                                      MAXVAL(u10m_ec)
-!      print *,'READ_VENT V = ',SUM(v10m_ec),MINVAL(v10m_ec),
-!     .                                      MAXVAL(v10m_ec)
-!       print *,'u v 1 ', u10m_ec(1),v10m_ec(1)
-!       print *,'u v klon ', u10m_ec(klon),v10m_ec(klon)
-      RETURN 
-      END
-
-c added by JE from the nh SPLA, dyn3d/read_reanalyse.F which is not available any more
-      subroutine correctbid(iim,nl,x)
-      integer iim,nl
-      real x(iim+1,nl)
-      integer i,l
-      real zz
-
-      do l=1,nl
-         do i=2,iim-1
-            if(abs(x(i,l))>1.e10) then
-               zz=0.5*(x(i-1,l)+x(i+1,l))
-c              print*,'correction ',i,l,x(i,l),zz
-               x(i,l)=zz
-            endif
-         enddo
-      enddo
-
-      return
-      end
-
-
-
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_vent.f90	(revision 5099)
@@ -0,0 +1,128 @@
+SUBROUTINE read_vent(debutphy, step, nbjour, u10m_ec, v10m_ec)
+  USE dimphy
+  USE mod_grid_phy_lmdz
+  USE mod_phys_lmdz_para
+  USE netcdf, ONLY : nf90_get_var, nf90_open, nf90_inq_varid, nf90_nowrite
+  IMPLICIT NONE
+  INCLUDE "dimensions.h"
+  INCLUDE "paramet.h"
+
+  INTEGER :: step, nbjour
+  LOGICAL :: debutphy
+  real :: u10m_ec(klon), v10m_ec(klon)
+  real :: u10m_ec_glo(klon_glo), v10m_ec_glo(klon_glo)
+
+  !  real u10m_nc(iip1,jjp1) !, v10m_nc(iip1,jjm) ! dim 97x72
+  !  real v10m_nc(iip1,jjp1)  ! dim 97x73
+  real :: u10m_nc_glo(nbp_lon + 1, nbp_lat) !, v10m_nc(iip1,jjm) ! dim 97x72
+  real :: v10m_nc_glo(nbp_lon + 1, nbp_lat)  ! dim 97x73
+  integer :: rcode
+  integer :: ncidu1, varidu1, ncidv1, varidv1
+  save ncidu1, varidu1, ncidv1, varidv1
+  !$OMP THREADPRIVATE(ncidu1, varidu1, ncidv1, varidv1)
+  integer :: start(4), count(4), status
+  integer :: i, j, ig
+
+  !$OMP MASTER
+  IF (is_mpi_root .AND. is_omp_root) THEN
+    if (debutphy) then
+
+      ncidu1 = nf90_open('u10m.nc', nf90_nowrite, rcode)
+      varidu1 = nf90_inq_varid(ncidu1, 'U10M', rcode)
+      ncidv1 = nf90_open('v10m.nc', nf90_nowrite, rcode)
+      varidv1 = nf90_inq_varid(ncidv1, 'V10M', rcode)
+
+    endif
+
+    start(1) = 1
+    start(2) = 1
+    start(4) = 0
+
+    ! count(1)=iip1
+    count(1) = nbp_lon + 1
+    ! count(2)=jjp1
+    count(2) = nbp_lat
+    count(3) = 1
+    count(4) = 0
+
+    start(3) = step
+
+    status = nf90_get_var(ncidu1, varidu1, u10m_nc_glo, start, count)
+
+    status = nf90_get_var(ncidv1, varidv1, v10m_nc_glo, start, count)
+
+
+    ! print *,'beforebidcor u10m_nc', u10m_nc(1,jjp1)
+    ! print *,'beforebidcor v10m_nc', v10m_nc(1,jjp1)
+
+    !  print *,status
+    ! call correctbid(iim,jjp1,u10m_nc)
+    ! call correctbid(iim,jjp1,v10m_nc)
+    call correctbid(nbp_lon, nbp_lat, u10m_nc_glo)
+    call correctbid(nbp_lon, nbp_lat, v10m_nc_glo)
+
+    ! print *,'afterbidcor u10m_nc', u10m_nc(1,jjp1)
+    ! print *,'afterbidcor v10m_nc', v10m_nc(1,jjp1)
+
+    !--upside down + physical grid
+
+    !  u10m_ec(1)=u10m_nc(1,jjp1)
+    !  v10m_ec(1)=v10m_nc(1,jjp1)
+    u10m_ec_glo(1) = u10m_nc_glo(1, nbp_lat)
+    v10m_ec_glo(1) = v10m_nc_glo(1, nbp_lat)
+    ig = 2
+    ! DO j=2,jjm
+    !    DO i = 1, iim
+    DO j = 2, nbp_lat - 1
+      DO i = 1, nbp_lon
+        ! u10m_ec(ig)=u10m_nc(i,jjp1+1-j)
+        ! v10m_ec(ig)=v10m_nc(i,jjp1+1-j)
+        u10m_ec_glo(ig) = u10m_nc_glo(i, nbp_lat + 1 - j)
+        v10m_ec_glo(ig) = v10m_nc_glo(i, nbp_lat + 1 - j)
+        ig = ig + 1
+        ! print *,u10m_ec(ig) ,v10m_ec(ig)
+      ENDDO
+    ENDDO
+    u10m_ec_glo(ig) = u10m_nc_glo(1, 1)
+    v10m_ec_glo(ig) = v10m_nc_glo(1, 1)
+
+
+    ! end if master
+  ENDIF
+  !$OMP END MASTER
+  !$OMP BARRIER
+  CALL scatter(u10m_ec_glo, u10m_ec)
+  CALL scatter(v10m_ec_glo, v10m_ec)
+
+  ! print *,'JE  tamagno viento ig= ', ig
+  ! print *,'READ_VENT U = ',SUM(u10m_ec),MINVAL(u10m_ec),
+  ! .                                      MAXVAL(u10m_ec)
+  !  print *,'READ_VENT V = ',SUM(v10m_ec),MINVAL(v10m_ec),
+  ! .                                      MAXVAL(v10m_ec)
+  !   print *,'u v 1 ', u10m_ec(1),v10m_ec(1)
+  !   print *,'u v klon ', u10m_ec(klon),v10m_ec(klon)
+  RETURN
+END SUBROUTINE read_vent
+
+! added by JE from the nh SPLA, dyn3d/read_reanalyse.F which is not available any more
+subroutine correctbid(iim, nl, x)
+  integer :: iim, nl
+  real :: x(iim + 1, nl)
+  integer :: i, l
+  real :: zz
+
+  do l = 1, nl
+    do i = 2, iim - 1
+      if(abs(x(i, l))>1.e10) then
+        zz = 0.5 * (x(i - 1, l) + x(i + 1, l))
+        ! print*,'correction ',i,l,x(i,l),zz
+        x(i, l) = zz
+      endif
+    enddo
+  enddo
+
+  return
+end subroutine correctbid
+
+
+
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/satellite_out_spla.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/satellite_out_spla.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/satellite_out_spla.F90	(revision 5099)
@@ -28,5 +28,5 @@
 !            pdtphys,rlon,rlat,masque_polder)
 !  ENDIF
-!
+
 !  DO i=1,klon
 !    IF ( masque_polder(i) .EQ. 1 ) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.F	(revision 5099)
@@ -14,5 +14,4 @@
       INCLUDE "dimensions.h"
       INCLUDE "chem.h"
-c       INCLUDE "dimphy.h"
       INCLUDE "YOMCST.h"
       INCLUDE "YOECUMF.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/spla_output_dat.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/spla_output_dat.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/spla_output_dat.h	(revision 5099)
@@ -172,20 +172,20 @@
 !      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)',  &
 !         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
-!
+
 !  type(ctrl_out),save :: o_taue670_aqua     = ctrl_out((/ 4, 4, 4, 10, 10, 10, 10, 10, 10, 10 /), &
 !  'taue670_aqua','Tau ext 670 aqua','', &
 !      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)',  &
 !         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
-!
+
 !  type(ctrl_out),save :: o_taue670_terra     = ctrl_out((/ 4, 4, 4, 10, 10, 10, 10, 10, 10, 10 /), &
 !  'taue670_terra','Tau ext 670 terra','', &
 !      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)',  &
 !         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
-!
+
 !  type(ctrl_out),save :: o_taue865_aqua     = ctrl_out((/ 4, 4, 4, 10, 10, 10, 10, 10, 10, 10 /), &
 !  'taue865_aqua','Tau ext 865 aqua','', &
 !      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)',  &
 !         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
-!
+
 !  type(ctrl_out),save :: o_taue865_terra     = ctrl_out((/ 4, 4, 4, 10, 10, 10, 10, 10, 10, 10 /), &
 !  'taue865_terra','Tau ext 865 terra','', &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/spla_output_write.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/spla_output_write.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/spla_output_write.h	(revision 5099)
@@ -183,5 +183,5 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! histrac_spl
-!
+
       CALL histwrite_phy( o_fluxbb              , fluxbb               )
       CALL histwrite_phy( o_fluxff              , fluxff               )
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_5wv_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_5wv_rrtm.F90	(revision 5098)
+++ 	(revision )
@@ -1,169 +1,0 @@
-!
-! $Id: splaeropt_5wv_rrtm.F90 2644 2016-10-02 16:55:08Z oboucher $
-!
-
-SUBROUTINE SPLAEROPT_5WV_RRTM(  &
-   zdm, zdh, tr_seri, RHcl,     &
-   tausum, tau )
-
-  USE DIMPHY
-  USE aero_mod
-  USE infotrac_phy, ONLY: nqtot, nbtr, tracers
-  USE phys_local_var_mod, ONLY: od550aer,od865aer,ec550aer,od550lt1aer
-  !
-  ! Olivier Boucher Jan 2017
-  ! Based on Mie routines on ciclad CMIP6
-  !
-  IMPLICIT NONE
-  !
-  ! Input arguments:
-  !
-  REAL, DIMENSION(klon,klev), INTENT(IN)   :: zdh      !--m
-  REAL, DIMENSION(klon,klev), INTENT(IN)   :: zdm      !--kg/m2
-  REAL, DIMENSION(klon,klev), INTENT(IN)   :: RHcl     ! humidite relative ciel clair
-  REAL, DIMENSION(klon,klev,nbtr), INTENT(IN) :: tr_seri
-  !
-  ! Output arguments:
-  !
-  REAL, DIMENSION(klon,nwave,naero_tot), INTENT(OUT)      :: tausum
-  REAL, DIMENSION(klon,klev,nwave,naero_tot), INTENT(OUT) :: tau
-  !
-  ! Local
-  !
-  INTEGER, PARAMETER :: las = nwave_sw
-  LOGICAL :: soluble
-  
-  INTEGER :: i, k, m, iq, itr, irh, aerindex
-  INTEGER :: spsol, spinsol, la
-  INTEGER :: RH_num(klon,klev)
-  INTEGER, PARAMETER :: la443 = 1
-  INTEGER, PARAMETER :: la550 = 2
-  INTEGER, PARAMETER :: la670 = 3
-  INTEGER, PARAMETER :: la765 = 4
-  INTEGER, PARAMETER :: la865 = 5
-  INTEGER, PARAMETER :: nbre_RH=12
-  INTEGER, PARAMETER :: naero_soluble=2
-  INTEGER, PARAMETER :: naero_insoluble=2
-  INTEGER, PARAMETER :: naero=naero_soluble+naero_insoluble
-
-  REAL, PARAMETER :: RH_tab(nbre_RH)=(/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./)
-  REAL, PARAMETER :: RH_MAX=95.
-  REAL :: delta(klon,klev), rh(klon,klev)
-  REAL :: tau_ae5wv_int   ! Intermediate computation of epaisseur optique aerosol
-  REAL :: zrho
-  CHARACTER*20 modname
-  
-  ! Soluble components 1-accumulation mode soluble; 2- seasalt coarse
-  REAL :: alpha_aers_5wv(nbre_RH,las,naero_soluble)   ! Ext. coeff. ** m2/g 
-  ! Insoluble components 1- Dust: 2- BC; 3- POM
-  REAL :: alpha_aeri_5wv(las,naero_insoluble)         ! Ext. coeff. ** m2/g 
-  !
-  ! Proprietes optiques
-  !
-  REAL :: fact_RH(nbre_RH)
-
-! From here on we look at the optical parameters at 5 wavelengths:  
-! 443nm, 550, 670, 765 and 865 nm 
-!                                   le 12 AVRIL 2006 
-!  
- DATA alpha_aers_5wv/ & 
-                           ! accumulation mode (sulfate+2% bc) soluble 
-       4.632, 4.632, 4.632, 4.632, 6.206, 6.827, 7.616, 8.716,10.514,12.025,14.688,21.539, &
-       3.981, 3.981, 3.981, 3.981, 5.346, 5.923, 6.662, 7.704, 9.437,10.914,13.562,20.591, &
-       3.265, 3.265, 3.265, 3.265, 4.400, 4.909, 5.565, 6.500, 8.081, 9.449,11.943,18.791, &
-       2.761, 2.761, 2.761, 2.761, 3.731, 4.182, 4.767, 5.606, 7.041, 8.294,10.610,17.118, &
-       2.307, 2.307, 2.307, 2.307, 3.129, 3.522, 4.034, 4.774, 6.052, 7.180, 9.286,15.340, &
-
-                           ! seasalt seasalt Coarse Soluble (CS)      
-       0.576, 0.690, 0.738, 0.789, 0.855, 0.935, 1.046, 1.212, 1.512, 1.785, 2.258, 3.449, &
-       0.595, 0.713, 0.763, 0.814, 0.880, 0.963, 1.079, 1.248, 1.550, 1.826, 2.306, 3.507, &
-       0.617, 0.738, 0.789, 0.842, 0.911, 0.996, 1.113, 1.286, 1.592, 1.871, 2.369, 3.562, &
-       0.632, 0.755, 0.808, 0.862, 0.931, 1.018, 1.140, 1.316, 1.626, 1.909, 2.409, 3.622, &
-       0.645, 0.771, 0.825, 0.880, 0.951, 1.039, 1.164, 1.344, 1.661, 1.948, 2.455, 3.682  /
-
-  DATA alpha_aeri_5wv/ &
-                                 ! coarse dust insoluble 
-       0.605, 0.611, 0.661, 0.714, 0.760, &
-                                 ! super coarse insoluble 
-       0.153, 0.156, 0.158, 0.157, 0.161 /
-  ! 
-  ! Initialisations
-  tausum(:,:,:)=0.
-  tau(:,:,:,:)=0.
-
-  modname='splaeropt_5wv_rrtm'
-
-  IF (naero>naero_tot) THEN
-    CALL abort_physic(modname,'Too many aerosol types',1)
-  ENDIF
-
-  DO irh=1,nbre_RH-1
-    fact_RH(irh)=1./(RH_tab(irh+1)-RH_tab(irh))
-  ENDDO
-   
-  DO k=1, klev
-    DO i=1, klon
-      rh(i,k)=MIN(RHcl(i,k)*100.,RH_MAX)
-      RH_num(i,k) = INT( rh(i,k)/10. + 1.)
-      IF (rh(i,k)>85.) RH_num(i,k)=10
-      IF (rh(i,k)>90.) RH_num(i,k)=11
-      delta(i,k)=(rh(i,k)-RH_tab(RH_num(i,k)))*fact_RH(RH_num(i,k))
-    ENDDO
-  ENDDO
-
-  itr = 0
-  DO iq = 1, nqtot
-    IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-    itr = itr+1
-    SELECT CASE(tracers(iq)%name)
-      CASE('PREC'); CYCLE                                  !--precursor
-      CASE('FINE'); soluble=.TRUE.;  spsol=1; aerindex=1   !--fine mode accumulation mode
-      CASE('COSS'); soluble=.TRUE.;  spsol=2; aerindex=2   !--coarse mode sea salt
-      CASE('CODU'); soluble=.FALSE.; spinsol=1; aerindex=3   !--coarse mode dust
-      CASE('SCDU'); soluble=.FALSE.; spinsol=2; aerindex=4   !--super coarse mode dust
-      CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(iq)%name,1)
-    END SELECT
-
-    DO la=1,las
-
-      !--only 550 and 865 nm are used
-      IF (la/=la550.AND.la/=la865) CYCLE
-
-      IF (soluble) THEN  !--soluble aerosol with RH dependence
-
-        DO k=1, klev
-          DO i=1, klon
-            tau_ae5wv_int = alpha_aers_5wv(RH_num(i,k),la,spsol)+DELTA(i,k)* &
-                           (alpha_aers_5wv(RH_num(i,k)+1,la,spsol) - & 
-                            alpha_aers_5wv(RH_num(i,k),la,spsol))
-            tau(i,k,la,aerindex) = tr_seri(i,k,itr)*zdm(i,k)*tau_ae5wv_int
-            tausum(i,la,aerindex)=tausum(i,la,aerindex)+tau(i,k,la,aerindex)
-          ENDDO
-        ENDDO
-
-      ELSE               !--cases of insoluble aerosol
-
-        DO k=1, klev
-          DO i=1, klon
-            tau_ae5wv_int = alpha_aeri_5wv(la,spinsol)
-            tau(i,k,la,aerindex) = tr_seri(i,k,itr)*zdm(i,k)*tau_ae5wv_int
-            tausum(i,la,aerindex)= tausum(i,la,aerindex)+tau(i,k,la,aerindex)
-          ENDDO
-        ENDDO
-
-      ENDIF
-
-    ENDDO   ! Boucle sur les longueurs d'onde
-  ENDDO     ! Boucle sur les masses de traceurs
-
-!--AOD calculations for diagnostics
-  od550aer(:)=SUM(tausum(:,la550,1:naero),dim=2)
-  od865aer(:)=SUM(tausum(:,la865,1:naero),dim=2)
-
-!--extinction coefficient for diagnostic
-  ec550aer(:,:)=SUM(tau(:,:,la550,1:naero),dim=3)/zdh(:,:)
-
-!--aod for particles lower than 1 micron
-  od550lt1aer(:)=tausum(:,la550,1)+tausum(:,la550,2)*0.3+tausum(:,la550,3)*0.2
-
-END SUBROUTINE SPLAEROPT_5WV_RRTM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_5wv_rrtm.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_5wv_rrtm.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_5wv_rrtm.f90	(revision 5099)
@@ -0,0 +1,168 @@
+
+! $Id: splaeropt_5wv_rrtm.F90 2644 2016-10-02 16:55:08Z oboucher $
+
+SUBROUTINE SPLAEROPT_5WV_RRTM(&
+        zdm, zdh, tr_seri, RHcl, &
+        tausum, tau)
+
+  USE DIMPHY
+  USE aero_mod
+  USE infotrac_phy, ONLY : nqtot, nbtr, tracers
+  USE phys_local_var_mod, ONLY : od550aer, od865aer, ec550aer, od550lt1aer
+
+  ! Olivier Boucher Jan 2017
+  ! Based on Mie routines on ciclad CMIP6
+
+  IMPLICIT NONE
+
+  ! Input arguments:
+
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: zdh      !--m
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: zdm      !--kg/m2
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: RHcl     ! humidite relative ciel clair
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: tr_seri
+
+  ! Output arguments:
+
+  REAL, DIMENSION(klon, nwave, naero_tot), INTENT(OUT) :: tausum
+  REAL, DIMENSION(klon, klev, nwave, naero_tot), INTENT(OUT) :: tau
+
+  ! Local
+
+  INTEGER, PARAMETER :: las = nwave_sw
+  LOGICAL :: soluble
+
+  INTEGER :: i, k, m, iq, itr, irh, aerindex
+  INTEGER :: spsol, spinsol, la
+  INTEGER :: RH_num(klon, klev)
+  INTEGER, PARAMETER :: la443 = 1
+  INTEGER, PARAMETER :: la550 = 2
+  INTEGER, PARAMETER :: la670 = 3
+  INTEGER, PARAMETER :: la765 = 4
+  INTEGER, PARAMETER :: la865 = 5
+  INTEGER, PARAMETER :: nbre_RH = 12
+  INTEGER, PARAMETER :: naero_soluble = 2
+  INTEGER, PARAMETER :: naero_insoluble = 2
+  INTEGER, PARAMETER :: naero = naero_soluble + naero_insoluble
+
+  REAL, PARAMETER :: RH_tab(nbre_RH) = (/0., 10., 20., 30., 40., 50., 60., 70., 80., 85., 90., 95./)
+  REAL, PARAMETER :: RH_MAX = 95.
+  REAL :: delta(klon, klev), rh(klon, klev)
+  REAL :: tau_ae5wv_int   ! Intermediate computation of epaisseur optique aerosol
+  REAL :: zrho
+  CHARACTER*20 modname
+
+  ! Soluble components 1-accumulation mode soluble; 2- seasalt coarse
+  REAL :: alpha_aers_5wv(nbre_RH, las, naero_soluble)   ! Ext. coeff. ** m2/g
+  ! Insoluble components 1- Dust: 2- BC; 3- POM
+  REAL :: alpha_aeri_5wv(las, naero_insoluble)         ! Ext. coeff. ** m2/g
+
+  ! Proprietes optiques
+
+  REAL :: fact_RH(nbre_RH)
+
+  ! From here on we look at the optical parameters at 5 wavelengths:
+  ! 443nm, 550, 670, 765 and 865 nm
+  !                                   le 12 AVRIL 2006
+
+  DATA alpha_aers_5wv/ &
+          ! accumulation mode (sulfate+2% bc) soluble
+          4.632, 4.632, 4.632, 4.632, 6.206, 6.827, 7.616, 8.716, 10.514, 12.025, 14.688, 21.539, &
+          3.981, 3.981, 3.981, 3.981, 5.346, 5.923, 6.662, 7.704, 9.437, 10.914, 13.562, 20.591, &
+          3.265, 3.265, 3.265, 3.265, 4.400, 4.909, 5.565, 6.500, 8.081, 9.449, 11.943, 18.791, &
+          2.761, 2.761, 2.761, 2.761, 3.731, 4.182, 4.767, 5.606, 7.041, 8.294, 10.610, 17.118, &
+          2.307, 2.307, 2.307, 2.307, 3.129, 3.522, 4.034, 4.774, 6.052, 7.180, 9.286, 15.340, &
+
+          ! seasalt seasalt Coarse Soluble (CS)
+          0.576, 0.690, 0.738, 0.789, 0.855, 0.935, 1.046, 1.212, 1.512, 1.785, 2.258, 3.449, &
+          0.595, 0.713, 0.763, 0.814, 0.880, 0.963, 1.079, 1.248, 1.550, 1.826, 2.306, 3.507, &
+          0.617, 0.738, 0.789, 0.842, 0.911, 0.996, 1.113, 1.286, 1.592, 1.871, 2.369, 3.562, &
+          0.632, 0.755, 0.808, 0.862, 0.931, 1.018, 1.140, 1.316, 1.626, 1.909, 2.409, 3.622, &
+          0.645, 0.771, 0.825, 0.880, 0.951, 1.039, 1.164, 1.344, 1.661, 1.948, 2.455, 3.682  /
+
+  DATA alpha_aeri_5wv/ &
+          ! coarse dust insoluble
+          0.605, 0.611, 0.661, 0.714, 0.760, &
+          ! super coarse insoluble
+          0.153, 0.156, 0.158, 0.157, 0.161 /
+
+  ! Initialisations
+  tausum(:, :, :) = 0.
+  tau(:, :, :, :) = 0.
+
+  modname = 'splaeropt_5wv_rrtm'
+
+  IF (naero>naero_tot) THEN
+    CALL abort_physic(modname, 'Too many aerosol types', 1)
+  ENDIF
+
+  DO irh = 1, nbre_RH - 1
+    fact_RH(irh) = 1. / (RH_tab(irh + 1) - RH_tab(irh))
+  ENDDO
+
+  DO k = 1, klev
+    DO i = 1, klon
+      rh(i, k) = MIN(RHcl(i, k) * 100., RH_MAX)
+      RH_num(i, k) = INT(rh(i, k) / 10. + 1.)
+      IF (rh(i, k)>85.) RH_num(i, k) = 10
+      IF (rh(i, k)>90.) RH_num(i, k) = 11
+      delta(i, k) = (rh(i, k) - RH_tab(RH_num(i, k))) * fact_RH(RH_num(i, k))
+    ENDDO
+  ENDDO
+
+  itr = 0
+  DO iq = 1, nqtot
+    IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+    itr = itr + 1
+    SELECT CASE(tracers(iq)%name)
+    CASE('PREC'); CYCLE                                  !--precursor
+    CASE('FINE'); soluble = .TRUE.;  spsol = 1; aerindex = 1   !--fine mode accumulation mode
+    CASE('COSS'); soluble = .TRUE.;  spsol = 2; aerindex = 2   !--coarse mode sea salt
+    CASE('CODU'); soluble = .FALSE.; spinsol = 1; aerindex = 3   !--coarse mode dust
+    CASE('SCDU'); soluble = .FALSE.; spinsol = 2; aerindex = 4   !--super coarse mode dust
+    CASE DEFAULT; CALL abort_physic(modname, 'I cannot do aerosol optics for ' // tracers(iq)%name, 1)
+    END SELECT
+
+    DO la = 1, las
+
+      !--only 550 and 865 nm are used
+      IF (la/=la550.AND.la/=la865) CYCLE
+
+      IF (soluble) THEN  !--soluble aerosol with RH dependence
+
+        DO k = 1, klev
+          DO i = 1, klon
+            tau_ae5wv_int = alpha_aers_5wv(RH_num(i, k), la, spsol) + DELTA(i, k) * &
+                    (alpha_aers_5wv(RH_num(i, k) + 1, la, spsol) - &
+                            alpha_aers_5wv(RH_num(i, k), la, spsol))
+            tau(i, k, la, aerindex) = tr_seri(i, k, itr) * zdm(i, k) * tau_ae5wv_int
+            tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
+          ENDDO
+        ENDDO
+
+      ELSE               !--cases of insoluble aerosol
+
+        DO k = 1, klev
+          DO i = 1, klon
+            tau_ae5wv_int = alpha_aeri_5wv(la, spinsol)
+            tau(i, k, la, aerindex) = tr_seri(i, k, itr) * zdm(i, k) * tau_ae5wv_int
+            tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
+          ENDDO
+        ENDDO
+
+      ENDIF
+
+    ENDDO   ! Boucle sur les longueurs d'onde
+  ENDDO     ! Boucle sur les masses de traceurs
+
+  !--AOD calculations for diagnostics
+  od550aer(:) = SUM(tausum(:, la550, 1:naero), dim = 2)
+  od865aer(:) = SUM(tausum(:, la865, 1:naero), dim = 2)
+
+  !--extinction coefficient for diagnostic
+  ec550aer(:, :) = SUM(tau(:, :, la550, 1:naero), dim = 3) / zdh(:, :)
+
+  !--aod for particles lower than 1 micron
+  od550lt1aer(:) = tausum(:, la550, 1) + tausum(:, la550, 2) * 0.3 + tausum(:, la550, 3) * 0.2
+
+END SUBROUTINE SPLAEROPT_5WV_RRTM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_6bands_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_6bands_rrtm.F90	(revision 5098)
+++ 	(revision )
@@ -1,253 +1,0 @@
-!
-! $Id: splaeropt_6bands_rrtm.F90 2644 2016-10-02 16:55:08Z oboucher $
-!
-SUBROUTINE SPLAEROPT_6BANDS_RRTM ( &
-     zdm, tr_seri, RHcl,           &
-     tau_allaer, piz_allaer, cg_allaer )
-
-  USE dimphy
-  USE aero_mod
-  USE infotrac_phy, ONLY: nqtot, nbtr, tracers
-  USE phys_local_var_mod, ONLY: abs550aer
-
-  ! Olivier Boucher Jan 2017
-  ! based on Mie routines on ciclad CMIP6
-  !
-  IMPLICIT NONE
-
-  INCLUDE "clesphys.h"
-  !
-  ! Input arguments:
-  !
-  REAL, DIMENSION(klon,klev),     INTENT(IN)  :: zdm        !--hauteur des couches en kg/m2
-  REAL, DIMENSION(klon,klev),     INTENT(IN)  :: RHcl       ! humidite relative ciel clair
-  REAL, DIMENSION(klon,klev,nbtr),INTENT(IN)  :: tr_seri
-  !
-  ! Output arguments:
-  ! 2= total aerosols 
-  ! 1= natural aerosols
-  !
-  REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(OUT) :: tau_allaer ! epaisseur optique aerosol
-  REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(OUT) :: piz_allaer ! single scattering albedo aerosol
-  REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(OUT) :: cg_allaer  ! asymmetry parameter aerosol
-  !
-  ! Local
-  !
-  LOGICAL :: soluble
-  INTEGER :: i, k, irh, iq, itr, inu
-  INTEGER :: aerindex, spsol, spinsol
-  INTEGER :: RH_num(klon,klev)
-
-  INTEGER, PARAMETER :: naero_soluble=2    ! 1- accumulation soluble; 2- coarse soluble
-  INTEGER, PARAMETER :: naero_insoluble=2  ! 1- coarse dust; 2- supercoarse dust
-  INTEGER, PARAMETER :: naero=naero_soluble+naero_insoluble
-
-  INTEGER, PARAMETER :: nbre_RH=12
-  REAL,PARAMETER :: RH_tab(nbre_RH)=(/0.,10.,20.,30.,40.,50.,60.,70.,80.,85.,90.,95./)
-  REAL, PARAMETER :: RH_MAX=95.
-  REAL :: delta(klon,klev), rh(klon,klev)
-  REAL :: tau_ae2b_int   ! Intermediate computation of epaisseur optique aerosol
-  REAL :: piz_ae2b_int   ! Intermediate computation of Single scattering albedo
-  REAL :: cg_ae2b_int    ! Intermediate computation of Assymetry parameter
-  REAL :: fact_RH(nbre_RH), tmp_var
-  !
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  tau_ae
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  piz_ae
-  REAL, DIMENSION(klon,klev,naero_tot,nbands_sw_rrtm) ::  cg_ae
-  !
-  ! Proprietes optiques
-  !
-  REAL:: alpha_aers_6bands(nbre_RH,nbands_sw_rrtm,naero_soluble)   !--unit m2/g aer
-  REAL:: alpha_aeri_6bands(nbands_sw_rrtm,naero_insoluble)         !--unit m2/g aer
-  REAL:: cg_aers_6bands(nbre_RH,nbands_sw_rrtm,naero_soluble)      !--unitless 
-  REAL:: cg_aeri_6bands(nbands_sw_rrtm,naero_insoluble)            !--unitless
-  REAL:: piz_aers_6bands(nbre_RH,nbands_sw_rrtm,naero_soluble)     !--unitless
-  REAL:: piz_aeri_6bands(nbands_sw_rrtm,naero_insoluble)           !--unitless
-  !
-  REAL, PARAMETER :: tau_min = 1.e-8
-  CHARACTER*20 modname
-
-!***************************************************************************
-!--the order of the soluble   species has to follow the spsol   index below
-!--the order of the insoluble species has to follow the spinsol index below
-
-  DATA alpha_aers_6bands/  & 
-       ! accumulation (sulfate+2% bc) mode soluble
-  5.212, 5.212, 5.212, 5.212, 6.973, 7.581, 8.349, 9.400,11.078,12.463,14.857,20.837, &
-  4.906, 4.906, 4.906, 4.906, 6.568, 7.195, 7.989, 9.088,10.869,12.354,14.951,21.545, &
-  3.940, 3.940, 3.940, 3.940, 5.291, 5.861, 6.591, 7.620, 9.332,10.791,13.410,20.370, &
-  2.292, 2.292, 2.292, 2.292, 3.105, 3.493, 3.996, 4.724, 5.978, 7.084, 9.146,15.067, &
-  0.762, 0.762, 0.762, 0.762, 1.050, 1.201, 1.401, 1.699, 2.232, 2.721, 3.675, 6.678, &
-  0.090, 0.090, 0.090, 0.090, 0.122, 0.141, 0.166, 0.204, 0.275, 0.344, 0.484, 0.973, &
-        ! coarse seasalt
-  0.547, 0.657, 0.705, 0.754, 0.817, 0.896, 1.008, 1.169, 1.456, 1.724, 2.199, 3.358, &
-  0.566, 0.679, 0.727, 0.776, 0.840, 0.920, 1.032, 1.196, 1.492, 1.760, 2.238, 3.416, &
-  0.596, 0.714, 0.764, 0.816, 0.882, 0.965, 1.081, 1.250, 1.552, 1.828, 2.310, 3.509, &
-  0.644, 0.771, 0.825, 0.880, 0.951, 1.040, 1.164, 1.345, 1.666, 1.957, 2.462, 3.700, &
-  0.640, 0.772, 0.829, 0.887, 0.965, 1.061, 1.198, 1.398, 1.758, 2.085, 2.658, 4.031, &
-  0.452, 0.562, 0.609, 0.659, 0.728, 0.813, 0.938, 1.125, 1.471, 1.797, 2.384, 3.855  /
-
-  DATA alpha_aeri_6bands/  & 
-       ! coarse dust insoluble
-  0.594, 0.610, 0.619, 0.762, 0.791, 0.495, &
-       ! supercoarse dust insoluble 
-  0.151, 0.152, 0.155, 0.159, 0.168, 0.167  /
-
-  DATA cg_aers_6bands/ &
-       ! accumulation (sulfate+2% bc) mode soluble 
-  0.692, 0.692, 0.692, 0.692, 0.735, 0.739, 0.744, 0.749, 0.755, 0.759, 0.765, 0.772, &
-  0.690, 0.690, 0.690, 0.690, 0.736, 0.740, 0.746, 0.752, 0.760, 0.765, 0.771, 0.779, &
-  0.678, 0.678, 0.678, 0.678, 0.727, 0.733, 0.740, 0.748, 0.759, 0.766, 0.775, 0.787, &
-  0.641, 0.641, 0.641, 0.641, 0.692, 0.700, 0.710, 0.721, 0.736, 0.746, 0.760, 0.781, &
-  0.553, 0.553, 0.553, 0.553, 0.603, 0.615, 0.627, 0.643, 0.664, 0.678, 0.699, 0.735, &
-  0.343, 0.343, 0.343, 0.343, 0.386, 0.399, 0.414, 0.433, 0.460, 0.480, 0.510, 0.569, &
-       ! seasalt coarse Soluble
-  0.754, 0.770, 0.776, 0.781, 0.784, 0.791, 0.797, 0.805, 0.815, 0.822, 0.828, 0.840, &
-  0.736, 0.753, 0.759, 0.765, 0.771, 0.778, 0.785, 0.793, 0.804, 0.811, 0.820, 0.831, &
-  0.716, 0.735, 0.742, 0.748, 0.754, 0.762, 0.769, 0.778, 0.789, 0.796, 0.807, 0.819, &
-  0.704, 0.725, 0.733, 0.739, 0.745, 0.752, 0.759, 0.768, 0.778, 0.784, 0.792, 0.803, &
-  0.716, 0.737, 0.744, 0.751, 0.756, 0.763, 0.770, 0.777, 0.786, 0.790, 0.795, 0.800, &
-  0.688, 0.730, 0.741, 0.751, 0.761, 0.771, 0.782, 0.795, 0.810, 0.820, 0.833, 0.849  /
-
-  DATA cg_aeri_6bands/ &
-       ! coarse dust insoluble
-  0.801, 0.779, 0.709, 0.698, 0.710, 0.687, &
-       ! super coarse dust insoluble
-  0.862, 0.871, 0.852, 0.799, 0.758, 0.651  /
-
-  DATA piz_aers_6bands/&
-       ! accumulation (sulfate+2% bc) mode soluble
-  0.941, 0.941, 0.941, 0.941, 0.958, 0.961, 0.965, 0.969, 0.974, 0.977, 0.981, 0.987, &
-  0.941, 0.941, 0.941, 0.941, 0.959, 0.963, 0.967, 0.971, 0.976, 0.979, 0.983, 0.988, &
-  0.953, 0.953, 0.953, 0.953, 0.967, 0.971, 0.974, 0.978, 0.982, 0.984, 0.988, 0.992, &
-  0.955, 0.955, 0.955, 0.955, 0.969, 0.972, 0.976, 0.980, 0.984, 0.986, 0.989, 0.994, &
-  0.936, 0.936, 0.936, 0.936, 0.955, 0.961, 0.966, 0.972, 0.978, 0.982, 0.987, 0.993, &
-  0.792, 0.792, 0.792, 0.792, 0.848, 0.867, 0.887, 0.907, 0.931, 0.944, 0.960, 0.980, &
-       ! seasalt coarse soluble
-  1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.001, 1.000, &
-  1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
-  1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
-  1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
-  0.994, 0.994, 0.995, 0.995, 0.995, 0.995, 0.996, 0.996, 0.996, 0.996, 0.996, 0.996, &
-  0.976, 0.867, 0.837, 0.814, 0.796, 0.774, 0.754, 0.735, 0.713, 0.702, 0.690, 0.675  /
-
-  DATA piz_aeri_6bands/ &
-       ! coarse dust insoluble
-  0.866, 0.875, 0.915, 0.977, 0.993, 0.971, &
-       ! super coarse dust insoluble
-  0.789, 0.749, 0.791, 0.918, 0.970, 0.909  /
-!
-  spsol = 0
-  spinsol = 0 
-
-  modname='splaeropt_6bands_rrt'
-
-  IF (NSW/=nbands_sw_rrtm) THEN
-     CALL abort_physic(modname,'Erreur NSW doit etre egal a 6 pour cette routine',1)
-  ENDIF
-
-  DO irh=1,nbre_RH-1
-    fact_RH(irh)=1./(RH_tab(irh+1)-RH_tab(irh))
-  ENDDO
-   
-  DO k=1, klev
-    DO i=1, klon
-      rh(i,k)=MIN(RHcl(i,k)*100.,RH_MAX)
-      RH_num(i,k) = INT(rh(i,k)/10. + 1.)
-      IF (rh(i,k)>85.) RH_num(i,k)=10
-      IF (rh(i,k)>90.) RH_num(i,k)=11
-      delta(i,k)=(rh(i,k)-RH_tab(RH_num(i,k)))*fact_RH(RH_num(i,k))
-    ENDDO
-  ENDDO
-
-  tau_ae(:,:,:,:)=0.
-  piz_ae(:,:,:,:)=0.
-  cg_ae(:,:,:,:)=0.
-    
-  itr = 0
-  DO iq = 1, nqtot
-    IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-    itr = itr+1
-    SELECT CASE(tracers(iq)%name)
-      CASE('PREC'); CYCLE                                  !--precursor
-      CASE('FINE'); soluble=.TRUE.;  spsol=1; aerindex=1   !--fine mode accumulation mode
-      CASE('COSS'); soluble=.TRUE.;  spsol=2; aerindex=2   !--coarse mode sea salt
-      CASE('CODU'); soluble=.FALSE.; spinsol=1; aerindex=3   !--coarse mode dust
-      CASE('SCDU'); soluble=.FALSE.; spinsol=2; aerindex=4   !--super coarse mode dust
-      CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(iq)%name,1)
-    END SELECT
-
-    IF (soluble) THEN ! For aerosol soluble components
-
-         DO k=1, klev
-           DO i=1, klon
-
-             tmp_var=tr_seri(i,k,itr)*zdm(i,k) !-- g/m2
-
-             DO inu=1,NSW
-
-               tau_ae2b_int= alpha_aers_6bands(RH_num(i,k),inu,spsol)+ & 
-                             delta(i,k)* (alpha_aers_6bands(RH_num(i,k)+1,inu,spsol) - & 
-                             alpha_aers_6bands(RH_num(i,k),inu,spsol))
-                   
-               piz_ae2b_int = piz_aers_6bands(RH_num(i,k),inu,spsol) + & 
-                              delta(i,k)* (piz_aers_6bands(RH_num(i,k)+1,inu,spsol) - & 
-                              piz_aers_6bands(RH_num(i,k),inu,spsol))
-                   
-               cg_ae2b_int = cg_aers_6bands(RH_num(i,k),inu,spsol) + & 
-                             delta(i,k)* (cg_aers_6bands(RH_num(i,k)+1,inu,spsol) - & 
-                             cg_aers_6bands(RH_num(i,k),inu,spsol))
-
-               tau_ae(i,k,aerindex,inu)    = tmp_var*tau_ae2b_int
-               piz_ae(i,k,aerindex,inu)    = piz_ae2b_int
-               cg_ae(i,k,aerindex,inu)     = cg_ae2b_int
-
-             ENDDO
-           ENDDO
-         ENDDO
-
-    ELSE    ! For all aerosol insoluble components
-
-       DO k=1, klev
-         DO i=1, klon
-
-           tmp_var=tr_seri(i,k,itr)*zdm(i,k) !-- g/m2
-
-           DO inu=1,NSW
-             tau_ae2b_int = alpha_aeri_6bands(inu,spinsol)
-             piz_ae2b_int = piz_aeri_6bands(inu,spinsol)
-             cg_ae2b_int = cg_aeri_6bands(inu,spinsol) 
-
-             tau_ae(i,k,aerindex,inu) = tmp_var*tau_ae2b_int
-             piz_ae(i,k,aerindex,inu) = piz_ae2b_int
-             cg_ae(i,k,aerindex,inu)= cg_ae2b_int
-           ENDDO
-         ENDDO
-       ENDDO
-
-     ENDIF ! soluble / insoluble
-
-  ENDDO  ! nbtr
-
-!--all (natural + anthropogenic) aerosol
-  tau_allaer(:,:,2,:)=SUM(tau_ae(:,:,1:naero,:),dim=3) 
-  tau_allaer(:,:,2,:)=MAX(tau_allaer(:,:,2,:),tau_min)
-
-  piz_allaer(:,:,2,:)=SUM(tau_ae(:,:,1:naero,:)*piz_ae(:,:,1:naero,:),dim=3)/tau_allaer(:,:,2,:)
-  piz_allaer(:,:,2,:)=MIN(MAX(piz_allaer(:,:,2,:),0.01),1.0)
-  WHERE (tau_allaer(:,:,2,:)<=tau_min) piz_allaer(:,:,2,:)=1.0
-
-  cg_allaer(:,:,2,:)=SUM(tau_ae(:,:,1:naero,:)*piz_ae(:,:,1:naero,:)*cg_ae(:,:,1:naero,:),dim=3)/  & 
-                     (tau_allaer(:,:,2,:)*piz_allaer(:,:,2,:))
-  cg_allaer(:,:,2,:)=MIN(MAX(cg_allaer(:,:,2,:),0.0),1.0)
-
-!--no aerosol
-  tau_allaer(:,:,1,:)=tau_min 
-  piz_allaer(:,:,1,:)=1.0 
-  cg_allaer(:,:,1,:)=0.0
-
-!--waveband 2 and all aerosol (third index = 2)
-  inu=2
-  abs550aer(:)=SUM((1-piz_allaer(:,:,2,inu))*tau_allaer(:,:,2,inu),dim=2)
-
-END SUBROUTINE SPLAEROPT_6BANDS_RRTM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_6bands_rrtm.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_6bands_rrtm.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_6bands_rrtm.f90	(revision 5099)
@@ -0,0 +1,253 @@
+
+! $Id: splaeropt_6bands_rrtm.F90 2644 2016-10-02 16:55:08Z oboucher $
+
+SUBROUTINE SPLAEROPT_6BANDS_RRTM (&
+        zdm, tr_seri, RHcl, &
+        tau_allaer, piz_allaer, cg_allaer)
+
+  USE dimphy
+  USE aero_mod
+  USE infotrac_phy, ONLY : nqtot, nbtr, tracers
+  USE phys_local_var_mod, ONLY : abs550aer
+
+  ! Olivier Boucher Jan 2017
+  ! based on Mie routines on ciclad CMIP6
+
+  IMPLICIT NONE
+
+  INCLUDE "clesphys.h"
+
+  ! Input arguments:
+
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: zdm        !--hauteur des couches en kg/m2
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: RHcl       ! humidite relative ciel clair
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: tr_seri
+
+  ! Output arguments:
+  ! 2= total aerosols 
+  ! 1= natural aerosols
+
+  REAL, DIMENSION(klon, klev, 2, nbands_sw_rrtm), INTENT(OUT) :: tau_allaer ! epaisseur optique aerosol
+  REAL, DIMENSION(klon, klev, 2, nbands_sw_rrtm), INTENT(OUT) :: piz_allaer ! single scattering albedo aerosol
+  REAL, DIMENSION(klon, klev, 2, nbands_sw_rrtm), INTENT(OUT) :: cg_allaer  ! asymmetry parameter aerosol
+
+  ! Local
+
+  LOGICAL :: soluble
+  INTEGER :: i, k, irh, iq, itr, inu
+  INTEGER :: aerindex, spsol, spinsol
+  INTEGER :: RH_num(klon, klev)
+
+  INTEGER, PARAMETER :: naero_soluble = 2    ! 1- accumulation soluble; 2- coarse soluble
+  INTEGER, PARAMETER :: naero_insoluble = 2  ! 1- coarse dust; 2- supercoarse dust
+  INTEGER, PARAMETER :: naero = naero_soluble + naero_insoluble
+
+  INTEGER, PARAMETER :: nbre_RH = 12
+  REAL, PARAMETER :: RH_tab(nbre_RH) = (/0., 10., 20., 30., 40., 50., 60., 70., 80., 85., 90., 95./)
+  REAL, PARAMETER :: RH_MAX = 95.
+  REAL :: delta(klon, klev), rh(klon, klev)
+  REAL :: tau_ae2b_int   ! Intermediate computation of epaisseur optique aerosol
+  REAL :: piz_ae2b_int   ! Intermediate computation of Single scattering albedo
+  REAL :: cg_ae2b_int    ! Intermediate computation of Assymetry parameter
+  REAL :: fact_RH(nbre_RH), tmp_var
+
+  REAL, DIMENSION(klon, klev, naero_tot, nbands_sw_rrtm) :: tau_ae
+  REAL, DIMENSION(klon, klev, naero_tot, nbands_sw_rrtm) :: piz_ae
+  REAL, DIMENSION(klon, klev, naero_tot, nbands_sw_rrtm) :: cg_ae
+
+  ! Proprietes optiques
+
+  REAL :: alpha_aers_6bands(nbre_RH, nbands_sw_rrtm, naero_soluble)   !--unit m2/g aer
+  REAL :: alpha_aeri_6bands(nbands_sw_rrtm, naero_insoluble)         !--unit m2/g aer
+  REAL :: cg_aers_6bands(nbre_RH, nbands_sw_rrtm, naero_soluble)      !--unitless
+  REAL :: cg_aeri_6bands(nbands_sw_rrtm, naero_insoluble)            !--unitless
+  REAL :: piz_aers_6bands(nbre_RH, nbands_sw_rrtm, naero_soluble)     !--unitless
+  REAL :: piz_aeri_6bands(nbands_sw_rrtm, naero_insoluble)           !--unitless
+
+  REAL, PARAMETER :: tau_min = 1.e-8
+  CHARACTER*20 modname
+
+  !***************************************************************************
+  !--the order of the soluble   species has to follow the spsol   index below
+  !--the order of the insoluble species has to follow the spinsol index below
+
+  DATA alpha_aers_6bands/  &
+          ! accumulation (sulfate+2% bc) mode soluble
+          5.212, 5.212, 5.212, 5.212, 6.973, 7.581, 8.349, 9.400, 11.078, 12.463, 14.857, 20.837, &
+          4.906, 4.906, 4.906, 4.906, 6.568, 7.195, 7.989, 9.088, 10.869, 12.354, 14.951, 21.545, &
+          3.940, 3.940, 3.940, 3.940, 5.291, 5.861, 6.591, 7.620, 9.332, 10.791, 13.410, 20.370, &
+          2.292, 2.292, 2.292, 2.292, 3.105, 3.493, 3.996, 4.724, 5.978, 7.084, 9.146, 15.067, &
+          0.762, 0.762, 0.762, 0.762, 1.050, 1.201, 1.401, 1.699, 2.232, 2.721, 3.675, 6.678, &
+          0.090, 0.090, 0.090, 0.090, 0.122, 0.141, 0.166, 0.204, 0.275, 0.344, 0.484, 0.973, &
+          ! coarse seasalt
+          0.547, 0.657, 0.705, 0.754, 0.817, 0.896, 1.008, 1.169, 1.456, 1.724, 2.199, 3.358, &
+          0.566, 0.679, 0.727, 0.776, 0.840, 0.920, 1.032, 1.196, 1.492, 1.760, 2.238, 3.416, &
+          0.596, 0.714, 0.764, 0.816, 0.882, 0.965, 1.081, 1.250, 1.552, 1.828, 2.310, 3.509, &
+          0.644, 0.771, 0.825, 0.880, 0.951, 1.040, 1.164, 1.345, 1.666, 1.957, 2.462, 3.700, &
+          0.640, 0.772, 0.829, 0.887, 0.965, 1.061, 1.198, 1.398, 1.758, 2.085, 2.658, 4.031, &
+          0.452, 0.562, 0.609, 0.659, 0.728, 0.813, 0.938, 1.125, 1.471, 1.797, 2.384, 3.855  /
+
+  DATA alpha_aeri_6bands/  &
+          ! coarse dust insoluble
+          0.594, 0.610, 0.619, 0.762, 0.791, 0.495, &
+          ! supercoarse dust insoluble
+          0.151, 0.152, 0.155, 0.159, 0.168, 0.167  /
+
+  DATA cg_aers_6bands/ &
+          ! accumulation (sulfate+2% bc) mode soluble
+          0.692, 0.692, 0.692, 0.692, 0.735, 0.739, 0.744, 0.749, 0.755, 0.759, 0.765, 0.772, &
+          0.690, 0.690, 0.690, 0.690, 0.736, 0.740, 0.746, 0.752, 0.760, 0.765, 0.771, 0.779, &
+          0.678, 0.678, 0.678, 0.678, 0.727, 0.733, 0.740, 0.748, 0.759, 0.766, 0.775, 0.787, &
+          0.641, 0.641, 0.641, 0.641, 0.692, 0.700, 0.710, 0.721, 0.736, 0.746, 0.760, 0.781, &
+          0.553, 0.553, 0.553, 0.553, 0.603, 0.615, 0.627, 0.643, 0.664, 0.678, 0.699, 0.735, &
+          0.343, 0.343, 0.343, 0.343, 0.386, 0.399, 0.414, 0.433, 0.460, 0.480, 0.510, 0.569, &
+          ! seasalt coarse Soluble
+          0.754, 0.770, 0.776, 0.781, 0.784, 0.791, 0.797, 0.805, 0.815, 0.822, 0.828, 0.840, &
+          0.736, 0.753, 0.759, 0.765, 0.771, 0.778, 0.785, 0.793, 0.804, 0.811, 0.820, 0.831, &
+          0.716, 0.735, 0.742, 0.748, 0.754, 0.762, 0.769, 0.778, 0.789, 0.796, 0.807, 0.819, &
+          0.704, 0.725, 0.733, 0.739, 0.745, 0.752, 0.759, 0.768, 0.778, 0.784, 0.792, 0.803, &
+          0.716, 0.737, 0.744, 0.751, 0.756, 0.763, 0.770, 0.777, 0.786, 0.790, 0.795, 0.800, &
+          0.688, 0.730, 0.741, 0.751, 0.761, 0.771, 0.782, 0.795, 0.810, 0.820, 0.833, 0.849  /
+
+  DATA cg_aeri_6bands/ &
+          ! coarse dust insoluble
+          0.801, 0.779, 0.709, 0.698, 0.710, 0.687, &
+          ! super coarse dust insoluble
+          0.862, 0.871, 0.852, 0.799, 0.758, 0.651  /
+
+  DATA piz_aers_6bands/&
+          ! accumulation (sulfate+2% bc) mode soluble
+          0.941, 0.941, 0.941, 0.941, 0.958, 0.961, 0.965, 0.969, 0.974, 0.977, 0.981, 0.987, &
+          0.941, 0.941, 0.941, 0.941, 0.959, 0.963, 0.967, 0.971, 0.976, 0.979, 0.983, 0.988, &
+          0.953, 0.953, 0.953, 0.953, 0.967, 0.971, 0.974, 0.978, 0.982, 0.984, 0.988, 0.992, &
+          0.955, 0.955, 0.955, 0.955, 0.969, 0.972, 0.976, 0.980, 0.984, 0.986, 0.989, 0.994, &
+          0.936, 0.936, 0.936, 0.936, 0.955, 0.961, 0.966, 0.972, 0.978, 0.982, 0.987, 0.993, &
+          0.792, 0.792, 0.792, 0.792, 0.848, 0.867, 0.887, 0.907, 0.931, 0.944, 0.960, 0.980, &
+          ! seasalt coarse soluble
+          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.001, 1.000, &
+          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
+          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
+          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
+          0.994, 0.994, 0.995, 0.995, 0.995, 0.995, 0.996, 0.996, 0.996, 0.996, 0.996, 0.996, &
+          0.976, 0.867, 0.837, 0.814, 0.796, 0.774, 0.754, 0.735, 0.713, 0.702, 0.690, 0.675  /
+
+  DATA piz_aeri_6bands/ &
+          ! coarse dust insoluble
+          0.866, 0.875, 0.915, 0.977, 0.993, 0.971, &
+          ! super coarse dust insoluble
+          0.789, 0.749, 0.791, 0.918, 0.970, 0.909  /
+
+  spsol = 0
+  spinsol = 0
+
+  modname = 'splaeropt_6bands_rrt'
+
+  IF (NSW/=nbands_sw_rrtm) THEN
+    CALL abort_physic(modname, 'Erreur NSW doit etre egal a 6 pour cette routine', 1)
+  ENDIF
+
+  DO irh = 1, nbre_RH - 1
+    fact_RH(irh) = 1. / (RH_tab(irh + 1) - RH_tab(irh))
+  ENDDO
+
+  DO k = 1, klev
+    DO i = 1, klon
+      rh(i, k) = MIN(RHcl(i, k) * 100., RH_MAX)
+      RH_num(i, k) = INT(rh(i, k) / 10. + 1.)
+      IF (rh(i, k)>85.) RH_num(i, k) = 10
+      IF (rh(i, k)>90.) RH_num(i, k) = 11
+      delta(i, k) = (rh(i, k) - RH_tab(RH_num(i, k))) * fact_RH(RH_num(i, k))
+    ENDDO
+  ENDDO
+
+  tau_ae(:, :, :, :) = 0.
+  piz_ae(:, :, :, :) = 0.
+  cg_ae(:, :, :, :) = 0.
+
+  itr = 0
+  DO iq = 1, nqtot
+    IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+    itr = itr + 1
+    SELECT CASE(tracers(iq)%name)
+    CASE('PREC'); CYCLE                                  !--precursor
+    CASE('FINE'); soluble = .TRUE.;  spsol = 1; aerindex = 1   !--fine mode accumulation mode
+    CASE('COSS'); soluble = .TRUE.;  spsol = 2; aerindex = 2   !--coarse mode sea salt
+    CASE('CODU'); soluble = .FALSE.; spinsol = 1; aerindex = 3   !--coarse mode dust
+    CASE('SCDU'); soluble = .FALSE.; spinsol = 2; aerindex = 4   !--super coarse mode dust
+    CASE DEFAULT; CALL abort_physic(modname, 'I cannot do aerosol optics for ' // tracers(iq)%name, 1)
+    END SELECT
+
+    IF (soluble) THEN ! For aerosol soluble components
+
+      DO k = 1, klev
+        DO i = 1, klon
+
+          tmp_var = tr_seri(i, k, itr) * zdm(i, k) !-- g/m2
+
+          DO inu = 1, NSW
+
+            tau_ae2b_int = alpha_aers_6bands(RH_num(i, k), inu, spsol) + &
+                    delta(i, k) * (alpha_aers_6bands(RH_num(i, k) + 1, inu, spsol) - &
+                            alpha_aers_6bands(RH_num(i, k), inu, spsol))
+
+            piz_ae2b_int = piz_aers_6bands(RH_num(i, k), inu, spsol) + &
+                    delta(i, k) * (piz_aers_6bands(RH_num(i, k) + 1, inu, spsol) - &
+                            piz_aers_6bands(RH_num(i, k), inu, spsol))
+
+            cg_ae2b_int = cg_aers_6bands(RH_num(i, k), inu, spsol) + &
+                    delta(i, k) * (cg_aers_6bands(RH_num(i, k) + 1, inu, spsol) - &
+                            cg_aers_6bands(RH_num(i, k), inu, spsol))
+
+            tau_ae(i, k, aerindex, inu) = tmp_var * tau_ae2b_int
+            piz_ae(i, k, aerindex, inu) = piz_ae2b_int
+            cg_ae(i, k, aerindex, inu) = cg_ae2b_int
+
+          ENDDO
+        ENDDO
+      ENDDO
+
+    ELSE    ! For all aerosol insoluble components
+
+      DO k = 1, klev
+        DO i = 1, klon
+
+          tmp_var = tr_seri(i, k, itr) * zdm(i, k) !-- g/m2
+
+          DO inu = 1, NSW
+            tau_ae2b_int = alpha_aeri_6bands(inu, spinsol)
+            piz_ae2b_int = piz_aeri_6bands(inu, spinsol)
+            cg_ae2b_int = cg_aeri_6bands(inu, spinsol)
+
+            tau_ae(i, k, aerindex, inu) = tmp_var * tau_ae2b_int
+            piz_ae(i, k, aerindex, inu) = piz_ae2b_int
+            cg_ae(i, k, aerindex, inu) = cg_ae2b_int
+          ENDDO
+        ENDDO
+      ENDDO
+
+    ENDIF ! soluble / insoluble
+
+  ENDDO  ! nbtr
+
+  !--all (natural + anthropogenic) aerosol
+  tau_allaer(:, :, 2, :) = SUM(tau_ae(:, :, 1:naero, :), dim = 3)
+  tau_allaer(:, :, 2, :) = MAX(tau_allaer(:, :, 2, :), tau_min)
+
+  piz_allaer(:, :, 2, :) = SUM(tau_ae(:, :, 1:naero, :) * piz_ae(:, :, 1:naero, :), dim = 3) / tau_allaer(:, :, 2, :)
+  piz_allaer(:, :, 2, :) = MIN(MAX(piz_allaer(:, :, 2, :), 0.01), 1.0)
+  WHERE (tau_allaer(:, :, 2, :)<=tau_min) piz_allaer(:, :, 2, :) = 1.0
+
+  cg_allaer(:, :, 2, :) = SUM(tau_ae(:, :, 1:naero, :) * piz_ae(:, :, 1:naero, :) * cg_ae(:, :, 1:naero, :), dim = 3) / &
+          (tau_allaer(:, :, 2, :) * piz_allaer(:, :, 2, :))
+  cg_allaer(:, :, 2, :) = MIN(MAX(cg_allaer(:, :, 2, :), 0.0), 1.0)
+
+  !--no aerosol
+  tau_allaer(:, :, 1, :) = tau_min
+  piz_allaer(:, :, 1, :) = 1.0
+  cg_allaer(:, :, 1, :) = 0.0
+
+  !--waveband 2 and all aerosol (third index = 2)
+  inu = 2
+  abs550aer(:) = SUM((1 - piz_allaer(:, :, 2, inu)) * tau_allaer(:, :, 2, inu), dim = 2)
+
+END SUBROUTINE SPLAEROPT_6BANDS_RRTM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_lw_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_lw_rrtm.F90	(revision 5098)
+++ 	(revision )
@@ -1,87 +1,0 @@
-!
-! splaeropt_lw_rrtm.F90 2014-05-13 C. Kleinschmitt
-!                      2016-05-03 O. Boucher 
-!
-! This routine feeds aerosol LW properties to RRTM
-! we only consider absorption (not scattering)
-
-SUBROUTINE SPLAEROPT_LW_RRTM(ok_alw,zdm,tr_seri)
-
-  USE dimphy
-  USE aero_mod
-  USE infotrac_phy, ONLY: nqtot, nbtr, tracers
-  USE phys_state_var_mod, ONLY : tau_aero_lw_rrtm
-  USE YOERAD, ONLY : NLW
-
-  IMPLICIT NONE
-
-  INCLUDE "clesphys.h"
-  !
-  ! Input arguments:
-  !
-  LOGICAL, INTENT(IN) :: ok_alw
-  REAL, DIMENSION(klon,klev), INTENT(IN)      :: zdm
-  REAL, DIMENSION(klon,klev,nbtr), INTENT(IN) :: tr_seri
-  !
-  ! Local arguments : 
-  !
-  INTEGER, PARAMETER :: naero_soluble=2    ! 1- accumulation soluble; 2- coarse soluble
-  INTEGER, PARAMETER :: naero_insoluble=2  ! 1- coarse dust; 2- supercoarse dust
-  INTEGER, PARAMETER :: naero=naero_soluble+naero_insoluble
-  !
-  INTEGER inu, itr, iq, spinsol
-  CHARACTER*20 modname
-  !
-  !--absorption coefficient for coarse and super-coarse DUST
-  REAL:: alpha_abs_CIDUST_16bands(nbands_lw_rrtm,naero_insoluble)   !--unit m2/g 
-  DATA alpha_abs_CIDUST_16bands /                         &
-   ! Dust CO insoluble
-  0.001, 0.003, 0.005, 0.006, 0.011, 0.031, 0.157, 0.102, &
-  0.017, 0.056, 0.032, 0.008, 0.010, 0.011, 0.013, 0.016, & 
-   ! Dust SC insoluble
-  0.002, 0.004, 0.007, 0.010, 0.018, 0.043, 0.099, 0.071, &
-  0.021, 0.056, 0.033, 0.011, 0.013, 0.014, 0.016, 0.018 /
-
-  modname='splaeropt_lw_rrtm'
-  ! 
-  IF (NLW/=nbands_lw_rrtm) THEN
-    CALL abort_physic(modname,'Erreur NLW doit etre egal a 16 pour cette routine',1)
-  ENDIF
-  !
-  IF (ok_alw) THEN 
-    !
-    !--initialisation
-    tau_aero_lw_rrtm = 0.0
-    !
-    
-    itr = 0
-    DO iq = 1, nqtot
-      IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-      itr = itr+1
-      SELECT CASE(tracers(iq)%name)
-        CASE('PREC','FINE','COSS'); CYCLE                  !--precursor or fine/coarde accumulation mode
-        CASE('CODU'); spinsol=1                            !--coarse mode dust
-        CASE('SCDU'); spinsol=2                            !--super coarse mode dust
-        CASE DEFAULT; CALL abort_physic(modname,'I cannot do aerosol optics for '//tracers(iq)%name,1)
-      END SELECT
-      !
-      DO inu=1,NLW
-        !
-        !--total aerosol
-        tau_aero_lw_rrtm(:,:,2,inu) = tau_aero_lw_rrtm(:,:,2,inu) + tr_seri(:,:,itr)*zdm(:,:)*alpha_abs_CIDUST_16bands(inu,spinsol)
-        !--no aerosol at all
-        tau_aero_lw_rrtm(:,:,1,inu) = tau_aero_lw_rrtm(:,:,1,inu) + 0.0
-        !
-      ENDDO
-    !
-    ENDDO
-    !
-    !--avoid very small values
-    tau_aero_lw_rrtm = MAX(tau_aero_lw_rrtm,1.e-15)
-    ! 
-  ELSE
-    !--default value
-    tau_aero_lw_rrtm = 1.e-15
-  ENDIF
-  !
-END SUBROUTINE SPLAEROPT_LW_RRTM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_lw_rrtm.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_lw_rrtm.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaeropt_lw_rrtm.f90	(revision 5099)
@@ -0,0 +1,86 @@
+
+! splaeropt_lw_rrtm.F90 2014-05-13 C. Kleinschmitt
+!                      2016-05-03 O. Boucher 
+
+! This routine feeds aerosol LW properties to RRTM
+! we only consider absorption (not scattering)
+
+SUBROUTINE SPLAEROPT_LW_RRTM(ok_alw, zdm, tr_seri)
+
+  USE dimphy
+  USE aero_mod
+  USE infotrac_phy, ONLY : nqtot, nbtr, tracers
+  USE phys_state_var_mod, ONLY : tau_aero_lw_rrtm
+  USE lmdz_yoerad, ONLY : NLW
+
+  IMPLICIT NONE
+
+  INCLUDE "clesphys.h"
+
+  ! Input arguments:
+
+  LOGICAL, INTENT(IN) :: ok_alw
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: zdm
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: tr_seri
+
+  ! Local arguments : 
+
+  INTEGER, PARAMETER :: naero_soluble = 2    ! 1- accumulation soluble; 2- coarse soluble
+  INTEGER, PARAMETER :: naero_insoluble = 2  ! 1- coarse dust; 2- supercoarse dust
+  INTEGER, PARAMETER :: naero = naero_soluble + naero_insoluble
+
+  INTEGER inu, itr, iq, spinsol
+  CHARACTER*20 modname
+
+  !--absorption coefficient for coarse and super-coarse DUST
+  REAL :: alpha_abs_CIDUST_16bands(nbands_lw_rrtm, naero_insoluble)   !--unit m2/g
+  DATA alpha_abs_CIDUST_16bands /                         &
+          ! Dust CO insoluble
+          0.001, 0.003, 0.005, 0.006, 0.011, 0.031, 0.157, 0.102, &
+          0.017, 0.056, 0.032, 0.008, 0.010, 0.011, 0.013, 0.016, &
+          ! Dust SC insoluble
+          0.002, 0.004, 0.007, 0.010, 0.018, 0.043, 0.099, 0.071, &
+          0.021, 0.056, 0.033, 0.011, 0.013, 0.014, 0.016, 0.018 /
+
+  modname = 'splaeropt_lw_rrtm'
+
+  IF (NLW/=nbands_lw_rrtm) THEN
+    CALL abort_physic(modname, 'Erreur NLW doit etre egal a 16 pour cette routine', 1)
+  ENDIF
+
+  IF (ok_alw) THEN
+
+    !--initialisation
+    tau_aero_lw_rrtm = 0.0
+
+    itr = 0
+    DO iq = 1, nqtot
+      IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+      itr = itr + 1
+      SELECT CASE(tracers(iq)%name)
+      CASE('PREC', 'FINE', 'COSS'); CYCLE                  !--precursor or fine/coarde accumulation mode
+      CASE('CODU'); spinsol = 1                            !--coarse mode dust
+      CASE('SCDU'); spinsol = 2                            !--super coarse mode dust
+      CASE DEFAULT; CALL abort_physic(modname, 'I cannot do aerosol optics for ' // tracers(iq)%name, 1)
+      END SELECT
+
+      DO inu = 1, NLW
+
+        !--total aerosol
+        tau_aero_lw_rrtm(:, :, 2, inu) = tau_aero_lw_rrtm(:, :, 2, inu) + tr_seri(:, :, itr) * zdm(:, :) * alpha_abs_CIDUST_16bands(inu, spinsol)
+        !--no aerosol at all
+        tau_aero_lw_rrtm(:, :, 1, inu) = tau_aero_lw_rrtm(:, :, 1, inu) + 0.0
+
+      ENDDO
+
+    ENDDO
+
+    !--avoid very small values
+    tau_aero_lw_rrtm = MAX(tau_aero_lw_rrtm, 1.e-15)
+
+  ELSE
+    !--default value
+    tau_aero_lw_rrtm = 1.e-15
+  ENDIF
+
+END SUBROUTINE SPLAEROPT_LW_RRTM
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaerosol_optic_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaerosol_optic_rrtm.F90	(revision 5098)
+++ 	(revision )
@@ -1,86 +1,0 @@
-! $Id: splaerosol_optic_rrtm.F90 2644 2016-10-02 16:55:08Z oboucher $
-!
-SUBROUTINE splaerosol_optic_rrtm( ok_alw, pplay, paprs, t_seri, rhcl, &
-     tr_seri, mass_solu_aero, mass_solu_aero_pi, &
-     tau_aero, piz_aero, cg_aero, &
-     tausum_aero, tau3d_aero )
-
-  ! This routine will :
-  ! 1) recevie the aerosols(already read and interpolated) corresponding to flag_aerosol
-  ! 2) calculate the optical properties for the aerosols
-  !
-
-  USE dimphy
-  USE aero_mod
-  USE infotrac_phy, ONLY: nbtr, nqtot, tracers
-  USE YOMCST, ONLY: RD, RG
-
-  IMPLICIT NONE
-
-  INCLUDE "clesphys.h"
-
-
-  ! Input arguments
-  !****************************************************************************************
-  LOGICAL, INTENT(IN) :: ok_alw                      ! Apply aerosol LW effect or not
-  REAL, DIMENSION(klon,klev), INTENT(IN)   :: pplay
-  REAL, DIMENSION(klon,klev+1), INTENT(IN) :: paprs
-  REAL, DIMENSION(klon,klev), INTENT(IN)   :: t_seri
-  REAL, DIMENSION(klon,klev), INTENT(IN)   :: rhcl   ! humidite relative ciel clair
-  REAL, DIMENSION(klon,klev,nbtr), INTENT(IN) :: tr_seri ! concentration tracer
-
-  ! Output arguments
-  !****************************************************************************************
-  REAL, DIMENSION(klon,klev), INTENT(OUT)     :: mass_solu_aero    ! Total mass for all soluble aerosols
-  REAL, DIMENSION(klon,klev), INTENT(OUT)     :: mass_solu_aero_pi !     -"-     preindustrial values
-  REAL, DIMENSION(klon,klev,2,NSW), INTENT(OUT) :: tau_aero    ! Aerosol optical thickness
-  REAL, DIMENSION(klon,klev,2,NSW), INTENT(OUT) :: piz_aero    ! Single scattering albedo aerosol
-  REAL, DIMENSION(klon,klev,2,NSW), INTENT(OUT) :: cg_aero     ! asymmetry parameter aerosol
-  REAL, DIMENSION(klon,nwave,naero_tot), INTENT(OUT)       :: tausum_aero
-  REAL, DIMENSION(klon,klev,nwave,naero_tot), INTENT(OUT)  :: tau3d_aero
-
-  INTEGER i, k, iq, itr
-  REAL, DIMENSION(klon,klev) :: zdm, zdh
-  REAL zrho, pdel
-  !
-  ! Calculate the total mass of all soluble accumulation mode aerosols
-  ! to be revisited for AR6
-  !
-  mass_solu_aero(:,:)    = 0.0
-  mass_solu_aero_pi(:,:) = 0.0
-  !
-  itr = 0
-  DO iq = 1, nqtot
-    IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-    itr = itr+1
-    IF(tracers(iq)%name/='FINE') THEN
-      mass_solu_aero(:,:)    = tr_seri(:,:,itr)
-      mass_solu_aero_pi(:,:) = tr_seri(:,:,itr)
-    ENDIF
-  ENDDO
-
-  ! Calculate layer thickness
-  DO k = 1, klev
-    DO i = 1, klon
-      pdel=paprs(i,k)-paprs(i,k+1)
-      zrho=pplay(i,k)/t_seri(i,k)/RD             ! kg/m3
-      zdh(i,k)=pdel/(RG*zrho)                    ! m
-      zdm(i,k)=pdel/RG                           ! kg/m2
-    ENDDO
-  ENDDO
-
-!--new aerosol properties
-! aeropt_6bands for rrtm
-  CALL splaeropt_6bands_rrtm(       &
-       zdm, tr_seri, rhcl,          & 
-       tau_aero, piz_aero, cg_aero )
-
-! aeropt_5wv only for validation and diagnostics
-  CALL splaeropt_5wv_rrtm(          &
-       zdm, zdh, tr_seri, rhcl,     & 
-       tausum_aero, tau3d_aero )
-
-! LW optical properties for tropospheric aerosols
-  CALL splaeropt_lw_rrtm(ok_alw,zdm,tr_seri)
-
-END SUBROUTINE splaerosol_optic_rrtm
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaerosol_optic_rrtm.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaerosol_optic_rrtm.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/splaerosol_optic_rrtm.f90	(revision 5099)
@@ -0,0 +1,85 @@
+! $Id: splaerosol_optic_rrtm.F90 2644 2016-10-02 16:55:08Z oboucher $
+
+SUBROUTINE splaerosol_optic_rrtm(ok_alw, pplay, paprs, t_seri, rhcl, &
+        tr_seri, mass_solu_aero, mass_solu_aero_pi, &
+        tau_aero, piz_aero, cg_aero, &
+        tausum_aero, tau3d_aero)
+
+  ! This routine will :
+  ! 1) recevie the aerosols(already read and interpolated) corresponding to flag_aerosol
+  ! 2) calculate the optical properties for the aerosols
+
+  USE dimphy
+  USE aero_mod
+  USE infotrac_phy, ONLY : nbtr, nqtot, tracers
+  USE lmdz_yomcst, ONLY : RD, RG
+
+  IMPLICIT NONE
+
+  INCLUDE "clesphys.h"
+
+
+  ! Input arguments
+  !****************************************************************************************
+  LOGICAL, INTENT(IN) :: ok_alw                      ! Apply aerosol LW effect or not
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay
+  REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: paprs
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri
+  REAL, DIMENSION(klon, klev), INTENT(IN) :: rhcl   ! humidite relative ciel clair
+  REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: tr_seri ! concentration tracer
+
+  ! Output arguments
+  !****************************************************************************************
+  REAL, DIMENSION(klon, klev), INTENT(OUT) :: mass_solu_aero    ! Total mass for all soluble aerosols
+  REAL, DIMENSION(klon, klev), INTENT(OUT) :: mass_solu_aero_pi !     -"-     preindustrial values
+  REAL, DIMENSION(klon, klev, 2, NSW), INTENT(OUT) :: tau_aero    ! Aerosol optical thickness
+  REAL, DIMENSION(klon, klev, 2, NSW), INTENT(OUT) :: piz_aero    ! Single scattering albedo aerosol
+  REAL, DIMENSION(klon, klev, 2, NSW), INTENT(OUT) :: cg_aero     ! asymmetry parameter aerosol
+  REAL, DIMENSION(klon, nwave, naero_tot), INTENT(OUT) :: tausum_aero
+  REAL, DIMENSION(klon, klev, nwave, naero_tot), INTENT(OUT) :: tau3d_aero
+
+  INTEGER i, k, iq, itr
+  REAL, DIMENSION(klon, klev) :: zdm, zdh
+  REAL zrho, pdel
+
+  ! Calculate the total mass of all soluble accumulation mode aerosols
+  ! to be revisited for AR6
+
+  mass_solu_aero(:, :) = 0.0
+  mass_solu_aero_pi(:, :) = 0.0
+
+  itr = 0
+  DO iq = 1, nqtot
+    IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+    itr = itr + 1
+    IF(tracers(iq)%name/='FINE') THEN
+      mass_solu_aero(:, :) = tr_seri(:, :, itr)
+      mass_solu_aero_pi(:, :) = tr_seri(:, :, itr)
+    ENDIF
+  ENDDO
+
+  ! Calculate layer thickness
+  DO k = 1, klev
+    DO i = 1, klon
+      pdel = paprs(i, k) - paprs(i, k + 1)
+      zrho = pplay(i, k) / t_seri(i, k) / RD             ! kg/m3
+      zdh(i, k) = pdel / (RG * zrho)                    ! m
+      zdm(i, k) = pdel / RG                           ! kg/m2
+    ENDDO
+  ENDDO
+
+  !--new aerosol properties
+  ! aeropt_6bands for rrtm
+  CALL splaeropt_6bands_rrtm(&
+          zdm, tr_seri, rhcl, &
+          tau_aero, piz_aero, cg_aero)
+
+  ! aeropt_5wv only for validation and diagnostics
+  CALL splaeropt_5wv_rrtm(&
+          zdm, zdh, tr_seri, rhcl, &
+          tausum_aero, tau3d_aero)
+
+  ! LW optical properties for tropospheric aerosols
+  CALL splaeropt_lw_rrtm(ok_alw, zdm, tr_seri)
+
+END SUBROUTINE splaerosol_optic_rrtm
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/tiedqneg.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/tiedqneg.F	(revision 5098)
+++ 	(revision )
@@ -1,66 +1,0 @@
-      SUBROUTINE tiedqneg (pres_h,q,d_q)
-c
-      USE dimphy
-      IMPLICIT none
-c======================================================================
-c Auteur(s): CG (LGGE/CNRS) date: 19950201
-c            O. Boucher (LOA/CNRS) date 19961125
-c Objet:  Correction eventuelle des valeurs negatives d'humidite
-c induites par le schema de convection de Tiedke 
-c======================================================================
-c Arguments:
-c pres_h--input-R-la valeur de la pression aux interfaces
-c q-------input-R-quantite de traceur
-c d_q-----input-output-R-increment du traceur
-c======================================================================
-c
-      INCLUDE "dimensions.h"
-c       INCLUDE "dimphy.h"
-      REAL pres_h(klon,klev+1)
-      REAL q(klon,klev)
-      REAL d_q(klon,klev)
-      INTEGER nb_neg
-      INTEGER i, l
-c
-      REAL qmin
-      PARAMETER (qmin=0.0)
-c
-      DO l = klev,2,-1
-        nb_neg = 0
-        DO i = 1,klon
-          IF (q(i,l)+d_q(i,l)<qmin) THEN
-          nb_neg = nb_neg + 1
-          d_q(i,l-1) = d_q(i,l-1) + (q(i,l)+d_q(i,l)-qmin)
-     .       *(pres_h(i,l)-pres_h(i,l+1))/(pres_h(i,l-1)-pres_h(i,l))
-            d_q(i,l) = qmin - q(i,l)
-          ENDIF
-        ENDDO
-c        IF (nb_neg.NE.0) THEN 
-c        PRINT *,'niveau ', l,' ' , nb_neg, ' valeurs negatives'
-c        ENDIF
-      ENDDO
-c
-      DO l = 1, klev-1
-        nb_neg = 0
-        DO i = 1,klon
-          IF (q(i,l)+d_q(i,l)<qmin) THEN
-          nb_neg = nb_neg + 1
-          d_q(i,l+1) = d_q(i,l+1) + (q(i,l)+d_q(i,l)-qmin)
-     .      *(pres_h(i,l)-pres_h(i,l+1))/(pres_h(i,l+1)-pres_h(i,l+2))
-          d_q(i,l) = qmin - q(i,l)
-          ENDIF
-        ENDDO
-c        IF (nb_neg.NE.0) THEN 
-c        PRINT *,'niveau ', l,' ' , nb_neg, ' valeurs negatives'
-c        ENDIF
-      ENDDO
-c
-      l = klev
-      DO i = 1,klon
-        IF (q(i,l)+d_q(i,l)<qmin) THEN
-          d_q(i,l) = qmin - q(i,l)
-        ENDIF
-      ENDDO
-c
-      RETURN
-      END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/tiedqneg.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/tiedqneg.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/tiedqneg.f90	(revision 5099)
@@ -0,0 +1,66 @@
+SUBROUTINE tiedqneg (pres_h, q, d_q)
+
+  USE dimphy
+  IMPLICIT none
+  !======================================================================
+  ! Auteur(s): CG (LGGE/CNRS) date: 19950201
+  ! O. Boucher (LOA/CNRS) date 19961125
+  ! Objet:  Correction eventuelle des valeurs negatives d'humidite
+  ! induites par le schema de convection de Tiedke
+  !======================================================================
+  ! Arguments:
+  ! pres_h--input-R-la valeur de la pression aux interfaces
+  ! q-------input-R-quantite de traceur
+  ! d_q-----input-output-R-increment du traceur
+  !======================================================================
+
+  INCLUDE "dimensions.h"
+  ! INCLUDE "dimphy.h"
+  REAL :: pres_h(klon, klev + 1)
+  REAL :: q(klon, klev)
+  REAL :: d_q(klon, klev)
+  INTEGER :: nb_neg
+  INTEGER :: i, l
+
+  REAL :: qmin
+  PARAMETER (qmin = 0.0)
+
+  DO l = klev, 2, -1
+    nb_neg = 0
+    DO i = 1, klon
+      IF (q(i, l) + d_q(i, l)<qmin) THEN
+        nb_neg = nb_neg + 1
+        d_q(i, l - 1) = d_q(i, l - 1) + (q(i, l) + d_q(i, l) - qmin) &
+                * (pres_h(i, l) - pres_h(i, l + 1)) / (pres_h(i, l - 1) - pres_h(i, l))
+        d_q(i, l) = qmin - q(i, l)
+      ENDIF
+    ENDDO
+    ! IF (nb_neg.NE.0) THEN
+    ! PRINT *,'niveau ', l,' ' , nb_neg, ' valeurs negatives'
+    ! ENDIF
+  ENDDO
+
+  DO l = 1, klev - 1
+    nb_neg = 0
+    DO i = 1, klon
+      IF (q(i, l) + d_q(i, l)<qmin) THEN
+        nb_neg = nb_neg + 1
+        d_q(i, l + 1) = d_q(i, l + 1) + (q(i, l) + d_q(i, l) - qmin) &
+                * (pres_h(i, l) - pres_h(i, l + 1)) / (pres_h(i, l + 1) - pres_h(i, l + 2))
+        d_q(i, l) = qmin - q(i, l)
+      ENDIF
+    ENDDO
+    ! IF (nb_neg.NE.0) THEN
+    ! PRINT *,'niveau ', l,' ' , nb_neg, ' valeurs negatives'
+    ! ENDIF
+  ENDDO
+
+  l = klev
+  DO i = 1, klon
+    IF (q(i, l) + d_q(i, l)<qmin) THEN
+      d_q(i, l) = qmin - q(i, l)
+    ENDIF
+  ENDDO
+
+  RETURN
+END SUBROUTINE tiedqneg
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/FCTTRE.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/FCTTRE.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/FCTTRE.h	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Header$
-!
-!
+
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez  n'utiliser que des ! pour les commentaires
 !                 et  bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
+
 !     ------------------------------------------------------------------
 !     This COMDECK includes the Thermodynamical functions for the cy39
@@ -20,12 +20,12 @@
       LOGICAL thermcep
       PARAMETER (thermcep=.TRUE.)
-!
+
       FOEEW ( PTARG,PDELARG ) = EXP (                                   &
      &          (R3LES*(1.-PDELARG)+R3IES*PDELARG) * (PTARG-RTT)        &
      & / (PTARG-(R4LES*(1.-PDELARG)+R4IES*PDELARG)) )
-!
+
       FOEDE ( PTARG,PDELARG,P5ARG,PQSARG,PCOARG ) = PQSARG*PCOARG*P5ARG &
      & / (PTARG-(R4LES*(1.-PDELARG)+R4IES*PDELARG))**2
-!
+
       qsats(ptarg) = 100.0 * 0.622 * 10.0                               &
      &           ** (2.07023 - 0.00320991 * ptarg                       &
@@ -36,5 +36,5 @@
      &           - 29810.16 * EXP( - 0.0699382 * ptarg)                 &
      &           + 25.21935 * EXP( - 2999.924 / ptarg))
-!
+
       dqsats(ptarg,pqsarg) = RLVTT/RCPD*pqsarg * (3.56654/ptarg         &
      &                     +2484.896*LOG(10.)/ptarg**2                  &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aer_sedimnt.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE AER_SEDIMNT(pdtphys, t_seri, pplay, paprs, tr_seri, dens_aer)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aerophys.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aerophys.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/aerophys.F90	(revision 5099)
@@ -1,8 +1,8 @@
 ! $Id$
-!
+
 MODULE aerophys
-!
+
   IMPLICIT NONE
-!
+
   REAL,PARAMETER    :: ropx=1500.0              ! default aerosol particle mass density [kg/m3]
   REAL,PARAMETER    :: dens_aer_dry=1848.682308 ! dry aerosol particle mass density at T_0=293K[kg/m3]
@@ -25,8 +25,8 @@
   REAL, PARAMETER   :: mNatome=14.0067*1.66E-27 ! Mass of an N atome [kg]
   REAL, PARAMETER   :: rgas=8.3145 ! molar gas cste (J⋅K−1⋅mol−1=m3⋅Pa⋅K−1⋅mol−1=kg⋅m2⋅s−2⋅K−1⋅mol−1)
-  ! 
+
   REAL, PARAMETER   :: MH2O  =1000.*mH2Omol     ! Mass of 1 molec [g] (18.016*1.66E-24)
   REAL, PARAMETER   :: MH2SO4=1000.*mH2SO4mol   ! Mass of 1 molec [g] (98.082*1.66E-24)
   REAL, PARAMETER   :: BOLZ  =1.381E-16         ! Boltzmann constant [dyn.cm/K]
-!
+
 END MODULE aerophys
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/calcaerosolstrato_rrtm.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE calcaerosolstrato_rrtm(pplay,t_seri,paprs,debut)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/coagulate.F90	(revision 5099)
@@ -1,14 +1,14 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE COAGULATE(pdtcoag,mdw,tr_seri,t_seri,pplay,dens_aer,is_strato)
   !     -----------------------------------------------------------------------
-  !
+
   !     Author : Christoph Kleinschmitt (with Olivier Boucher)
   !     ------
-  !
+
   !     purpose
   !     -------
-  !
+
   !     interface
   !     ---------
@@ -17,8 +17,8 @@
   !       tr_seri        tracer mixing ratios               [kg/kg]
   !       mdw             # or mass median diameter          [m]
-  !
+
   !     method
   !     ------
-  !
+
   !     -----------------------------------------------------------------------
 
@@ -204,10 +204,10 @@
   DO j=1, nbtr_bin
   DO i=1, nbtr_bin
-!
+
      num=4.*RPI*(radiuswet(i)+radiuswet(j))*(Di(i)+Di(j))
      denom=(radiuswet(i)+radiuswet(j))/(radiuswet(i)+radiuswet(j)+sqrt(delta(i)**2.+delta(j)**2.))+ &
    4.*(Di(i)+Di(j))/(sqrt(thvelpar(i)**2.+thvelpar(j)**2.)*(radiuswet(i)+radiuswet(j)))
      beta(i,j)=num/denom
-!
+
 !--compute enhancement factor due to van der Waals forces
    IF (ok_vdw == 0) THEN      !--no enhancement factor
@@ -222,5 +222,5 @@
       EvdW = 1. + SQRT(AvdWi/3.)/(1.+bvdW0*SQRT(AvdWi)) + bvdW1*xvdW + bvdW3*xvdW**3.
    ENDIF
-!
+
    beta(i,j)=beta(i,j)*EvdW
 
@@ -247,14 +247,14 @@
        numi=0.0
        DO i=1, k-1
-!           
+
 !           see Jacobson: " In order to conserve volume and volume concentration (which
 !           coagulation physically does) while giving up some accuracy in number concentration" 
-!
+
 !           Coagulation of i and j giving k
 !           with V(i) and then V(j) because it considers i,j and j,i with the double loop
-!
+
 !           BUT WHY WET VOLUME V(i) in old STRATAER? tracers are already dry aerosols and coagulation 
 !           kernel beta(i,j) accounts for wet aerosols -> reply below
-!
+
 !             numi=numi+ff(i,j,k)*beta(i,j)*V(i)*tr_tp1(ilon,ilev,i)*tr_t(ilon,ilev,j)
             numi=numi+ff(i,j,k)*beta(i,j)*Vdry(i)*tr_tp1(ilon,ilev,i)*tr_t(ilon,ilev,j)
@@ -266,5 +266,5 @@
 !      tr_tp1(ilon,ilev,k)=(V(k)*tr_t(ilon,ilev,k)+pdtcoag*num)/( (1.+pdtcoag*denom)*V(k) )
     tr_tp1(ilon,ilev,k)=(Vdry(k)*tr_t(ilon,ilev,k)+pdtcoag*num)/( (1.+pdtcoag*denom)*Vdry(k) )
-!
+
 !       In constant composition (no dependency on aerosol size because no kelvin effect)
 !       V(l)= (f_r_wet(ilon,ilev)**3)*((mdw(l)/2.)**3) = (f_r_wet(ilon,ilev)**3)*Vdry(i)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/cond_evap_tstep_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/cond_evap_tstep_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/cond_evap_tstep_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE cond_evap_tstep_mod
 
@@ -11,5 +11,5 @@
       SUBROUTINE condens_evapor_rate_kelvin(R2SO4G,t_seri,pplay,R2SO4, &
    DENSO4,f_r_wet,R2SO4ik,DENSO4ik,f_r_wetik,FL,ASO4,DNDR)
-!
+
 !     INPUT: 
 !     R2SO4G: number density of gaseous H2SO4 [molecules/cm3]
@@ -127,5 +127,5 @@
 !       Kelvin factor (MKS)
         fkelvin=exp( 2.*1.e-3*surtens*1.e-6*mvh2so4/ (1.e-2*RRSI_wet(IK)*rgas*temp) )
-!                              
+
         DNDR(IK) =DND*fkelvin
 
@@ -167,5 +167,5 @@
       SUBROUTINE condens_evapor_rate(R2SO4G,t_seri,pplay,ACTSO4,R2SO4, &
    DENSO4,f_r_wet,FL,ASO4,DNDR)
-!
+
 !     INPUT: 
 !     R2SO4: aerosol H2SO4 weight fraction (percent)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/interp_sulf_input.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE interp_sulf_input(debutphy,pdtphys,paprs,tr_seri)
 
@@ -84,9 +84,9 @@
 
   REAL H2SO4_lifetime_glo(klon_glo,klev)
-!
+
   REAL, ALLOCATABLE, SAVE :: OCS_clim(:,:)
   REAL, ALLOCATABLE, SAVE :: SO2_clim(:,:)
 !$OMP THREADPRIVATE(OCS_clim,SO2_clim)
-!
+
   INTEGER i, k, kk, j
   REAL p_bound
@@ -108,5 +108,5 @@
   2.47875223e+02,   1.50343923e+02,   9.11881985e+01, &
   5.53084382e+01,   3.35462635e+01,   0.0           /)
-!
+
  IF (.NOT.ALLOCATED(OCS_clim)) ALLOCATE(OCS_clim(klon,klev))
  IF (.NOT.ALLOCATED(SO2_clim)) ALLOCATE(SO2_clim(klon,klev))
@@ -311,5 +311,5 @@
   
   IF (is_mpi_root.AND.is_omp_root) THEN
-!
+
     DEALLOCATE(OCS_clim_in,SO2_clim_in,O3_clim_in)
     DEALLOCATE(OCS_clim_mth,SO2_clim_mth,O3_clim_mth)
@@ -318,5 +318,5 @@
     DEALLOCATE(OCS_lifetime_mth, SO2_lifetime_mth, H2SO4_lifetime_mth)
     DEALLOCATE(OCS_lifetime_tmp, SO2_lifetime_tmp, H2SO4_lifetime_tmp)
-!
+
   ENDIF !--is_mpi_root and is_omp_root
 
@@ -334,5 +334,5 @@
   DO i=1, klon
     DO k=1, klev
-      !
+
       !--OCS and SO2 prescribed back to their clim values below p_bound
       IF (paprs(i,k)>p_bound) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/micphy_tstep.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE micphy_tstep(pdtphys,tr_seri,t_seri,pplay,paprs,rh,is_strato)
 
@@ -63,14 +63,14 @@
   
   DO ilon=1, klon
-!
+
 !--initialisation of diagnostic
   budg_h2so4_to_part(ilon)=0.0
-!
+
   DO ilev=1, klev
-!
+
 !--initialisation of diagnostic
   budg_3D_nucl(ilon,ilev)=0.0
   budg_3D_cond_evap(ilon,ilev)=0.0
-!
+
   ! only in the stratosphere
   IF (is_strato(ilon,ilev)) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/miecalc_aer.F90	(revision 5099)
@@ -3,5 +3,5 @@
 !-------Mie computations for a size distribution 
 !       of homogeneous spheres.
-!
+
 !==========================================================
 !--Ref : Toon and Ackerman, Applied Optics, 1981
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/minmaxsimple.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/minmaxsimple.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/minmaxsimple.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE minmaxsimple(zq,qmin,qmax,comment)
   USE dimphy
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/nucleation_tstep_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE nucleation_tstep_mod
 
@@ -136,5 +136,5 @@
 
   !    Fortran 90 subroutine binapara
-  !
+
   !    Calculates parametrized values of nucleation rate,
   !    mole fraction of sulphuric acid
@@ -142,7 +142,7 @@
   !    in H2O-H2SO4 system IF temperature, saturatio ratio of water and 
   !    sulfuric acid concentration  are given. 
-  !
+
   !    Copyright (C) 2002 Hanna Vehkamäki
-  !
+
   !    Division of Atmospheric Sciences
   !    Department of Physical Sciences
@@ -150,5 +150,5 @@
   !    FIN-00014 University of Helsinki
   !    Finland
-  !    
+
   !    hanna.vehkamaki@helsinki.fi
 
@@ -300,5 +300,5 @@
 
   !    Fortran 90 subroutine newbinapara
-  !
+
   !    Calculates parametrized values for neutral and ion-induced sulfuric acid-water particle formation rate
   !    of critical clusters, 
@@ -307,14 +307,14 @@
   !    and, optionally, either condensation sink due to pre-existing particle and ion pair production rate,
   !    or atmospheric concentration of negative ions are given. 
-  !
+
   !    The code calculates also the kinetic limit and the particle formation rate
   !    above this limit (in which case we set ntot=1 and na=1)
-  !
+
   !    Copyright (C)2018 Määttänen et al. 2018
-  !    
+
   !    anni.maattanen@latmos.ipsl.fr
   !    joonas.merikanto@fmi.fi
   !    hanna.vehkamaki@helsinki.fi
-  !
+
   !    References
   !    A. Määttänen, J. Merikanto, H. Henschel, J. Duplissy, R. Makkonen, 
@@ -322,11 +322,10 @@
   !    neutral and ion-induced sulfuric acid-water particle formation in 
   !    nucleation and kinetic regimes, J. Geophys. Res. Atmos., 122, doi:10.1002/2017JD027429.
-  !
+
   !    Brasseur, G., and A.  Chatel (1983),  paper  presented  at  the  9th  Annual  Meeting  of  the  
   !    European Geophysical Society, Leeds, Great Britain, August 1982.
-  !  
+
   !    Dunne, Eimear M., et al.(2016), Global atmospheric particle formation from CERN CLOUD measurements,
   !    Science 354.6316, 1119-1124.   
-  !
 
   USE aerophys
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/ocs_to_so2.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE ocs_to_so2(pdtphys,tr_seri,t_seri,pplay,paprs,is_strato)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/so2_to_h2so4.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE SO2_TO_H2SO4(pdtphys,tr_seri,t_seri,pplay,paprs,is_strato)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratH2O_methox.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id: stratH2O_methox.F90 3677 2020-05-06 15:18:32Z oboucher $
-!
+
 SUBROUTINE stratH2O_methox(debutphy,paprs,dq_ch4mmr)
-!
+
 ! output: CH4VMR in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
 
@@ -60,5 +60,5 @@
   REAL, ALLOCATABLE :: CH4RVMR_tmp(:, :)
   REAL CH4RVMR_glo(klon_glo,klev)
-!
+
   INTEGER i, k, kk, j
   
@@ -77,6 +77,5 @@
   2.47875223e+02,   1.50343923e+02,   9.11881985e+01, &
   5.53084382e+01,   3.35462635e+01,   0.0           /)
-!
-  
+
   IF (debutphy .OR. mth_cur /= mth_pre) THEN
      
@@ -136,5 +135,5 @@
               
               DO kk=1, n_lev
-                 !
+
                  CH4RVMR_glo(i,k)=CH4RVMR_glo(i,k)+ &
                       MAX(0.0,MIN(paprs_glo(i,k),paprs_input(kk)) &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_nuc_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_nuc_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/strataer_nuc_mod.F90	(revision 5099)
@@ -24,5 +24,5 @@
     !Config Def  = F
     !Config Help = Used in physiq.F
-    !
+
     CALL getin_p('flag_nuc_rate_box',flag_nuc_rate_box)
     CALL getin_p('nuclat_min',nuclat_min)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratdistrib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratdistrib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratdistrib.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id: stratemit.F90  2022-07-04 mmarchand $
-!
+
 SUBROUTINE STRATDISTRIB(altLMDz,altemiss,sigma_alt,f_lay_emiss)
-!
+
   USE dimphy, ONLY : klon,klev
   USE strataer_local_var_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/stratemit.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: stratemit.F90  2022-07-04 mmarchand $
-!
+
 SUBROUTINE STRATEMIT(pdtphys,pdt,xlat,xlon,t_seri,pplay,paprs,tr_seri,&
                     m_emiss_vol_daily,latmin,latmax,lonmin,lonmax,altemiss,sigma_alt,id_spec,&
@@ -78,5 +78,5 @@
      xlon(i)>=lonmin-dlon .AND. &
      xlon(i)<lonmax+dlon ) THEN
-                   !
+
           WRITE(*,*) 'coordinates of volcanic injection point=',&
       xlat(i),xlon(i),day_cur,mth_cur,year_cur
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90	(revision 5099)
@@ -8,5 +8,5 @@
 !*******************************************************************
       SUBROUTINE STRACOMP_KELVIN(sh,t_seri,pplay)
-!
+
 !     Aerosol H2SO4 weight fraction as a function of PH2O and temperature
 !     INPUT:
@@ -14,5 +14,5 @@
 !     t_seri: temperature (K)
 !     pplay: middle layer pression (Pa)
-!
+
 !     Modified in modules:
 !     R2SO4: aerosol H2SO4 weight fraction (percent)
@@ -115,5 +115,5 @@
 !            aerosol density (gr/cm3) = f(T,h2so4 mass fraction)
              denso4ik=density(temp,wpp)
-!           
+
 !            recalculate Kelvin factor with surface tension and radwet 
 !                              with new R2SO4B and DENSO4B
@@ -134,5 +134,5 @@
              f_r_wetB(ilon,ilev,IK) = (dens_aer_dry/(DENSO4B(ilon,ilev,IK)*1.e3)/ & 
       (R2SO4B(ilon,ilev,IK)*1.e-2))**third
-!
+
 !             print*,'R,Rwet(m),kelvin,h2so4(%),ro=',RRSI(ik),radwet,fkelvin, &
 !              &  R2SO4B(ilon,ilev,IK),DENSO4B(ilon,ilev,IK)
@@ -160,5 +160,5 @@
 !   klev: number of altitude bands in the model domain
 !   for IFS: perhaps add another dimension for longitude
-!
+
 !   OUTPUT: 
 !   R2SO4: aerosol H2SO4 weight fraction (percent)
@@ -175,5 +175,5 @@
      
     REAL PMB(klon,klev), H2O(klon,klev)
-!
+
 !   working variables
     INTEGER I,J,K
@@ -187,5 +187,5 @@
     REAL YC(M)
     REAL XC1, XC16, YC1, YC28
-!
+
     SAVE INSTEP,F,XC,YC,XC1,XC16,YC1,YC28
 !$OMP THREADPRIVATE(INSTEP,F,XC,YC,XC1,XC16,YC1,YC28)
@@ -216,5 +216,5 @@
        XC(15)=30.0
        XC(16)=100.0
-!
+
        YC(1)=175.0
        DO I=2,28
@@ -226,5 +226,5 @@
          XC(I)=XC(I)*1.0E-4
        ENDDO
-!
+
        XC1=XC(1)+1.E-10
        XC16=XC(16)-1.E-8
@@ -247,5 +247,5 @@
        F(6,17)=86.79
        F(6,18)=88.32
-!
+
 !      ADD FACTOR  BECAUSE THE SLOP IS TOO IMPORTANT
 !      NOT FOR THIS ONE BUT THE REST
@@ -256,5 +256,5 @@
        F(6,2)=A*YC(2) + B
        F(6,3)=A*YC(3) + B
-!
+
        F(7,4)=37.02
        F(7,5)=49.46
@@ -272,5 +272,5 @@
        F(7,17)=85.85
        F(7,18)=87.33
-!
+
        A=(F(7,5)-F(7,4))/( (YC(5)-YC(4))*2.0)
        B=-A*YC(4) + F(7,4)
@@ -278,5 +278,5 @@
        F(7,2)=A*YC(2) + B
        F(7,3)=A*YC(3) + B
-!
+
        F(8,4)=25.85
        F(8,5)=42.26
@@ -294,5 +294,5 @@
        F(8,17)=84.67
        F(8,18)=86.10
-!
+
        A=(F(8,5)-F(8,4))/( (YC(5)-YC(4))*2.5 )
        B=-A*YC(4) + F(8,4)
@@ -300,5 +300,5 @@
        F(8,2)=A*YC(2) + B
        F(8,3)=A*YC(3) + B
-!
+
        F(9,4)=15.38
        F(9,5)=39.35
@@ -316,5 +316,5 @@
        F(9,17)=84.25
        F(9,18)=85.66
-!
+
        A=(F(9,5)-F(9,4))/( (YC(5)-YC(4))*7.0)
        B=-A*YC(4) + F(9,4)
@@ -322,5 +322,5 @@
        F(9,2)=A*YC(2) + B
        F(9,3)=A*YC(3) + B
-!
+
        F(10,4)=0.0
        F(10,5)=34.02
@@ -338,5 +338,5 @@
        F(10,17)=83.57
        F(10,18)=84.97
-!
+
        A=(F(10,6)-F(10,5))/( (YC(6)-YC(5))*1.5)
        B=-A*YC(5) + F(10,5)
@@ -345,5 +345,5 @@
        F(10,3)=A*YC(3) + B
        F(10,4)=A*YC(4) + B
-!
+
        F(11,4)=0.0
        F(11,5)=29.02
@@ -361,5 +361,5 @@
        F(11,17)=83.03
        F(11,18)=84.44
-!
+
        A=(F(11,6)-F(11,5))/( (YC(6)-YC(5))*2.5 )
        B=-A*YC(5) + F(11,5)
@@ -368,5 +368,5 @@
        F(11,3)=A*YC(3) + B
        F(11,4)=A*YC(4) + B
-!
+
        F(12,4)=0.0
        F(12,5)=23.13
@@ -384,5 +384,5 @@
        F(12,17)=82.58
        F(12,18)=83.99
-!
+
        A=(F(12,6)-F(12,5))/( (YC(6)-YC(5))*3.5 )
        B=-A*YC(5) + F(12,5)
@@ -391,5 +391,5 @@
        F(12,3)=A*YC(3) + B
        F(12,4)=A*YC(4) + B
-!
+
        F(13,4)=0.0
        F(13,5)=0.0
@@ -407,5 +407,5 @@
        F(13,17)=82.02
        F(13,18)=83.44
-!
+
        A=(F(13,7)-F(13,6))/( (YC(7)-YC(6))*2.0)
        B=-A*YC(6) + F(13,6)
@@ -415,5 +415,5 @@
        F(13,4)=A*YC(4) + B
        F(13,5)=A*YC(5) + B
-!
+
        F(14,4)=0.0
        F(14,5)=0.0
@@ -431,5 +431,5 @@
        F(14,17)=81.26
        F(14,18)=82.72
-!
+
        A=(F(14,7)-F(14,6))/( (YC(7)-YC(6))*2.5 )
        B=-A*YC(6) + F(14,6)
@@ -439,5 +439,5 @@
        F(14,4)=A*YC(4) + B
        F(14,5)=A*YC(5) + B
-!
+
        F(15,4)=0.0
        F(15,5)=0.0
@@ -455,5 +455,5 @@
        F(15,17)=80.12
        F(15,18)=81.64
-!
+
        A=(F(15,8)-F(15,7))/( (YC(8)-YC(7))*1.5)
        B=-A*YC(7) + F(15,7)
@@ -546,5 +546,5 @@
 !   klev: number of altitude bands in the model domain
 !   for IFS: perhaps add another dimension for longitude
-!
+
 !   OUTPUT: 
 !   ACTSO4: H2SO4 activity (percent)
@@ -624,5 +624,5 @@
 !   VERY ROUGH APPROXIMATION (SEE FOR WATER IN HANDBOOK
 !   LINEAR 2% FOR 30 DEGREES with RESPECT TO WATER)
-!   
+
 !   INPUT: 
 !   R2SO4: aerosol H2SO4 weight fraction (percent)
@@ -631,8 +631,8 @@
 !   klev: number of altitude bands in the model domain
 !   for IFS: perhaps add another dimension for longitude
-!
+
 !   OUTPUT: 
 !   DENSO4: aerosol mass density (gr/cm3 = aerosol mass/aerosol volume)
-!   
+
     USE dimphy, ONLY : klon,klev
     USE phys_local_var_mod, ONLY: R2SO4, DENSO4
@@ -657,5 +657,5 @@
 !***********************************************************
     SUBROUTINE FIND(X,Y,XC,YC,F,VAL,N,M)
-!
+
 !   BI-LINEAR INTERPOLATION
 
@@ -666,5 +666,5 @@
 !   YC: Table temperature (K)
 !   F: Table aerosol H2SO4 weight fraction=f(XC,YC) (percent)
-!
+
 !   OUTPUT: 
 !   VAL: aerosol H2SO4 weight fraction (percent)
@@ -674,5 +674,5 @@
     INTEGER N,M
     REAL X,Y,XC(N),YC(M),F(N,M),VAL
-!
+
 !   working variables
     INTEGER  IERX,IERY,JX,JY,JXP1,JYP1
@@ -768,5 +768,5 @@
       real function psh2so4(T) result(psh2so4_out)
 !     equilibrium H2SO4 pressure over pure H2SO4 solution (Pa)
-!
+
 !---->Ayers et.al. (1980), GRL (7) pp 433-436
 !     plus corrections for lower temperatures by Kulmala and Laaksonen (1990)
@@ -810,5 +810,5 @@
      real function psh2o(T) result(psh2o_out)
 !     equilibrium H2O pressure over pure liquid water (Pa)
-!
+
       implicit none
       real, intent(in) :: T
@@ -930,15 +930,15 @@
 !     as a function of temperature and  H2O pressure, using
 !     the parameterization of Tabazadeh et al., GRL, p1931, 1997.
-!
+
 !   Parameters
-!
+
 !    input:
 !      T.....temperature (K)
 !      pph2o..... amhbiant 2o pressure (Pa)
-!
+
 !    output:
 !      wph2so4......sulfuric acid composition (weight percent wt % h2so4)
 !                     = h2so4 mass fraction*100.
-!
+
       implicit none
       real, intent(in) :: pph2o, T 
@@ -1059,4 +1059,4 @@
        return
      end function rmvh2o
-!
+
 END MODULE sulfate_aer_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/traccoag_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
 MODULE traccoag_mod
-!
+
 ! This module calculates the concentration of aerosol particles in certain size bins
 ! considering coagulation and sedimentation.
-!
+
 CONTAINS
 
@@ -190,5 +190,5 @@
        
     CASE(2) ! stratospheric aerosol injections (SAI)
-!
+
      ! Computing duration of SAI in days...
      ! ... starting from 0...
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/YOECUMF.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/YOECUMF.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/YOECUMF.h	(revision 5099)
@@ -1,14 +1,14 @@
-!
+
 ! $Id$
-!
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez n'utiliser que des ! pour les commentaires
 !                 et bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
+
 !     ----------------------------------------------------------------
 !*    *COMMON* *YOECUMF* - PARAMETERS FOR CUMULUS MASSFLUX SCHEME
 !     ----------------------------------------------------------------
-!
+
       COMMON /YOECUMF/                                                  &
      &                 ENTRPEN,ENTRSCV,ENTRMID,ENTRDD,CMFCTOP,          &
@@ -21,13 +21,13 @@
       REAL CMFCTOP, CMFCMAX, CMFCMIN, CMFDEPS, RHCDD, CPRCON
 !$OMP THREADPRIVATE(/YOECUMF/)
-!
+
 !*if (DOC,declared) <> 'UNKNOWN'
 !*    *COMMON* *YOECUMF* - PARAMETERS FOR CUMULUS MASSFLUX SCHEME
-!
+
 !     M.TIEDTKE       E. C. M. W. F.      18/1/89
-!
+
 !     NAME      TYPE      PURPOSE
 !     ----      ----      -------
-!
+
 !     LMFPEN    LOGICAL  TRUE IF PENETRATIVE CONVECTION IS SWITCHED ON
 !     LMFSCV    LOGICAL  TRUE IF SHALLOW     CONVECTION IS SWITCHED ON
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/YOEGWD.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/YOEGWD.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/YOEGWD.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !  ATTENTION : ce fichier include est compatible format fixe/format libre
 !                 veillez  n'utiliser que des ! pour les commentaires
@@ -9,5 +9,5 @@
 !*    *COMMON* *YOEGWD* - PARAMETERS FOR GRAVITY WAVE DRAG CALCULATIONS
 !     -----------------------------------------------------------------
-!
+
       integer NKTOPG,NSTRA
       real GFRCRIT,GKWAKE,GRCRIT,GVCRIT,GKDRAG,GKLIFT
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/YOETHF.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/YOETHF.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/YOETHF.h	(revision 5099)
@@ -1,12 +1,12 @@
-!
+
 ! $Id$
-!
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez  n'utiliser que des ! pour les commentaires
 !                 et  bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
+
 !*    COMMON *YOETHF* DERIVED CONSTANTS SPECIFIC TO ECMWF THERMODYNAMICS
-!
+
 !     *R__ES*   *CONSTANTS USED FOR COMPUTATION OF SATURATION
 !                MIXING RATIO OVER LIQUID WATER(*R_LES*) OR
@@ -14,5 +14,5 @@
 !     *RVTMP2*  *RVTMP2=RCPV/RCPD-1.
 !     *RHOH2O*  *DENSITY OF LIQUID WATER.   (RATM/100.)
-!
+
       REAL R2ES, R3LES, R3IES, R4LES, R4IES, R5LES, R5IES
       REAL RVTMP2, RHOH2O
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/YOMCST.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/YOMCST.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/YOMCST.h	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Header$
-!
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez à n'utiliser que des ! pour les commentaires
 !                 et à bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
-!
+
+
 ! A1.0 Fundamental constants
       REAL RPI,RCLUM,RHPLA,RKBOL,RNAVO
@@ -30,5 +30,5 @@
       REAL RESTT,RALPW,RBETW,RGAMW,RALPS,RBETS,RGAMS
       REAL RALPD,RBETD,RGAMD
-!
+
       COMMON/YOMCST/RPI   ,RCLUM ,RHPLA ,RKBOL ,RNAVO                   &
      &      ,RDAY  ,REA   ,REPSM ,RSIYEA,RSIDAY,ROMEGA                  &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/YOMCST2.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/YOMCST2.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/YOMCST2.h	(revision 5099)
@@ -4,5 +4,5 @@
       REAL  Qcoef1max,Qcoef2max,Supcrit1,Supcrit2
       REAL coef_clos_ls
-!
+
       COMMON/YOMCST2/gammas,    alphas, betas, Fmax, scut,              &
      &               qqa1, qqa2, qqa3,                                  &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/acama_gwd_rando_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/acama_gwd_rando_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/acama_gwd_rando_m.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 module ACAMA_GWD_rando_m
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/add_phys_tend_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/add_phys_tend_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/add_phys_tend_mod.F90	(revision 5099)
@@ -1,6 +1,6 @@
-!
+
 ! $Id$
-!
-!
+
+
 MODULE add_phys_tend_mod
 
@@ -83,7 +83,7 @@
   RETURN
 END SUBROUTINE add_pbl_tend
-!
+
 ! $Id: add_phys_tend.F90 2611 2016-08-03 15:41:26Z jyg $
-!
+
 SUBROUTINE add_phys_tend (zdu,zdv,zdt,zdq,zdql,zdqi,zdqbs,paprs,text, &
                           abortphy,flag_inhib_tend, itap, diag_mode)
@@ -123,5 +123,5 @@
 INTEGER,                        INTENT(IN)    :: diag_mode       ! 0 -> normal effective mode
                                                                  ! 1 -> only conservation stats are computed
-!
+
 REAL, DIMENSION(klon,klev),     INTENT(INOUT) :: zdq
 
@@ -138,5 +138,5 @@
 REAL, DIMENSION(klon,klev)   :: sav_t_seri
 REAL, DIMENSION(klon,klev)   :: sav_zdq
-!
+
 INTEGER i, k,j, n
 INTEGER jadrs(klon*klev), jbad
@@ -150,9 +150,8 @@
 LOGICAL, SAVE :: first=.true.
 !$OMP THREADPRIVATE(first)
-!
+
 !======================================================================
 ! Variables for energy conservation tests
 !======================================================================
-!
 
 ! zh_col-------  total enthalpy of vertical air column
@@ -168,5 +167,5 @@
 ! zqbs_col------  total mass of blowing snow (kg/m2)
 ! zek_col------  total kinetic energy (kg/m2)
-!
+
 REAL zairm(klon, klev) ! layer air mass (kg/m2)
 REAL zqw_col(klon,2)
@@ -205,5 +204,5 @@
      first=.false.
   ENDIF
-!
+
 !  print *,'add_phys_tend: paprs ',paprs
 ! When in diagnostic mode, save initial values of out variables
@@ -297,5 +296,5 @@
      ENDDO
   ENDIF
-!
+
 !=====================================================================================
 ! Impression, warning et correction en cas de probleme moins important
@@ -359,5 +358,4 @@
       ENDDO ! j = 1, jqbad
   ENDIF
-!
 
 !IM ajout memes tests pour reverifier les jbad, jqbad beg
@@ -400,5 +398,5 @@
       ENDDO
   ENDIF 
-!
+
   IF (jqbad > 0) THEN
       DO j = 1, jqbad
@@ -474,5 +472,5 @@
 
   ENDIF ! endif (fl_ebil .GT. 0)
-!
+
 ! When in diagnostic mode, restore "out" variables to initial values.
   IF (diag_mode == 1) THEN
@@ -527,5 +525,5 @@
 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
 
@@ -533,9 +531,8 @@
 LOGICAL, SAVE :: first=.true.
 !$OMP THREADPRIVATE(first)
-!
+
 !======================================================================
 ! Variables for energy conservation tests
 !======================================================================
-!
 
 ! zh_col-------  total enthalpy of vertical air column
@@ -550,5 +547,5 @@
 ! zqbs_col------  total mass of blowing snow (kg/m2)
 ! zek_col------  total kinetic energy (kg/m2)
-!
+
 REAL zairm(nlon, nlev) ! layer air mass (kg/m2)
 REAL zqw_col(nlon,2)
@@ -574,5 +571,5 @@
      first=.false.
   ENDIF
-!
+
 !  print *,'add_phys_tend: paprs ',paprs
 !======================================================================
@@ -650,5 +647,4 @@
 
   ENDIF ! endif (fl_ebil .GT. 0)
-!
 
   RETURN
@@ -795,5 +791,5 @@
   IF (abs(bilq_error) > bilq_seuil) bilq_ok=1
   IF (abs(bilh_error) > bilh_seuil) bilh_ok=1
-!
+
 ! Print diagnostics
 ! =================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/aero_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/aero_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/aero_mod.F90	(revision 5099)
@@ -1,4 +1,4 @@
 ! $Id$
-!
+
 MODULE aero_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_2bands.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_2bands.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_2bands.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE AEROPT_2BANDS( &
      pdel, m_allaer, delt, RHcl, &
@@ -16,12 +16,11 @@
   !    Anne Cozic Avril 2009
   !    a partir d'une sous-routine de Johannes Quaas pour les sulfates
-  !
+
   IMPLICIT NONE
 
   INCLUDE "YOMCST.h"
 
-  !
   ! Input arguments:
-  !
+
   REAL, DIMENSION(klon,klev),     INTENT(in)  :: pdel
   REAL,                           INTENT(in)  :: delt
@@ -33,14 +32,13 @@
   REAL, DIMENSION(klon,klev),     INTENT(in)  :: t_seri
   REAL, DIMENSION(klev),          INTENT(in)  :: presnivs
-  !
+
   ! Output arguments:
-  !
+
   REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(out) :: tau_allaer ! epaisseur optique aerosol
   REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(out) :: piz_allaer ! single scattering albedo aerosol
   REAL, DIMENSION(klon,klev,naero_grp,nbands), INTENT(out) :: cg_allaer  ! asymmetry parameter aerosol
 
-  !
   ! Local
-  !
+
   REAL, DIMENSION(klon,klev,naero_tot,nbands) ::  tau_ae
   REAL, DIMENSION(klon,klev,naero_tot,nbands) ::  tau_ae_pi
@@ -130,7 +128,6 @@
   INTEGER :: nb_aer
 
-  !
   ! Proprietes optiques
-  !
+
   REAL:: alpha_aers_2bands(nbre_RH,nbands,naero_soluble)   !--unit m2/g SO4
   REAL:: alpha_aeri_2bands(nbands,naero_insoluble)
@@ -628,6 +625,4 @@
   ENDIF
 
-
-  !
   ! loop over modes, use of precalculated nmd and corresponding sigma
   !    loop over wavelengths
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_5wv.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_5wv.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_5wv.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 SUBROUTINE AEROPT_5WV(&
@@ -14,44 +13,43 @@
   USE pres2lev_mod
 
-  !
   !    Yves Balkanski le 12 avril 2006
   !    Celine Deandreis
   !    Anne Cozic  Avril 2009
   !    a partir d'une sous-routine de Johannes Quaas pour les sulfates
-  !
-  !
+
+
   ! Refractive indices for seasalt come from Shettle and Fenn (1979)
-  !
+
   ! Refractive indices from water come from Hale and Querry (1973)
-  !
+
   ! Refractive indices from Ammonium Sulfate Toon and Pollack (1976)
-  !
+
   ! Refractive indices for Dust, internal mixture of minerals coated with 1.5% hematite 
   ! by Volume (Balkanski et al., 2006)
-  !
+
   ! Refractive indices for POM: Kinne (pers. Communication 
-  !
+
   ! Refractive index for BC from Shettle and Fenn (1979)
-  !
+
   ! Shettle, E. P., & Fenn, R. W. (1979), Models for the aerosols of the lower atmosphere and 
   ! the effects of humidity variations on their optical properties, U.S. Air Force Geophysics 
   ! Laboratory Rept. AFGL-TR-79-0214, Hanscomb Air Force Base, MA.
-  !
+
   ! Hale, G. M. and M. R. Querry, Optical constants of water in the 200-nm to 200-m 
   ! wavelength region, Appl. Opt., 12, 555-563, 1973.
-  !
+
   ! Toon, O. B. and J. B. Pollack, The optical constants of several atmospheric aerosol species:
   ! Ammonium sulfate, aluminum oxide, and sodium chloride, J. Geohys. Res., 81, 5733-5748,
   ! 1976.
-  !
+
   ! Balkanski, Y., M. Schulz, T. Claquin And O. Boucher, Reevaluation of mineral aerosol 
   ! radiative forcings suggests a better agreement with satellite and AERONET data, Atmospheric 
   ! Chemistry and Physics Discussions., 6, pp 8383-8419, 2006.
-  !
+
   IMPLICIT NONE
   INCLUDE "YOMCST.h"
-  !
+
   ! Input arguments:
-  !
+
   REAL, DIMENSION(klon,klev), INTENT(in)   :: pdel
   REAL, INTENT(in)                         :: delt
@@ -62,13 +60,13 @@
   REAL, DIMENSION(klon,klev), INTENT(in)   :: t_seri
   REAL, DIMENSION(klev),      INTENT(in)   :: presnivs
-  !
+
   ! Output arguments:
-  !
+
   REAL, DIMENSION(klon), INTENT(out)          :: ai      ! POLDER aerosol index
   REAL, DIMENSION(klon,nwave,naero_tot), INTENT(out)      :: tausum
   REAL, DIMENSION(klon,klev,nwave,naero_tot), INTENT(out) :: tau
-  !
+
   ! Local
-  !
+
   INTEGER, PARAMETER :: las = nwave_sw
   LOGICAL :: soluble
@@ -150,7 +148,7 @@
    !  1- BC soluble; 2- POM soluble; 3- SO4 acc.; 4- SO4 coarse; 5 seasalt super-C; 6 seasalt coarse; 7 seasalt acc.
   REAL :: piz_aeri_5wv(las,naero_insoluble)           ! Insoluble comp. 1- Dust: 2- BC; 3- POM
-  !
+
   ! Proprietes optiques
-  !
+
   REAL :: fact_RH(nbre_RH)
   LOGICAL :: used_tau(naero_spc)
@@ -292,10 +290,10 @@
                  5.358E-02,  5.705E-02,  5.887E-02/
 !*********************************************************************
-!
-! 
+
+
 ! From here on we look at the optical parameters at 5 wavelengths:  
 ! 443nm, 550, 670, 765 and 865 nm 
 !                                   le 12 AVRIL 2006 
-!  
+
  DATA alpha_aers_5wv/ & 
                                 ! bc soluble 
@@ -384,5 +382,5 @@
                                  ! pom insoluble 
         5.042, 3.101, 1.890, 1.294, 0.934/ 
-   ! 
+
   DATA cg_aers_5wv/ &  
                                  ! bc soluble 
@@ -463,5 +461,5 @@
       0.605,0.644,0.656,0.669,0.681,0.729, &  
       0.737,0.750,0.765,0.775,0.787,0.803/
- !
+
   DATA cg_aeri_5wv/&
      ! dust insoluble
@@ -471,5 +469,5 @@
      !c pom insoluble
      0.596, 0.536, 0.466, 0.409, 0.359/
-  !
+
   DATA piz_aers_5wv/&
                            ! bc soluble 
@@ -551,5 +549,4 @@
   1.000,1.000,1.000,1.000,1.000,1.000/ 
 
- !
   DATA piz_aeri_5wv/&
      ! dust insoluble
@@ -653,5 +650,4 @@
   ENDIF
 
-  ! 
   ! loop over modes, use of precalculated nmd and corresponding sigma
   !    loop over wavelengths
@@ -659,8 +655,6 @@
   !      interpolate from Sext to retrieve Sext_at_gridpoint_per_species
   !      compute optical_thickness_at_gridpoint_per_species
-  
-  !
+
   ! Calculations that need to be done since we are not in the subroutines INCA
-  !      
 
   DO n=1,nbre_RH-1
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/albsno.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/albsno.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/albsno.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 SUBROUTINE albsno(klon, knon, dtime, agesno, alb_neig_grid, precip_snow)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/alpale.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/alpale.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/alpale.F90	(revision 5099)
@@ -19,5 +19,5 @@
   USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
   USE phys_local_var_mod, ONLY: zw2       ! Variables internes non sauvegardees de la physique
-!
+
   IMPLICIT NONE
 
@@ -67,10 +67,10 @@
        ! disponible ALP (W/m2) pour le soulevement des particules dans
        ! le modele convectif
-       !
+
        do i = 1,klon
           ALE(i) = 0.
           ALP(i) = 0.
        enddo
-       !
+
        !calcul de ale_wake et alp_wake
        if (iflag_wake>=1) then
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_th.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_th.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_th.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE alpale_th ( dtime, lmax_th, t_seri, cell_area,  &
                        cin, s2, n2, strig,  &
@@ -20,5 +20,5 @@
   USE ioipsl_getin_p_mod, ONLY : getin_p
   USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
-!
+
   IMPLICIT NONE
 
@@ -59,13 +59,13 @@
   REAL, DIMENSION(klon)                                      :: ale_bl_ref
   REAL, DIMENSION(klon)                                      :: tau_trig
-!
+
     !$OMP THREADPRIVATE(multiply_proba_notrig) 
     !$OMP THREADPRIVATE(random_notrig_max) 
     !$OMP THREADPRIVATE(cv_feed_area) 
     !$OMP THREADPRIVATE(first)
-!
+
  REAL umexp  ! expression of (1.-exp(-x))/x valid for all x, especially when x->0
  REAL x
-!
+
      CHARACTER (LEN=20) :: modname='alpale_th'
      CHARACTER (LEN=80) :: abort_message
@@ -75,5 +75,5 @@
 !!!            (1.-max(sign(1.,x-1.e-3),0.))*(-0.5*x*(1.-x/3.*(1.-0.25*x))) !!! bug introduced by mistake  (jyg)
 !!!            (1.-max(sign(1.,x-1.e-3),0.))*(1.-0.5*x*(1.-x/3.*(1.-0.25*x)))  !!! initial correct formula (jyg)
-!
+
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 !  JYG, 20160513 : Introduction of the Effective Lifting Power (ELP), which 
@@ -83,7 +83,6 @@
 ! zero. It is activated by iflag_clos_bl = 3.
 !   The ELP values are stored in the ALP_bl variable.
-!   
+
 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!
 
     IF (first) THEN
@@ -122,5 +121,5 @@
   IF (iflag_clos_bl < 3) THEN
 !---------------------------------------
-!
+
 !      Original code (Nicolas Rochetin)
 !     --------------------------------
@@ -128,5 +127,5 @@
           !-----------Stochastic triggering-----------
           if (iflag_trig_bl>=1) then
-             !
+
              IF (prt_level >= 10) THEN
                 WRITE(lunout,*)'cin, ale_bl_stat, alp_bl, alp_bl_stat ', &
@@ -146,5 +145,5 @@
                 endif
              enddo
-             !
+
              IF (prt_level >= 10) THEN
                 WRITE(lunout,*)'random_notrig, tau_trig ', &
@@ -202,5 +201,4 @@
              ENDIF
 
-             !
              IF (prt_level >= 10) THEN
                 WRITE(lunout,*)'proba_notrig, ale_bl_trig ', &
@@ -233,9 +231,8 @@
           endif !(iflag_clos_bl)
 
-!
 !---------------------------------------
   ELSEIF (iflag_clos_bl == 3) THEN  ! (iflag_clos_bl .LT. 3)
 !---------------------------------------
-!
+
 !      New code with Effective Lifting Power
 !     -------------------------------------
@@ -243,5 +240,5 @@
           !-----------Stochastic triggering-----------
      if (iflag_trig_bl>=1) then
-        !
+
         IF (prt_level >= 10) THEN
            WRITE(lunout,*)'cin, ale_bl_stat, alp_bl_stat ', &
@@ -272,5 +269,5 @@
            endif
         enddo
-        !
+
         IF (prt_level >= 10) THEN
            WRITE(lunout,*)'random_notrig, tau_trig ', &
@@ -308,5 +305,4 @@
          enddo
 
-        !
         IF (prt_level >= 10) THEN
            WRITE(lunout,*)'proba_notrig, ale_bl_trig ', &
@@ -326,5 +322,5 @@
 
           !cc fin nrlmd le 10/04/2012
-!
+
           !IM/FH: 2011/02/23 
           ! Couplage Thermiques/Emanuel seulement si T<0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/alpale_wk.F90	(revision 5099)
@@ -14,5 +14,5 @@
   USE ioipsl_getin_p_mod, ONLY : getin_p
   USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
-!
+
   IMPLICIT NONE
 
@@ -71,5 +71,5 @@
   proba_gf(:) = 1. - exp(-wdens(:)*rpi*((wkrad(:)+cellrad(:))**2 - &
                                         max(wkrad(:)-cellrad(:),0.)**2) )
-!
+
   proba_gf(:) = max(proba_gf(:),1.e-3)
 !  Compute Fip conditionned on the presence of some gust front within the 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/atm2geo.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/atm2geo.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/atm2geo.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE atm2geo ( im, jm, pte, ptn, plon, plat, pxx, pyy, pzz )
   USE dimphy
@@ -13,7 +13,6 @@
   CHARACTER (len = 80)               :: abort_message
 
-!
 ! Change wind local atmospheric coordinates to geocentric
-!
+
 ! Geocentric :
 ! axe x is eastward : crosses (0 N, 0 E) point.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cal_tools_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cal_tools_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cal_tools_m.F90	(revision 5099)
@@ -7,7 +7,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 FUNCTION year_len(y,cal_in)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -37,12 +37,12 @@
 
 END FUNCTION year_len
-!
+
 !-------------------------------------------------------------------------------
 
 
 !-------------------------------------------------------------------------------
-!
+
 FUNCTION mid_month(y,cal_in)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -80,10 +80,10 @@
 
 END FUNCTION mid_month
-!
+
 !-------------------------------------------------------------------------------
 
 
 END MODULE cal_tools_m
-!
+
 !*******************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 SUBROUTINE calbeta(dtime,indice,knon,snow,qsol, &
      vbeta,vcal,vdif)
@@ -16,5 +16,5 @@
 ! date: 19940414
 !======================================================================
-!
+
 ! Calculer quelques parametres pour appliquer la couche limite
 ! ------------------------------------------------------------ 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90	(revision 5099)
@@ -1,6 +1,5 @@
-!
+
 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/calbeta.F90,v 1.2 2007/06/22 12:49:51
 ! fairhead Exp $
-!
 
 SUBROUTINE calbeta_clim(klon,time,lat_radian,beta)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_STDlev.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_STDlev.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_STDlev.h	(revision 5099)
@@ -1,16 +1,16 @@
-!
+
 ! $Header$
-!
+
 !IM on initialise les variables 
-!
+
 !       missing_val=nf90_fill_real
-!
+
        IF (.not. ok_all_xml) then
         CALL ini_undefSTD(itap,itapm1)
        ENDIF
-!
+
 !IM on interpole les champs sur les niveaux STD de pression 
 !IM a chaque pas de temps de la physique
-!
+
 !-------------------------------------------------------c
 ! positionnement de l'argument logique a .false.        c
@@ -21,5 +21,5 @@
 ! dans plevel_new, d'ou la creation de cette routine... c
 !-------------------------------------------------------c
-!
+
         CALL plevel_new(klon,klev,nlevSTD,.true.,pplay,rlevSTD, &
                     t_seri,tlevSTD)
@@ -28,7 +28,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    v_seri,vlevSTD)
-!
-
-!
+
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zphi/RG,philevSTD)
@@ -37,5 +35,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_rh*100.,rhlevSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -45,5 +43,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,uvSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -53,5 +51,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,vqSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -61,5 +59,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,vTSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -69,5 +67,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,wqSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -77,5 +75,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,vphiSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -85,5 +83,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,wTSTD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -93,5 +91,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,u2STD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -101,5 +99,5 @@
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,v2STD)
-!
+
         DO l=1, klev
          DO i=1, klon
@@ -110,9 +108,8 @@
                    zx_tmp_fi3d,T2STD)
 
-!
       zx_tmp_fi3d(:,:)=wo(:,:,1) * dobson_u * 1e3 / zmasse / rmo3 * rmd
         CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD, &
                    zx_tmp_fi3d,O3STD)
-!
+
       if (read_climoz == 2) THEN
       zx_tmp_fi3d(:,:)=wo(:,:,2) * dobson_u * 1e3 / zmasse / rmo3 * rmd
@@ -120,5 +117,5 @@
                    zx_tmp_fi3d,O3daySTD)
       endif
-!
+
         DO l=1, klev
         DO i=1, klon
@@ -128,18 +125,18 @@
         CALL plevel_new(klon,klev,nlevSTD,.true.,zx_tmp_fi3d,rlevSTD, &
                    omega,wlevSTD)
-!
+
 !IM on somme les valeurs toutes les freq_calNMC secondes
 !IM on moyenne a la fin du mois, du jour ou toutes les 6h
-!
+
        IF (.not. ok_all_xml) then
         CALL undefSTD(itap, read_climoz)
         CALL moy_undefSTD(itap,itapm1)
        ENDIF
-!
+
        CALL plevel(klon,klev,.true.,pplay,50000., &
                     zphi/RG,geo500)
 
 !IM on interpole a chaque pas de temps le SWup(clr) et SWdn(clr) a 200 hPa
-!
+
       CALL plevel(klon,klevp1,.true.,paprs,20000., &
            swdn0,SWdn200clr)
@@ -150,5 +147,5 @@
       CALL plevel(klon,klevp1,.false.,paprs,20000., &
            swup,SWup200)
-!
+
       CALL plevel(klon,klevp1,.false.,paprs,20000., &
            lwdn0,LWdn200clr)
@@ -159,5 +156,5 @@
       CALL plevel(klon,klevp1,.false.,paprs,20000., &
            lwup,LWup200)
-!
+
       twriteSTD(:,:,1)=tsumSTD(:,:,1)
       qwriteSTD(:,:,1)=qsumSTD(:,:,1)
@@ -191,5 +188,5 @@
       vwriteSTD(:,:,4)=vlevSTD(:,:)
       wwriteSTD(:,:,4)=wlevSTD(:,:)
-!
+
 !IM initialisation 5eme fichier de sortie 
       twriteSTD(:,:,5)=tlevSTD(:,:)
@@ -200,5 +197,5 @@
       vwriteSTD(:,:,5)=vlevSTD(:,:)
       wwriteSTD(:,:,5)=wlevSTD(:,:)
-!
+
 !IM initialisation 6eme fichier de sortie 
       twriteSTD(:,:,6)=tlevSTD(:,:)
@@ -223,5 +220,5 @@
        ENDDO 
       ENDDO 
-!
+
       DO n=1, nlevSTD8
        DO k=1, nlevSTD
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_divers.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_divers.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_divers.h	(revision 5099)
@@ -1,18 +1,18 @@
-!
+
 ! $Id$
-!
+
 ! itap : nombre de pas de temps de la physique
 ! itapm1 : somme du nombre de pas de temps du/des mois precedent/s.
 ! (itap - itapm1) : nombre de pas de temps du mois courant
-!
+
 ! Ne pas modifier les IFs ci-dessous impliquant itapm1,
 ! autrement les resultats seront faux !!
-!
+
 ! Ici on utilise MOD(itap - itapm1,NINT(mth_len*un_jour/phys_tstep)).EQ.1)
 ! pour detecter le debut de chaque mois lorsque  l on tourne par an.
-!
+
 ! IM, 26.05.2023
-!
-!
+
+
 ! Initialisations itapm1 du premier mois
       IF(itap.EQ.1) THEN
@@ -21,5 +21,4 @@
       ENDIF
 
-!
 ! Initialisation debut de mois
       IF(itap.EQ.itapm1+1) THEN
@@ -27,5 +26,5 @@
 !        print*,'Initialisation ndayrain_mth ',itap
       ENDIF
-!
+
 ! Initialisation debut de chaque jour
       IF(MOD(itap,NINT(un_jour/phys_tstep)).EQ.1) THEN
@@ -33,5 +32,5 @@
 !       print*,'initialisation mois suivants day_rain itap',itap
       ENDIF
-!
+
 ! Calcul a chaque pas de temps de la physique
          DO i = 1, klon
@@ -39,5 +38,5 @@
             IF(total_rain(i).GT.0.) nday_rain(i)=1.
          ENDDO
-!
+
 ! Cumul en fin de journee
       IF(MOD(itap,NINT(un_jour/phys_tstep)).EQ.0) THEN
@@ -46,5 +45,5 @@
          ENDDO
       ENDIF
-!
+
 ! Initialisation fin de mois
 ! Ne pas changer le IF ci-dessous, car le compteur itapm1 est augmente
@@ -55,7 +54,7 @@
 !       print*,'fmois i i1 mjt',itap,itapm1,mth_len,un_jour,phys_tstep
       ENDIF
-!
+
 ! calcul temperatures minimale et maximale moyennees sur le mois 
-!
+
 !initialisation debut de mois pour les fichiers mensuels annuels
   IF(itap.EQ.itapm1+1) THEN
@@ -63,5 +62,5 @@
      t2m_max_mon=0.
   ENDIF
-!
+
 !initialisation debut de journee pour les fichiers mensuels annuels
   IF(MOD(itap,NINT(un_jour/phys_tstep)).EQ.1) THEN
@@ -69,5 +68,5 @@
      zt2m_max_mon=zt2m
   ENDIF
-!
+
 !calcul sur tous les pas de temps pour les fichiers mensuels annuels
      DO i = 1, klon
@@ -75,5 +74,5 @@
         zt2m_max_mon(i)=MAX(zt2m(i),zt2m_max_mon(i))
      ENDDO
-!
+
 !fin journee
   IF(MOD(itap,NINT(un_jour/phys_tstep)).EQ.0) THEN
@@ -81,5 +80,5 @@
    t2m_max_mon=t2m_max_mon+zt2m_max_mon 
   ENDIF
-!
+
 !fin mois
   IF(itap==itapm1) THEN
@@ -87,3 +86,2 @@
    t2m_max_mon=t2m_max_mon/mth_len
   ENDIF
-!
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_fluxs_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_fluxs_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calcul_fluxs_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE calcul_fluxs_mod
 
@@ -24,7 +24,7 @@
 ! Cette routine calcule les fluxs en h et q a l'interface et eventuellement
 ! une temperature de surface (au cas ou ok_veget = false)
-!
+
 ! L. Fairhead 4/2000
-!
+
 ! input:
 !   knon         nombre de points a traiter
@@ -47,5 +47,5 @@
 !   radsol       rayonnement net aus sol (LW + SW)
 !   dif_grnd     coeff. diffusion vers le sol profond
-!
+
 ! output:
 !   tsurf_new    temperature au sol
@@ -121,5 +121,5 @@
 ! Traitement neige et humidite du sol
 !****************************************************************************************
-!
+
 !!$  WRITE(*,*)'test calcul_flux, surface ', nisurf
 !!PB test
@@ -135,6 +135,4 @@
 !!$    IF (nisurf /= is_ter) qsol = max_eau_sol
 
-
-! 
 ! Initialisation
 !****************************************************************************************
@@ -146,5 +144,5 @@
     if (PRESENT(lat_prec_liq)) lat_prec_liq = 0.
     if (PRESENT(lat_prec_sol)) lat_prec_sol = 0.
-!
+
 ! zx_qs = qsat en kg/kg
 !****************************************************************************************
@@ -219,7 +217,6 @@
             + dtime * dif_grnd(i))
 
-!
 ! Y'a-t-il fonte de neige?
-!
+
 !    fonte_neige = (nisurf /= is_oce) .AND. &
 !     & (snow(i) > epsfra .OR. nisurf == is_sic .OR. nisurf == is_lic) &
@@ -244,7 +241,7 @@
        q1_new = peqAcoef(i) - peqBcoef(i)*evap(i)*dtime
        qsurf(i)=q1_new*(1.-beta(i)) + beta(i)*qsat_new
-!
+
 ! en cas de fonte de neige
-!
+
 !    if (fonte_neige) then
 !      bilan_f = radsol(i) + fluxsens(i) - (zx_sl(i) * evap (i)) - &
@@ -259,5 +256,5 @@
 !!$     &  run_off(i) = run_off(i) + max(qsol(i) - max_eau_sol, 0.0)
 !!$    qsol(i) = min(qsol(i), max_eau_sol) 
-!
+
 ! calcul de l'enthalpie des precipitations liquides et solides
        if (PRESENT(sens_prec_liq)) sens_prec_liq(i) &
@@ -277,9 +274,9 @@
     
 !**************************************************************************
-!
+
   END SUBROUTINE calcul_fluxs
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE calcul_flux_wind(knon, dtime, &
        u0, v0, u1, v1, gustiness, cdrag_m, &
@@ -314,5 +311,5 @@
 !****************************************************************************************
 ! Calculate the surface flux
-!
+
 !****************************************************************************************
     DO i=1,knon
@@ -324,6 +321,6 @@
 
   END SUBROUTINE calcul_flux_wind
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE calcul_fluxs_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       subroutine calltherm(dtime  &
         ,pplay,paprs,pphi,weak_inversion  &
@@ -138,5 +138,5 @@
       REAL d_t_the(klon,klev), d_q_the(klon,klev)
       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)
@@ -475,5 +475,4 @@
          enddo ! isplit
 
-!
 !***************************************************************
 !     calcul du flux ascencant conservatif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calwake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calwake.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calwake.F90	(revision 5099)
@@ -153,5 +153,4 @@
 d_wdens(:) = 0.
 d_awdens(:) = 0.
-!
 
   DO i = 1, klon
@@ -170,5 +169,5 @@
     hw(i) = wake_h(i)
   END DO
-!
+
 !    Make a copy of state variables
   DO l = 1, klev
@@ -224,5 +223,4 @@
     d_deltatw, d_deltaqw, d_sigmaw, d_asigmaw, d_wdens, d_awdens)      ! tendencies
 
-!
   DO l = 1, klev
     DO i = 1, klon
@@ -293,5 +291,4 @@
     END IF
   END DO
-!
 
 !jyg<  
@@ -316,5 +313,5 @@
     END DO
   ENDIF  ! (iflag_wake_tend .EQ. 0)
-!
+
   IF (first) THEN
     DO i = 1,klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/carbon_cycle_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/carbon_cycle_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/carbon_cycle_mod.F90	(revision 5099)
@@ -3,5 +3,5 @@
 !   Authors: Patricia Cadule and Laurent Fairhead
 !            base sur un travail anterieur mene par Patricia Cadule et Josefine Ghattas
-!
+
 !  Purpose and description:
 !  -----------------------
@@ -9,11 +9,11 @@
 !   - Initialisation of carbon cycle fields
 !   - Definition of fluxes to be exchanged
-!
+
 ! Rest of code is in tracco2i.F90
-!
+
 ! Le cas online/offline est defini par le flag carbon_cycle_cpl (y/n)
 ! Le transport du traceur CO2 est defini par le flag carbon_cycle_tr (y/n)
 ! la provenance des champs (termes de puits) est denini par le flag level_coupling_esm
-!
+
 ! level_coupling_esm : level of coupling of the biogeochemical fields between
 ! LMDZ, ORCHIDEE and NEMO
@@ -285,11 +285,11 @@
 
 !=======================================================================
-!
+
 !   Authors: Patricia Cadule and Laurent Fairhead  
 !   -------
-!
+
 !  Purpose and description:
 !  -----------------------
-!
+
 ! Infofields
 ! this routine enables to define the field exchanges in both directions between
@@ -307,5 +307,5 @@
 ! nb_fields_in : number of inputs fields to ORCHIDEE (LMDZ to ORCHIDEE)
 ! nb_fields_out : number of ouput fields of ORCHIDEE (ORCHIDEE to LMDZ)
-!
+
 ! The syntax for coupling_fields.def is as follows:
 ! IMPORTANT: each column entry must be separated from the previous one by 3
@@ -314,5 +314,5 @@
 !                    direction
 !   10char  -3spaces-  3char  -3spaces- 4char -3spaces- 4char -3spaces-  30char 
-!
+
 ! n
 ! FIELD1 IN LMDZ ORC
@@ -322,5 +322,5 @@
 ! ...
 ! FIELDn OUT LMDZ ORC   
-! 
+
 !=======================================================================
 !   ... 22/12/2017 ....
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cdrag_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cdrag_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cdrag_mod.F90	(revision 5099)
@@ -1,19 +1,19 @@
-!
+
 !$Id$
-!
-!
+
+
 MODULE cdrag_mod
-!
+
 ! This module contains some procedures for calculation of the cdrag
 ! coefficients for turbulent diffusion at surface
-!
+
   IMPLICIT NONE
 
 CONTAINS
-!
+
 !****************************************************************************************
-!
+
 !r original routine svn3623
-!
+
  SUBROUTINE cdrag(knon,  nsrf,   &
      speed, t1,    q1,    zgeop1, &
@@ -32,5 +32,5 @@
   IMPLICIT NONE
 ! ================================================================= c
-!
+
 ! Objet : calcul des cdrags pour le moment (pcfm) et 
 !         les flux de chaleur sensible et latente (pcfh) d'apr??s
@@ -38,9 +38,9 @@
 !         ou Zilitinkevich et al 2002  pour les cas stables, Louis 1979
 !         et 1982 pour les cas instables 
-!
+
 ! Modified history: 
 !  writting on the 20/05/2016
 !  modified on the 13/12/2016 to be adapted to LMDZ6
-!
+
 ! References:
 !   Louis, J. F., 1979: A parametric model of vertical eddy fluxes in the
@@ -62,15 +62,15 @@
 !   to surface and boundary-layer flux parametrizations
 !   QJRMS, 127, pp 779-794
-!
+
 ! ================================================================= c
 ! ================================================================= c
 ! On choisit le couple de fonctions de correction avec deux flags:
 ! Un pour les cas instables, un autre pour les cas stables
-!
+
 ! iflag_corr_insta:
 !                   1: Louis 1979 avec les modifications de Mascart 1995 (z0/= z0h)
 !                   2: Louis 1982 
 !                   3: Laurent Li
-!
+
 ! iflag_corr_sta:
 !                   1: Louis 1979 avec les modifications de Mascart 1995 (z0/= z0h)
@@ -79,6 +79,6 @@
 !                   4: King  2001 (SHARP)
 !                   5: MO 1st order theory (allow collapse of turbulence)
-!            
-!
+
+
 !*****************************************************************
 ! Parametres d'entree
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cfmip_point_locations.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cfmip_point_locations.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cfmip_point_locations.F90	(revision 5099)
@@ -52,8 +52,8 @@
   DO np=1, npCFMIP
   DO i=1, nbp_lon
-!
+
 ! PRINT*,'IM np i lonCF lonGCM lonGCM+1',np,i,lonCFMIP(np),lon(i), &
 !  lon(i+1)
-!
+
    IF(lonCFMIP(np)>=lon(i).AND.lonCFMIP(np)<lon(i+1)) THEN
     dlon1 = abs (lonCFMIP(np) - lon(i))
@@ -67,5 +67,5 @@
   END DO
   END DO
-!
+
    np=1
 30 j=1
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/change_srf_frac_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/change_srf_frac_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/change_srf_frac_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE change_srf_frac_mod
 
@@ -7,5 +7,5 @@
 
 CONTAINS
-! 
+
 ! Change Surface Fractions
 ! Author J Ghattas 2008
@@ -14,8 +14,5 @@
         pctsrf, evap, z0m, z0h, agesno,              &
         alb_dir, alb_dif, tsurf, ustar, u10m, v10m, pbl_tke)
-   
 
-
-!
 ! This subroutine is called from physiq.F at each timestep. 
 ! 1- For each type of ocean (force, slab, couple) receive new fractions only if
@@ -24,5 +21,4 @@
 ! 2- Tests and ajustements are done on the fractions 
 ! 3- Initialize variables where a new fraction(new or melted ice) has appered, 
-!
 
     USE dimphy 
@@ -105,5 +101,5 @@
 ! - Put to zero fractions that are too small
 ! - Test total fraction sum is one for each grid point
-!
+
 !****************************************************************************************
     IF (is_modified) THEN
@@ -176,5 +172,5 @@
 ! i.e. where new sea ice has been formed
 ! or where ice free ocean has appread in a grid cell
-! 
+
 !****************************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/chem.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/chem.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/chem.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER idms, iso2, iso4, ih2s, idmso, imsa, ih2o2
       PARAMETER (idms=1, iso2=2, iso4=3)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/chemistry_cycle_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/chemistry_cycle_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/chemistry_cycle_mod.F90	(revision 5099)
@@ -3,10 +3,10 @@
 !=======================================================================
 !   Authors: Anne Cozic and Thibaut Lurton
-!
+
 !  Purpose and description:
 !  -----------------------
 ! Control module for the chemistry  tracers :
 !   - Definition of fluxes to be exchanged with Pisces and Inca 
-!
+
 !=======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/clc_core_cp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/clc_core_cp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/clc_core_cp.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       SUBROUTINE clc_core_cp(du, dt, dq, t1, q1, &
      				zu, zt, zq, &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/clcdrag.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/clcdrag.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/clcdrag.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 !$Id$
-!
+
 SUBROUTINE clcdrag(knon, nsrf, paprs, pplay,&
      u1, v1, t1, q1, &
@@ -12,10 +12,10 @@
   IMPLICIT NONE
 ! ================================================================= c
-!
+
 ! Objet : calcul des cdrags pour le moment (pcfm) et 
 !         les flux de chaleur sensible et latente (pcfh).   
-!
+
 ! ================================================================= c
-!
+
 ! knon----input-I- nombre de points pour un type de surface
 ! nsrf----input-I- indice pour le type de surface; voir indice_sol_mod.F90
@@ -27,8 +27,8 @@
 ! qsurf---input-R- humidite de l'air a la surface
 ! rugos---input-R- rugosite
-!
+
 ! pcfm---output-R- cdrag pour le moment 
 ! pcfh---output-R- cdrag pour les flux de chaleur latente et sensible
-!
+
   INTEGER, INTENT(IN)                      :: knon, nsrf
   REAL, DIMENSION(klon,klev+1), INTENT(IN) :: paprs
@@ -38,15 +38,15 @@
   REAL, DIMENSION(klon), INTENT(IN)        :: rugos
   REAL, DIMENSION(klon), INTENT(OUT)       :: pcfm, pcfh
-!
+
 ! ================================================================= c
-!
+
   INCLUDE "YOMCST.h"
   INCLUDE "YOETHF.h"
   INCLUDE "clesphys.h"
-!
+
 ! Quelques constantes et options:
 !!$PB      REAL, PARAMETER :: ckap=0.35, cb=5.0, cc=5.0, cd=5.0, cepdu2=(0.1)**2
   REAL, PARAMETER :: ckap=0.40, cb=5.0, cc=5.0, cd=5.0, cepdu2=(0.1)**2
-!
+
 ! Variables locales :
   INTEGER               :: i
@@ -65,6 +65,4 @@
   CHARACTER (LEN=20) :: modname = 'clcdrag'
 
-
-!
 ! Fonctions thermodynamiques et fonctions d'instabilite
   REAL                  :: fsta, fins, x
@@ -78,7 +76,7 @@
 
 ! ================================================================= c
-!
+
 ! Calculer le geopotentiel du premier couche de modele
-!
+
   DO i = 1, knon
      zgeop1(i) = RD * t1(i) / (0.5*(paprs(i,1)+pplay(i,1))) &
@@ -86,7 +84,7 @@
   END DO
 ! ================================================================= c
-!
+
 ! Calculer le frottement au sol (Cdrag)
-!
+
   DO i = 1, knon
      zdu2 = MAX(cepdu2,u1(i)**2+v1(i)**2)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/clesphys.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/clesphys.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/clesphys.h	(revision 5099)
@@ -1,9 +1,9 @@
 ! $Id$
-!
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez \`a n'utiliser que des ! pour les commentaires
 !                 et \`a bien positionner les & des lignes de continuation 
 !                 (les placer en colonne 6 et en colonne 73)
-!
+
 !..include cles_phys.h
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/climb_hq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/climb_hq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/climb_hq_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
 MODULE climb_hq_mod
-!
+
 ! Module to solve the verctical diffusion of "q" and "H"; 
 ! specific humidity and potential energi.
-!
+
   USE dimphy
 
@@ -30,7 +30,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_hq_down(knon, coefhq, paprs, pplay, &
        delp, temp, q, dtime, &
@@ -44,5 +44,5 @@
 ! for the quantity X=[Q,H] in equation X(k) = C(k) + D(k)*X(k-1), where k is
 ! the index of the vertical layer.
-!
+
 ! Input arguments
 !****************************************************************************************
@@ -90,5 +90,5 @@
 ! 1)
 ! Allocation at first time step only
-!   
+
 !****************************************************************************************
 
@@ -132,5 +132,5 @@
 ! 2)
 ! Definition of the coeficient K 
-!
+
 !****************************************************************************************
     Kcoefhq(:,:) = 0.0
@@ -146,5 +146,5 @@
 ! 3)
 ! Calculation of gama for "Q" and "H"
-!
+
 !****************************************************************************************
 !   surface pressure is used as reference
@@ -180,5 +180,5 @@
 ! 4)
 ! Calculte the coefficients C and D for specific humidity, q
-!
+
 !****************************************************************************************
     
@@ -189,5 +189,5 @@
 ! 5)
 ! Calculte the coefficients C and D for potentiel entalpie, H 
-!
+
 !****************************************************************************************
     h_old(:,:) = 0.0
@@ -207,5 +207,5 @@
 ! 6)
 ! Return the first layer in output variables
-!
+
 !****************************************************************************************
     Acoef_H_out = Acoef_H
@@ -217,5 +217,5 @@
 ! 7)
 ! If Pbl is split, return also the other layers in output variables
-!
+
 !****************************************************************************************
 !!! jyg le 07/02/2012
@@ -244,12 +244,12 @@
 
   END SUBROUTINE climb_hq_down
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE calc_coef(knon, Kcoef, gama, delp, X, Ccoef, Dcoef, Acoef, Bcoef)
-!
+
 ! Calculate the coefficients C and D in : X(k) = C(k) + D(k)*X(k-1)
 ! where X is H or Q, and k the vertical level k=1,klev
-!
+
     INCLUDE "YOMCST.h"
 ! Input arguments
@@ -272,5 +272,5 @@
 !****************************************************************************************
 ! Niveau au sommet, k=klev
-!
+
 !****************************************************************************************
     Ccoef(:,:) = 0.0
@@ -287,5 +287,5 @@
 !****************************************************************************************
 ! Niveau  (klev-1) <= k <= 2
-!
+
 !****************************************************************************************
 
@@ -301,5 +301,5 @@
 !****************************************************************************************
 ! Niveau k=1
-!
+
 !****************************************************************************************
 
@@ -311,7 +311,7 @@
 
   END SUBROUTINE calc_coef
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_hq_up(knon, dtime, t_old, q_old, &
        flx_q1, flx_h1, paprs, pplay, &
@@ -322,5 +322,5 @@
 !!!
        flux_q, flux_h, d_q, d_t)
-! 
+
 ! This routine calculates the flux and tendency of the specific humidity q and 
 ! the potential engergi H. 
@@ -328,5 +328,4 @@
 ! X(k) = C(k) + D(k)*X(k-1) for X=[q,H], where the coefficients 
 ! C and D are known from before and k is index of the vertical layer.
-!   
 
 ! Input arguments
@@ -365,5 +364,5 @@
 ! Definition of some variables
     REAL, DIMENSION(klon,klev)               :: d_h, zairm
-!
+
 !****************************************************************************************
     flux_q(:,:) = 0.0
@@ -406,5 +405,5 @@
 ! 2)
 ! Calculation of Q and H
-!
+
 !****************************************************************************************
 
@@ -423,5 +422,5 @@
 ! 3)
 ! Calculation of the flux for Q and H
-!
+
 !****************************************************************************************
 
@@ -444,5 +443,5 @@
 ! 4)
 ! Calculation of tendency for Q and H
-!
+
 !****************************************************************************************
     d_h_col_vdf(:) = 0.0
@@ -461,5 +460,5 @@
 !****************************************************************************************
 ! Some deallocations
-!
+
 !****************************************************************************************
     IF (last) THEN
@@ -476,7 +475,7 @@
     END IF
   END SUBROUTINE climb_hq_up
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE climb_hq_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/climb_qbs_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/climb_qbs_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/climb_qbs_mod.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE climb_qbs_mod
-!
+
 ! Module to solve the verctical diffusion of blowing snow; 
-!
+
   USE dimphy
 
@@ -20,7 +20,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_qbs_down(knon, coefqbs, paprs, pplay, &
        delp, temp, qbs, dtime, &
@@ -32,5 +32,5 @@
 ! for the quantity X=[QBS] in equation X(k) = C(k) + D(k)*X(k-1), where k is
 ! the index of the vertical layer.
-!
+
 ! Input arguments
 !****************************************************************************************
@@ -70,5 +70,5 @@
 ! 1)
 ! Allocation at first time step only
-!   
+
 !****************************************************************************************
 
@@ -95,5 +95,5 @@
 ! 2)
 ! Definition of the coeficient K 
-!
+
 !****************************************************************************************
     Kcoefqbs(:,:) = 0.0
@@ -109,5 +109,5 @@
 ! 3)
 ! Calculation of gama for "Q" and "H"
-!
+
 !****************************************************************************************
 !   surface pressure is used as reference
@@ -138,5 +138,5 @@
 ! 4)
 ! Calculte the coefficients C and D for specific content of blowing snow, qbs
-!
+
 !****************************************************************************************
     
@@ -148,5 +148,5 @@
 ! 5)
 ! Return the first layer in output variables
-!
+
 !****************************************************************************************
     Acoef_QBS_out = Acoef_QBS
@@ -156,5 +156,5 @@
 ! 6)
 ! If Pbl is split, return also the other layers in output variables
-!
+
 !****************************************************************************************
     IF (mod(iflag_pbl_split,10) >=1) THEN
@@ -176,12 +176,12 @@
 
   END SUBROUTINE climb_qbs_down
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE calc_coef_qbs(knon, Kcoef, gama, delp, X, Ccoef, Dcoef, Acoef, Bcoef)
-!
+
 ! Calculate the coefficients C and D in : X(k) = C(k) + D(k)*X(k-1)
 ! where X is QQBS, and k the vertical level k=1,klev
-!
+
     INCLUDE "YOMCST.h"
 ! Input arguments
@@ -204,5 +204,5 @@
 !****************************************************************************************
 ! Niveau au sommet, k=klev
-!
+
 !****************************************************************************************
     Ccoef(:,:) = 0.0
@@ -219,5 +219,5 @@
 !****************************************************************************************
 ! Niveau  (klev-1) <= k <= 2
-!
+
 !****************************************************************************************
 
@@ -233,5 +233,5 @@
 !****************************************************************************************
 ! Niveau k=1
-!
+
 !****************************************************************************************
 
@@ -243,7 +243,7 @@
 
   END SUBROUTINE calc_coef_qbs
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_qbs_up(knon, dtime, qbs_old, &
        flx_qbs1, paprs, pplay, &
@@ -252,10 +252,9 @@
        Kcoef_qbs_in, gama_qbs_in, &
        flux_qbs, d_qbs)
-! 
+
 ! This routine calculates the flux and tendency of the specific content of blowing snow qbs 
 ! The quantity qbs is calculated according to 
 ! X(k) = C(k) + D(k)*X(k-1) for X=[qbs], where the coefficients 
 ! C and D are known from before and k is index of the vertical layer.
-!   
 
 ! Input arguments
@@ -294,5 +293,5 @@
 ! Definition of some variables
     REAL, DIMENSION(klon,klev)               :: zairm
-!
+
 !****************************************************************************************
     flux_qbs(:,:) = 0.0
@@ -323,5 +322,5 @@
 ! 2)
 ! Calculation of QBS
-!
+
 !****************************************************************************************
 
@@ -337,5 +336,5 @@
 ! 3)
 ! Calculation of the flux for QBS
-!
+
 !****************************************************************************************
 
@@ -354,5 +353,5 @@
 ! 4)
 ! Calculation of tendency for QBS
-!
+
 !****************************************************************************************
     DO k = 1, klev
@@ -365,5 +364,5 @@
 !****************************************************************************************
 ! Some deallocations
-!
+
 !****************************************************************************************
     IF (last) THEN
@@ -378,7 +377,7 @@
     END IF
   END SUBROUTINE climb_qbs_up
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE climb_qbs_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/climb_wind_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/climb_wind_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/climb_wind_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 MODULE climb_wind_mod
-!
+
 ! Module to solve the verctical diffusion of the wind components "u" and "v".
-!
+
   USE dimphy
 
@@ -30,7 +30,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_wind_init
 
@@ -40,5 +40,5 @@
 !****************************************************************************************
 ! Allocation of global module variables
-!
+
 !****************************************************************************************
 
@@ -70,7 +70,7 @@
 
   END SUBROUTINE climb_wind_init
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_wind_down(knon, dtime, coef_in, pplay, paprs, temp, delp, u_old, v_old, &
 !!! nrlmd le 02/05/2011
@@ -79,10 +79,9 @@
 !!!
        Acoef_U_out, Acoef_V_out, Bcoef_U_out, Bcoef_V_out)
-!
+
 ! This routine calculates for the wind components u and v,
 ! recursivly the coefficients C and D in equation 
 ! X(k) = C(k) + D(k)*X(k-1), X=[u,v], k=[1,klev] is the vertical layer.
-!
-!
+
 
 ! Input arguments
@@ -131,5 +130,5 @@
 !****************************************************************************************
 ! Calculate the coefficients C and D in : u(k) = C(k) + D(k)*u(k-1)
-!
+
 !****************************************************************************************
 ! - Define alpha (alf1 and alf2) 
@@ -159,5 +158,5 @@
 ! 6)
 ! Return the first layer in output variables
-!
+
 !****************************************************************************************
     Acoef_U_out = Acoef_U
@@ -169,5 +168,5 @@
 ! 7)
 ! If Pbl is split, return also the other layers in output variables
-!
+
 !****************************************************************************************
 !!! jyg le 07/02/2012
@@ -193,11 +192,11 @@
 
   END SUBROUTINE climb_wind_down
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE calc_coef(knon, Kcoef, delp, X, alfa1, alfa2, Ccoef, Dcoef, Acoef, Bcoef)
-!
+
 ! Find the coefficients C and D in fonction of alfa, K and delp
-!
+
 ! Input arguments
 !****************************************************************************************
@@ -219,8 +218,7 @@
     INCLUDE "YOMCST.h"
 !****************************************************************************************
-! 
 
 ! Calculate coefficients C and D at top level, k=klev
-!
+
     Ccoef(:,:) = 0.0
     Dcoef(:,:) = 0.0
@@ -232,8 +230,7 @@
        Dcoef(i,klev) = Kcoef(i,klev)/buf
     END DO
-    
-! 
+
 ! Calculate coefficients C and D at top level (klev-1) <= k <= 2
-!
+
     DO k=(klev-1),2,-1
        DO i = 1, knon
@@ -245,7 +242,6 @@
     END DO
 
-!
 ! Calculate coeffiecent A and B at surface
-!
+
     DO i = 1, knon
        buf = delp(i,1) + Kcoef(i,2)*(1-Dcoef(i,2))
@@ -255,7 +251,6 @@
 
   END SUBROUTINE calc_coef
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
 
   SUBROUTINE climb_wind_up(knon, dtime, u_old, v_old, flx_u1, flx_v1,  &
@@ -266,12 +261,12 @@
 !!!
        flx_u_new, flx_v_new, d_u_new, d_v_new)
-!
+
 ! Diffuse the wind components from the surface layer and up to the top layer. 
 ! Coefficents A, B, C and D are known from before. Start values for the diffusion are the
 ! momentum fluxes at surface.
-!
+
 ! u(k=1) = A + B*flx*dtime
 ! u(k)   = C(k) + D(k)*u(k-1)  [2 <= k <= klev]
-!
+
 !****************************************************************************************
 
@@ -304,6 +299,5 @@
     INCLUDE "YOMCST.h"
     INCLUDE "compbl.h"    
-    
-!
+
 !****************************************************************************************
 
@@ -347,10 +341,10 @@
 !****************************************************************************************
 ! Calcul flux
-!
+
 !== flux_u/v est le flux de moment angulaire (positif vers bas)
 !== dont l'unite est: (kg m/s)/(m**2 s) 
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
     flx_u_new(:,:) = 0.0
     flx_v_new(:,:) = 0.0
@@ -372,5 +366,5 @@
 !****************************************************************************************
 ! Calcul tendances
-!
+
 !****************************************************************************************
     d_u_new(:,:) = 0.0
@@ -384,6 +378,6 @@
 
   END SUBROUTINE climb_wind_up
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE climb_wind_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cltrac.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cltrac.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cltrac.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE cltrac(dtime,coef,t,tr,flux,paprs,pplay,delp, &
                   d_tr,d_tr_dry,flux_tr_dry)                    !jyg
@@ -12,5 +12,5 @@
 ! Objet: diffusion verticale de traceurs avec flux fixe a la surface
 !        ou/et flux du type c-drag
-!
+
 ! Arguments:
 !-----------
@@ -31,7 +31,7 @@
 !======================================================================
   include "YOMCST.h"
-!
+
 ! Entree
-! 
+
   REAL,INTENT(IN)                        :: dtime
   REAL,DIMENSION(klon,klev),INTENT(IN)   :: coef
@@ -40,14 +40,14 @@
   REAL,DIMENSION(klon,klev+1),INTENT(IN) :: paprs 
   REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay, delp
-!
+
 ! Sorties
-!
+
   REAL ,DIMENSION(klon,klev),INTENT(OUT) :: d_tr
   REAL ,DIMENSION(klon),INTENT(OUT)       :: d_tr_dry          !jyg
   REAL ,DIMENSION(klon),INTENT(OUT)       :: flux_tr_dry       !jyg
 !  REAL ,DIMENSION(klon,klev),INTENT(OUT) :: flux_tr
-!
+
 ! Local
-! 
+
   INTEGER                   :: i, k
   REAL,DIMENSION(klon)      :: cdrag, tr0
@@ -97,8 +97,8 @@
   DO i = 1, klon
      zx_buf(i) = delp(i,1) + zx_coef(i,1)*zx_alf1(i) + zx_coef(i,2)
-     !
+
      zx_ctr(i,2) = (local_tr(i,1)*delp(i,1)+                  &
           zx_coef(i,1)*tr0(i)-zx_flux(i))/zx_buf(i)
-     !
+
      zx_dtr(i,2) = (zx_coef(i,2)-zx_alf2(i)*zx_coef(i,1)) /   & 
           zx_buf(i)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cltracrn.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cltracrn.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cltracrn.F90	(revision 5099)
@@ -17,5 +17,5 @@
 ! Objet: diffusion verticale de traceurs avec quantite de traceur ds 
 !        le sol ( reservoir de sol de radon ) 
-!        
+
 ! note : pour l'instant le traceur dans le sol et le flux sont
 !        calcules mais ils ne servent que de diagnostiques
@@ -46,5 +46,5 @@
 !======================================================================
   include "YOMCST.h"
-!
+
 !Entrees
   INTEGER,INTENT(IN)                     :: itr
@@ -205,5 +205,5 @@
              *(zx_ctr(i,1)*(zx_alpha1(i)+zx_alpha2(i)*zx_dtr(i,2)) &
              +zx_alpha2(i)*zx_ctr(i,2))
-        !
+
         zx_b = 1. + rotrhi(i)*masktr(i)*zx_coef(i,1)/RG  &
              * (1.-zx_dtr(i,1)                           &
@@ -211,5 +211,5 @@
              + dtime / tautr                             &
              + dtime * vdeptr / hsoltr
-        ! 
+
         zx_trs(i) = zx_a / zx_b
         local_trs(i) = zx_trs(i)
@@ -247,5 +247,5 @@
 
   ENDDO    ! sur le i=1,klon
-!
+
 !======================================================================
 ! Une fois on a zx_trs, on peut faire l'iteration 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cmp_seri_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cmp_seri_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cmp_seri_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 ! $Id:  ??? $
-!
+
 MODULE cmp_seri_mod
   !======================================================================
   ! to check if the x_seri vaariables have changed
-  !
+
   !======================================================================
 
@@ -16,5 +16,5 @@
   SUBROUTINE init_cmp_seri
     !======================================================================
-    !
+
     !======================================================================
 
@@ -25,5 +25,5 @@
     USE phys_local_var_mod, ONLY: u_seri, v_seri, ql_seri, qs_seri, q_seri, &
          t_seri
-    !
+
     IMPLICIT none
     ! Local :
@@ -32,7 +32,6 @@
     !$OMP THREADPRIVATE(first)
 
-    !
     !======================================================================
-    !
+
     if (first) then
        ALLOCATE(u_prev(klon,klev))
@@ -55,8 +54,8 @@
 
   !======================================================================
-  !
+
   !======================================================================
   SUBROUTINE cmp_seri(iflag,text)
-    !
+
     USE dimphy, ONLY: klon, klev
     USE phys_local_var_mod, ONLY: u_seri, v_seri, ql_seri, qs_seri, q_seri, &
@@ -75,7 +74,7 @@
     logical t_differ, u_differ, v_differ, ql_differ, qs_differ, q_differ
     logical any_differ
-    !
+
     any_differ = .false.
-    !
+
     dt_seri(:,:)=t_seri(:,:)-t_prev(:,:)
     IF (any(t_seri/=t_prev)) then
@@ -87,5 +86,5 @@
        t_differ=.false.
     END IF
-    !
+
     dq_seri(:,:)=q_seri(:,:)-q_prev(:,:)
     IF (any(q_seri/=q_prev)) then
@@ -97,5 +96,5 @@
        q_differ=.false.
     END IF
-    !
+
     dql_seri(:,:)=ql_seri(:,:)-ql_prev(:,:)
     IF (any(ql_seri/=ql_prev)) then
@@ -107,5 +106,5 @@
        ql_differ=.false.
     END IF
-    !
+
     dqs_seri(:,:)=qs_seri(:,:)-qs_prev(:,:)
     IF (any(qs_seri/=qs_prev)) then
@@ -117,5 +116,5 @@
        qs_differ=.false.
     END IF
-    !
+
     du_seri(:,:)=u_seri(:,:)-u_prev(:,:)
     IF (any(u_seri/=u_prev)) then
@@ -127,5 +126,5 @@
        u_differ=.false.
     END IF
-    !
+
     dv_seri(:,:)=v_seri(:,:)-v_prev(:,:)
     IF (any(v_seri/=v_prev)) then
@@ -137,5 +136,5 @@
        v_differ=.false.
     END IF
-    !
+
     if (any_differ) then
        IF (iflag >= 2 .and. prt_level >= 5) then
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90	(revision 5099)
@@ -17,6 +17,6 @@
             PRESA,PRAIN,PPA,PZ0HSEA,LPRECIP, LPWG,coeffs )
 !     #######################################################################
-!
-!
+
+
 !!****  *COARE25_FLUX*
 !!
@@ -25,5 +25,5 @@
 !      Calculate the surface fluxes of heat, moisture, and momentum over
 !      sea surface with bulk algorithm COARE3.0.
-!
+
 !!**  METHOD
 !!    ------
@@ -37,5 +37,5 @@
 !        NGRVWAVES=1 wave age parameterization of Oost et al. 2002
 !        NGRVWAVES=2 model of Taylor and Yelland 2001
-!
+
 !!    EXTERNAL
 !!    --------
@@ -65,11 +65,10 @@
 !!                             add abort if no convergence
 !-------------------------------------------------------------------------------
-!
+
 !*       0.     DECLARATIONS
 !               ------------
-!
-!
+
+
 !USE MODD_SEAFLUX_n, ONLY : SEAFLUX_t
-!
 
 !----------Rajout Olive ---------
@@ -85,29 +84,29 @@
 
 !USE MODD_SURF_ATM,   ONLY : XVZ0CM
-!
+
 !USE MODD_SURF_PAR,   ONLY : XUNDEF, XSURF_EPSILON
 !USE MODD_WATER_PAR
-!
+
 !USE MODI_SURFACE_RI
 !USE MODI_WIND_THRESHOLD
 !USE MODE_COARE30_PSI
-!
+
 !USE MODE_THERMOS
-!
-!
+
+
 !USE MODI_ABOR1_SFX
-!
-!
+
+
 !USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 !USE PARKIND1  ,ONLY : JPRB
-!
+
 IMPLICIT NONE
-!
+
 !*      0.1    declarations of arguments
-!
-!
-!
+
+
+
 !TYPE(SEAFLUX_t), INTENT(INOUT) :: S
-!
+
 REAL, DIMENSION(klon), INTENT(IN)       :: PTA   ! air temperature at atm. level (K)
 REAL, DIMENSION(klon), INTENT(IN)       :: PQA   ! air humidity at atm. level (kg/kg)
@@ -123,12 +122,12 @@
 REAL, DIMENSION(klon), INTENT(IN)       :: PPA        ! air pressure at atm level (Pa)
 REAL, DIMENSION(klon), INTENT(IN)       :: PQSATA        ! air pressure at atm level (Pa)
-!
+
 REAL, DIMENSION(klon), INTENT(INOUT)    :: PZ0SEA! roughness length over the ocean
-!
+
 !  surface fluxes : latent heat, sensible heat, friction fluxes
 REAL, DIMENSION(klon), INTENT(OUT)      :: PSFTH ! heat flux (W/m2)
 REAL, DIMENSION(klon), INTENT(OUT)      :: PSFTQ ! water flux (kg/m2/s)
 REAL, DIMENSION(klon), INTENT(OUT)      :: PUSTAR! friction velocity (m/s)
-!
+
 ! diagnostics
 REAL, DIMENSION(klon), INTENT(OUT)      :: PQSAT ! humidity at saturation
@@ -144,27 +143,26 @@
 LOGICAL,            INTENT(IN)    :: LPWG    !
 real, dimension(3), intent(inout)      :: coeffs
-!
-!
+
 
 !*      0.2    declarations of local variables
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZVMOD    ! wind intensity
 REAL, DIMENSION(SIZE(PTA))      :: ZPA      ! Pressure at atm. level
 REAL, DIMENSION(SIZE(PTA))      :: ZTA      ! Temperature at atm. level
 REAL, DIMENSION(SIZE(PTA))      :: ZQASAT   ! specific humidity at saturation  at atm. level (kg/kg)
-!
+
 !rajout
 REAL, DIMENSION(SIZE(PTA))       :: PEXNA      ! Exner function at atm level
 REAL, DIMENSION(SIZE(PTA))       :: PEXNS      ! Exner function at atm level
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZO       ! rougness length ref
 REAL, DIMENSION(SIZE(PTA))      :: ZWG      ! gustiness factor (m/s)
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZDU,ZDT,ZDQ,ZDUWG !differences
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZUSR        !velocity scaling parameter "ustar" (m/s) = friction velocity
 REAL, DIMENSION(SIZE(PTA))      :: ZTSR        !temperature sacling parameter "tstar" (degC)
 REAL, DIMENSION(SIZE(PTA))      :: ZQSR        !humidity scaling parameter "qstar" (kg/kg)
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZU10,ZT10   !vertical profils (10-m height)
 REAL, DIMENSION(SIZE(PTA))      :: ZVISA       !kinematic viscosity of dry air
@@ -174,8 +172,8 @@
 REAL, DIMENSION(SIZE(PTA))      :: ZRIBU,ZRIBCU
 REAL, DIMENSION(SIZE(PTA))      :: ZETU,ZL10
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZCHARN                      !Charnock number depends on wind module
 REAL, DIMENSION(SIZE(PTA))      :: ZTWAVE,ZHWAVE,ZCWAVE,ZLWAVE !to compute gravity waves' impact
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZZL,ZZTL!,ZZQL    !Obukhovs stability
                                                      !param. z/l for u,T,q
@@ -183,7 +181,7 @@
 REAL, DIMENSION(SIZE(PTA))      :: ZOT,ZOQ           !rougness length ref
 REAL, DIMENSION(SIZE(PTA))      :: ZPUZ,ZPTZ,ZPQZ    !PHI funct. for u,T,q
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZBF               !constants to compute gustiness factor
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZTAU       !momentum flux (W/m2)
 REAL, DIMENSION(SIZE(PTA))      :: ZHF        !sensible heat flux (W/m2)
@@ -193,19 +191,19 @@
 REAL, DIMENSION(SIZE(PTA))      :: ZRF        !sensible heat flux due to rain (W/m2)
 REAL, DIMENSION(SIZE(PTA))      :: ZCHN,ZCEN  !neutral coef. for heat and vapor
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZLV      !latent heat constant
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZTAC,ZDQSDT,ZDTMP,ZDWAT,ZALFAC ! for precipitation impact
 REAL, DIMENSION(SIZE(PTA))      :: ZXLR                           ! vaporisation  heat  at a given temperature
 REAL, DIMENSION(SIZE(PTA))      :: ZCPLW                          ! specific heat for water at a given temperature
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZUSTAR2  ! square of friction velocity
-!
+
 REAL, DIMENSION(SIZE(PTA))      :: ZDIRCOSZW! orography slope cosine (=1 on water!)
 REAL, DIMENSION(SIZE(PTA))      :: ZAC      ! Aerodynamical conductance
-!
-!
+
+
 INTEGER, DIMENSION(SIZE(PTA))   :: ITERMAX             ! maximum number of iterations
-!
+
 REAL    :: ZRVSRDM1,ZRDSRV,ZR2 ! thermodynamic constants
 REAL    :: ZBETAGUST           !gustiness factor
@@ -217,5 +215,5 @@
 REAL    :: QSAT_SEAWATER
 REAL    :: QSATSEAW_1D
-!
+
 INTEGER :: J, JLOOP    !loop indice
 !REAL(KIND=JPRB) :: ZHOOK_HANDLE
@@ -247,14 +245,13 @@
 PEXNS = (PPS/PREF)**(RD/RCPD)
 
-!
 !-------------------------------------------------------------------------------
-!
+
 !       1.     Initializations
 !              ---------------
-!
+
 !       1.1   Constants and parameters
-!
+
 !IF (LHOOK) CALL DR_HOOK('COARE30_FLUX',0,ZHOOK_HANDLE)
-!
+
 ZRVSRDM1  = XRV/XRD-1. ! 0.607766
 ZRDSRV    = XRD/XRV    ! 0.62198
@@ -264,13 +261,13 @@
 ZS        = 10.        ! Standard heigth =10m
 ZCH10     = 0.00115
-!
+
 ZVISW     = 1.E-6
-!
+
 !       1.2   Array initialization by undefined values
-!
+
 PSFTH (:)=XUNDEF
 PSFTQ (:)=XUNDEF
 PUSTAR(:)=XUNDEF
-!
+
 PCD(:) = XUNDEF
 PCDN(:) = XUNDEF
@@ -278,15 +275,15 @@
 PCE(:) =XUNDEF
 PRI(:) = XUNDEF
-!
+
 PRESA(:)=XUNDEF
-!
+
 !-------------------------------------------------------------------------------
 !       2. INITIAL GUESS FOR THE ITERATIVE METHOD
 !          -------------------------------------
-!
+
 !       2.0     Temperature
-!
+
 ! Set a non-zero value for the temperature gradient
-!
+
 WHERE((PTA(:)*PEXNS(:)/PEXNA(:)-PSST(:))==0.)
       ZTA(:)=PTA(:)-1E-3
@@ -296,15 +293,12 @@
 
 !       2.1     Wind and humidity
-!
+
 ! Sea surface specific humidity
-!
+
 !PQSAT(:)=QSAT_SEAWATER(PSST(:),PPS(:))
 PQSAT(:)=QSATSEAW_1D(PSST(:),PPS(:))
 
-
-
-!
 ! Set a minimum value to wind
-!
+
 !ZVMOD(:) = WIND_THRESHOLD(PVMOD(:),PUREF(:))
 
@@ -313,7 +307,6 @@
 !ZVMOD = PVMOD    !set a minimum value to wind
 
-!
 ! Specific humidity at saturation at the atm. level
-!
+
 ZPA(:) = XP00* (PEXNA(:)**(XCPD/XRD))
 !ZQASAT(:) = QSAT_SEAWATER(ZTA(:),ZPA(:))
@@ -321,30 +314,28 @@
 
 
-!
-!
 ZO(:)  = 0.0001
 ZWG(:) = 0.
 IF (LPWG) ZWG(:) = 0.5
-!
+
 ZCHARN(:) = 0.011
-!
+
 DO J=1,SIZE(PTA)
-  !
+
   !      2.2       initial guess
-  !
+
   ZDU(J) = ZVMOD(J)   !wind speed difference with surface current(=0) (m/s)
                       !initial guess for gustiness factor
   ZDT(J) = -(ZTA(J)/PEXNA(J)) + (PSST(J)/PEXNS(J)) !potential temperature difference
   ZDQ(J) = PQSAT(J)-PQA(J)                         !specific humidity difference
-  !
+
   ZDUWG(J) = SQRT(ZDU(J)**2+ZWG(J)**2)     !wind speed difference including gustiness ZWG
-  !
+
   !      2.3   initialization of neutral coefficients
-  !
+
   ZU10(J)  = ZDUWG(J)*LOG(ZS/ZO(J))/LOG(PUREF(J)/ZO(J))
   ZUSR(J)  = 0.035*ZU10(J)
   ZVISA(J) = 1.326E-5*(1.+6.542E-3*(ZTA(J)-XTT)+&
              8.301E-6*(ZTA(J)-XTT)**2-4.84E-9*(ZTA(J)-XTT)**3) !Andrea (1989) CRREL Rep. 89-11
-  !
+
   ZO10(J) = ZCHARN(J)*ZUSR(J)*ZUSR(J)/XG+0.11*ZVISA(J)/ZUSR(J)
   ZCD(J)  = (XKARMAN/LOG(PUREF(J)/ZO10(J)))**2  !drag coefficient
@@ -352,10 +343,10 @@
   ZCT10(J)= ZCH10/SQRT(ZCD10(J))
   ZOT10(J)= ZS/EXP(XKARMAN/ZCT10(J))
-  !
+
   !-------------------------------------------------------------------------------
   !             Grachev and Fairall (JAM, 1997)
   ZCT(J) = XKARMAN/LOG(PZREF(J)/ZOT10(J))      !temperature transfer coefficient
   ZCC(J) = XKARMAN*ZCT(J)/ZCD(J)               !z/L vs Rib linear coef.
-  !
+
   ZRIBCU(J) = -PUREF(J)/(ZZBL*0.004*ZBETAGUST**3) !saturation or plateau Rib
   !ZRIBU(J) =-XG*PUREF(J)*(ZDT(J)+ZRVSRDM1*(ZTA(J)-XTT)*ZDQ)/&
@@ -363,5 +354,5 @@
   ZRIBU(J)  = -XG*PUREF(J)*(ZDT(J)+ZRVSRDM1*ZTA(J)*ZDQ(J))/&
                (ZTA(J)*ZDUWG(J)**2)
-  !
+
   IF (ZRIBU(J)<0.) THEN
     ZETU(J) = ZCC(J)*ZRIBU(J)/(1.+ZRIBU(J)/ZRIBCU(J))    !Unstable G and F
@@ -369,18 +360,18 @@
     ZETU(J) = ZCC(J)*ZRIBU(J)/(1.+27./9.*ZRIBU(J)/ZCC(J))!Stable
   ENDIF
-  !
+
   ZL10(J) = PUREF(J)/ZETU(J) !MO length
-  !
+
 ENDDO
-!
+
 !  First guess M-O stability dependent scaling params. (u*,T*,q*) to estimate ZO and z/L (ZZL)
 ZUSR(:) = ZDUWG(:)*XKARMAN/(LOG(PUREF(:)/ZO10(:))-PSIFCTU(PUREF(1)/ZL10(1)))
 ZTSR(:) = -ZDT(:)*XKARMAN/(LOG(PZREF(:)/ZOT10(:))-PSIFCTT(PZREF(1)/ZL10(1)))
 ZQSR(:) = -ZDQ(:)*XKARMAN/(LOG(PZREF(:)/ZOT10(:))-PSIFCTT(PZREF(1)/ZL10(1)))
-!
+
 ZZL(:) = 0.0
-!
+
 DO J=1,SIZE(PTA)
-  !
+
   IF (ZETU(J)>50.) THEN
     ITERMAX(J) = 1
@@ -388,27 +379,25 @@
     ITERMAX(J) = 3 !number of iterations
   ENDIF
-  !
+
   !then modify Charnork for high wind speeds Chris Fairall's data
   IF (ZDUWG(J)>10.) ZCHARN(J) = 0.011 + (0.018-0.011)*(ZDUWG(J)-10.)/(18.-10.)
   IF (ZDUWG(J)>18.) ZCHARN(J) = 0.018
-  !
+
   !                3.  ITERATIVE LOOP TO COMPUTE USR, TSR, QSR
   !                -------------------------------------------
-  !
+
   ZHWAVE(J) = 0.018*ZVMOD(J)*ZVMOD(J)*(1.+0.015*ZVMOD(J))
   ZTWAVE(J) = 0.729*ZVMOD(J)
   ZCWAVE(J) = XG*ZTWAVE(J)/(2.*XPI)
   ZLWAVE(J) = ZTWAVE(J)*ZCWAVE(J)
-  !
+
 ENDDO
-!
-
-!
+
 DO JLOOP=1,MAXVAL(ITERMAX) ! begin of iterative loop
-  !
+
   DO J=1,SIZE(PTA)
-    !
+
     IF (JLOOP>ITERMAX(J)) CYCLE
-    !
+
     IF (NGRVWAVES==0) THEN
       ZO(J) = ZCHARN(J)*ZUSR(J)*ZUSR(J)/XG + 0.11*ZVISA(J)/ZUSR(J) !Smith 1988
@@ -420,9 +409,9 @@
               + 0.11*ZVISA(J)/ZUSR(J)                       !Taulor and Yelland 2001
     ENDIF
-    !
+
     ZRR(J) = ZO(J)*ZUSR(J)/ZVISA(J)
     ZOQ(J) = MIN(1.15E-4 , 5.5E-5/ZRR(J)**0.6)
     ZOT(J) = ZOQ(J)
-    !
+
     ZZL(J) = XKARMAN * XG * PUREF(J) * &
               ( ZTSR(J)*(1.+ZRVSRDM1*PQA(J)) + ZRVSRDM1*ZTA(J)*ZQSR(J) ) / &
@@ -431,21 +420,21 @@
 !    ZZQL(J)=ZZL(J)*PZREF(J)/PUREF(J)  ! for Q
   ENDDO
-  !
+
   ZPUZ(:) = PSIFCTU(ZZL(1))
   ZPTZ(:) = PSIFCTT(ZZTL(1))
-  !
+
   DO J=1,SIZE(PTA)
-    !
+
     ! ZPQZ(J)=PSIFCTT(ZZQL(J))
     ZPQZ(J) = ZPTZ(J)
-    !
+
     !             3.1 scale parameters
-    !
+
     ZUSR(J) = ZDUWG(J)*XKARMAN/(LOG(PUREF(J)/ZO(J)) -ZPUZ(J))
     ZTSR(J) = -ZDT(J)  *XKARMAN/(LOG(PZREF(J)/ZOT(J))-ZPTZ(J))
     ZQSR(J) = -ZDQ(J)  *XKARMAN/(LOG(PZREF(J)/ZOQ(J))-ZPQZ(J))
-    !
+
     !             3.2 Gustiness factor (ZWG)
-    !
+
     IF(LPWG) THEN
       ZBF(J) = -XG/ZTA(J)*ZUSR(J)*(ZTSR(J)+ZRVSRDM1*ZTA(J)*ZQSR(J))
@@ -457,39 +446,39 @@
     ENDIF
     ZDUWG(J) = SQRT(ZVMOD(J)**2 + ZWG(J)**2)
-    !
+
   ENDDO
-  !
+
 ENDDO
 !-------------------------------------------------------------------------------
-!
+
 !            4.  COMPUTE transfer coefficients PCD, PCH, ZCE and SURFACE FLUXES
 !                --------------------------------------------------------------
-!
+
 ZTAU(:) = XUNDEF
 ZHF(:)  = XUNDEF
 ZEF(:)  = XUNDEF
-!
+
 ZWBAR(:) = 0.
 ZTAUR(:) = 0.
 ZRF(:)   = 0.
-!
+
 DO J=1,SIZE(PTA)
-  !
-  !
+
+
   !            4. transfert coefficients PCD, PCH and PCE
   !                 and neutral PCDN, ZCHN, ZCEN
-  !
+
   PCD(J) = (ZUSR(J)/ZDUWG(J))**2.
   PCH(J) = ZUSR(J)*ZTSR(J)/(ZDUWG(J)*(ZTA(J)*PEXNS(J)/PEXNA(J)-PSST(J)))
   PCE(J) = ZUSR(J)*ZQSR(J)/(ZDUWG(J)*(PQA(J)-PQSAT(J)))
-  !
+
   PCDN(J) = (XKARMAN/LOG(ZS/ZO(J)))**2.
   ZCHN(J) = (XKARMAN/LOG(ZS/ZO(J)))*(XKARMAN/LOG(ZS/ZOT(J)))
   ZCEN(J) = (XKARMAN/LOG(ZS/ZO(J)))*(XKARMAN/LOG(ZS/ZOQ(J)))
-  !
+
   ZLV(J) = XLVTT + (XCPV-XCL)*(PSST(J)-XTT)
-  !
+
   !            4. 2 surface fluxes
-  !
+
   IF (ABS(PCDN(J))>1.E-2) THEN   !!!! secure COARE3.0 CODE
     write(*,*) 'pb PCDN in COARE30: ',PCDN(J)
@@ -505,21 +494,21 @@
     ZHF(J)  =  PRHOA(J)*XCPD*ZUSR(J)*ZTSR(J)
     ZEF(J)  =  PRHOA(J)*ZLV(J)*ZUSR(J)*ZQSR(J)
-    !
+
     !           4.3 Contributions to surface  fluxes due to rainfall
-    !
+
     ! SB: a priori, le facteur ZRDSRV=XRD/XRV est introduit pour
     !     adapter la formule de Clausius-Clapeyron (pour l'air
     !     sec) au cas humide.
     IF (LPRECIP) THEN
-      !
+
       ! heat surface  fluxes
-      !
+
       ZTAC(J)  = ZTA(J)-XTT
-      !
+
       ZXLR(J)  = XLVTT + (XCPV-XCL)* ZTAC(J)                            ! latent heat of rain vaporization
       ZDQSDT(J)= ZQASAT(J) * ZXLR(J) / (XRD*ZTA(J)**2)                  ! Clausius-Clapeyron relation
       ZDTMP(J) = (1.0 + 3.309e-3*ZTAC(J) -1.44e-6*ZTAC(J)*ZTAC(J)) * &  !heat diffusivity
                   0.02411 / (PRHOA(J)*XCPD)
-      !
+
       ZDWAT(J) = 2.11e-5 * (XP00/ZPA(J)) * (ZTA(J)/XTT)**1.94           ! water vapour diffusivity from eq (13.3)
       !                                                                 ! of Pruppacher and Klett (1978)
@@ -531,29 +520,29 @@
                                   (1.2826e-3 + ZTAC(J) * &
                                     (4.7884e-5 - 2.0027e-6* ZTAC(J))))) ! specific heat
-      !
+
       ZRF(J)   = PRAIN(J) * ZCPLW(J) * ZALFAC(J) * &                    !Eq.12 in GoF95 !SIGNE?
                    (PSST(J) - ZTA(J) + (PQSAT(J)-PQA(J))*ZXLR(J)/XCPD )
-      !
+
       ! Momentum flux due to rainfall
-      !
+
       ZTAUR(J)=-0.85*(PRAIN(J) *ZVMOD(J)) !pp3752 in FBR96
-      !
+
     ENDIF
-    !
+
     !             4.4   Webb correction to latent heat flux
-    !
+
     ZWBAR(J)=- (1./ZRDSRV)*ZUSR(J)*ZQSR(J) / (1.0+(1./ZRDSRV)*PQA(J)) &
                - ZUSR(J)*ZTSR(J)/ZTA(J)                        ! Eq.21*rhoa in FBR96
-    !
+
     !             4.5   friction velocity which contains correction du to rain
-    !
+
     ZUSTAR2(J)= - (ZTAU(J) + ZTAUR(J)) / PRHOA(J)
     PUSTAR(J) =  SQRT(ZUSTAR2(J))
-    !
+
     !             4.6   Total surface fluxes
-    !
+
     PSFTH (J) =  ZHF(J) + ZRF(J)
     PSFTQ (J) =  ZEF(J) / ZLV(J)
-    !
+
   ENDIF
 ENDDO
@@ -565,10 +554,10 @@
 
 !-------------------------------------------------------------------------------
-!
+
 !       5.  FINAL STEP : TOTAL SURFACE FLUXES AND DERIVED DIAGNOSTICS
 !           -----------
 !       5.1    Richardson number
-!
-!
+
+
 !------------STOP LA --------------------
 !ZDIRCOSZW(:) = 1.
@@ -580,5 +569,5 @@
 !ZAC(:) = PCH(:)*ZVMOD(:)
 !PRESA(:) = 1. / MAX(ZAC(:),XSURF_EPSILON)
-!
+
 !!       5.3 Z0 and Z0H over sea
 !!
@@ -588,7 +577,7 @@
 !!
 !IF (LHOOK) CALL DR_HOOK('COARE30_FLUX',1,ZHOOK_HANDLE)
-!
+
 !-------------------------------------------------------------------------------
-!
+
 END SUBROUTINE COARE30_FLUX_CNRM
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/coare_cp_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/coare_cp_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coare_cp_mod.F90	(revision 5099)
@@ -60,5 +60,5 @@
   !Oost et al.  zo=50/2/pi L (u*/c)**4.5 if jwave=1
   !taylor and yelland  zo=1200 h*(L/h)**4.5 jwave=2
-  !
+
   USE MODD_CSTS,       ONLY : XKARMAN, XG, XSTEFAN, XRD, XRV, XPI, &
                             XLVTT, XCL, XCPD, XCPV, XRHOLW, XTT, &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/coef_diff_turb_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/coef_diff_turb_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coef_diff_turb_mod.F90	(revision 5099)
@@ -1,15 +1,15 @@
-!
+
 MODULE coef_diff_turb_mod
-!
+
 ! This module contains some procedures for calculation of the coefficients of the
 ! turbulent diffusion in the atmosphere and coefficients for turbulent diffusion 
 ! at surface(cdrag)
-!
+
   IMPLICIT NONE
   
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE coef_diff_turb(dtime, nsrf, knon, ni, &
        ypaprs, ypplay, yu, yv, yq, yt, yts, yqsurf, ycdragm, &
@@ -19,11 +19,11 @@
     USE indice_sol_mod
     USE print_control_mod, ONLY: prt_level, lunout
-!
+
 ! Calculate coefficients(ycoefm, ycoefh) for turbulent diffusion in the 
 ! atmosphere 
 ! NB! No values are calculated between surface and the first model layer. 
 !     ycoefm(:,1) and ycoefh(:,1) are not valid !!!
-!
-!
+
+
 ! Input arguments
 !****************************************************************************************
@@ -75,5 +75,5 @@
 ! Calcul de coefficients de diffusion turbulent de l'atmosphere : 
 ! ycoefm(:,2:klev), ycoefh(:,2:klev) 
-!
+
 !****************************************************************************************    
 
@@ -87,5 +87,5 @@
 ! Eventuelle recalcule des coeffeicients de diffusion turbulent de l'atmosphere : 
 ! ycoefm(:,2:klev), ycoefh(:,2:klev) 
-!
+
 !****************************************************************************************
 
@@ -105,5 +105,5 @@
 !****************************************************************************************  
 ! Calcul d'une diffusion minimale pour les conditions tres stables
-!
+
 !****************************************************************************************
     IF (ok_kzmin) THEN
@@ -123,5 +123,5 @@
 !****************************************************************************************
 ! MELLOR ET YAMADA adapte a Mars Richard Fournier et Frederic Hourdin
-! 
+
 !****************************************************************************************
 
@@ -198,7 +198,7 @@
 
   END SUBROUTINE coef_diff_turb
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE coefkz(nsrf, knon, paprs, pplay, &
        ksta, ksta_ter, &
@@ -227,5 +227,5 @@
 ! t--------input-R- temperature (K)
 ! q--------input-R- vapeur d'eau (kg/kg)
-!
+
 ! pcfm-----output-R- coefficients a calculer (vitesse)
 ! pcfh-----output-R- coefficients a calculer (chaleur et humidite)
@@ -235,7 +235,7 @@
     INCLUDE "FCTTRE.h"
     INCLUDE "compbl.h"
-!
+
 ! Arguments:
-!
+
     INTEGER, INTENT(IN)                      :: knon, nsrf
     REAL, INTENT(IN)                         :: ksta, ksta_ter
@@ -248,11 +248,10 @@
     REAL, DIMENSION(klon,klev), INTENT(OUT)  :: pcfm, pcfh
 
-!
 ! Local variables:
-!
+
     INTEGER, DIMENSION(klon)    :: itop ! numero de couche du sommet de la couche limite
-!
+
 ! Quelques constantes et options:
-!
+
     REAL, PARAMETER :: cepdu2=0.1**2
     REAL, PARAMETER :: CKAP=0.4
@@ -279,5 +278,4 @@
     LOGICAL, PARAMETER :: opt_ec=.FALSE.! formule du Centre Europeen dans l'atmosphere
 
-!
 ! Variables locales:
     INTEGER i, k !IM 120704
@@ -292,5 +290,5 @@
     REAL, PARAMETER :: t_coup=273.15
     LOGICAL, PARAMETER :: check=.FALSE.
-!
+
 ! contre-gradient pour la chaleur sensible: Kelvin/metre
     REAL gamt(2:klev)
@@ -298,5 +296,5 @@
     LOGICAL, SAVE :: appel1er=.TRUE.
     !$OMP THREADPRIVATE(appel1er)
-!
+
 ! Fonctions thermodynamiques et fonctions d'instabilite
     REAL fsta, fins, x
@@ -317,7 +315,7 @@
        ENDIF
     ENDIF
-!
+
 ! Initialiser les sorties
-!
+
     DO k = 1, klev
        DO i = 1, knon
@@ -329,8 +327,7 @@
        itop(i) = 0
     ENDDO
-    
-!
+
 ! Prescrire la valeur de contre-gradient
-!
+
     IF (iflag_pbl==1) THEN
        DO k = 3, klev
@@ -353,7 +350,6 @@
 !IM cf JLD/ GKtest fin
 
-!
 ! Calculer les geopotentiels de chaque couche
-!
+
     DO i = 1, knon
        zgeop(i,1) = RD * t(i,1) / (0.5*(paprs(i,1)+pplay(i,1))) &
@@ -368,7 +364,6 @@
     ENDDO
 
-!
 ! Calculer les coefficients turbulents dans l'atmosphere
-!
+
     DO i = 1, knon
        itop(i) = isommet
@@ -385,7 +380,6 @@
           zq = (q(i,k)+q(i,k-1)) * 0.5
 
-!
 ! Calculer Qs et dQs/dT:
-!
+
           IF (thermcep) THEN
              zdelta = MAX(0.,SIGN(1.,RTT-zt))
@@ -406,7 +400,7 @@
              ENDIF
           ENDIF
-!
+
 !           calculer la fraction nuageuse (processus humide):
-!
+
           if (zq /= 0.) then
              zfr = (zq+ratqs*zq-zqs) / (2.0*ratqs*zq)
@@ -416,7 +410,7 @@
           zfr = MAX(0.0,MIN(1.0,zfr))
           IF (.NOT.richum) zfr = 0.0
-!
+
 !           calculer le nombre de Richardson:
-!
+
           IF (tvirtu) THEN
              ztvd =( t(i,k) &
@@ -445,7 +439,7 @@
                   /(zdu2*0.5*(t(i,k-1)+t(i,k)))
           ENDIF
-!
+
 !           finalement, les coefficients d'echange sont obtenus:
-!
+
           zcdn=SQRT(zdu2) / zmgeom(i) * RG
 
@@ -479,7 +473,6 @@
     ENDDO
 
-!
 ! Au-dela du sommet, pas de diffusion turbulente:
-!
+
     DO i = 1, knon
        IF (itop(i)+1 <= klev) THEN
@@ -492,7 +485,7 @@
       
   END SUBROUTINE coefkz
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE coefkz2(nsrf, knon, paprs, pplay,t, &
        pcfm, pcfh)
@@ -505,5 +498,5 @@
 ! ou une forte inversion est presente
 ! On peut dire qu'il represente la convection peu profonde
-!
+
 ! Arguments:
 ! nsrf-----input-I- indicateur de la nature du sol
@@ -512,11 +505,11 @@
 ! pplay----input-R- pression au milieu de chaque couche (en Pa)
 ! t--------input-R- temperature (K)
-!
+
 ! pcfm-----output-R- coefficients a calculer (vitesse)
 ! pcfh-----output-R- coefficients a calculer (chaleur et humidite)
 !======================================================================
-!
+
 ! Arguments:
-!
+
     INTEGER, INTENT(IN)                       :: knon, nsrf
     REAL, DIMENSION(klon, klev+1), INTENT(IN) ::  paprs
@@ -525,7 +518,7 @@
     
     REAL, DIMENSION(klon, klev), INTENT(OUT)  :: pcfm, pcfh
-!
+
 ! Quelques constantes et options:
-!
+
     REAL, PARAMETER :: prandtl=0.4
     REAL, PARAMETER :: kstable=0.002
@@ -537,7 +530,6 @@
 !    PARAMETER (seuil=-0.09)
 
-!
 ! Variables locales:
-!
+
     INTEGER i, k, invb(knon)
     REAL zl2(knon)
@@ -545,7 +537,7 @@
 
     INCLUDE "YOMCST.h"
-!
+
 ! Initialiser les sorties
-!
+
     DO k = 1, klev
        DO i = 1, knon
@@ -555,7 +547,6 @@
     ENDDO
 
-!
 ! Chercher la zone d'inversion forte
-!
+
     DO i = 1, knon
        invb(i) = klev
@@ -575,7 +566,6 @@
     ENDDO
 
-!
 ! Introduire une diffusion:
-!
+
     IF ( nsrf==is_oce ) THEN
        DO k = 2, klev
@@ -601,6 +591,6 @@
 
   END SUBROUTINE coefkz2
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE coef_diff_turb_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/coefcdrag.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/coefcdrag.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coefcdrag.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
-!
-!
+
+
+
       SUBROUTINE coefcdrag (klon, knon, nsrf, zxli, &
                             speed, t, q, zgeop, psol, &
@@ -15,8 +15,8 @@
 !         du nombre de Richardson entre la surface et le niveau de reference 
 !         (zri1) et de la pression au niveau de reference (pref).    
-!
+
 ! I. Musat, 01.07.2002
 !-------------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -34,5 +34,5 @@
 !                  et zref par rapport au Ri entre la sfce et la 1ere couche
 ! ri1-----input-R- nb. Richardson entre la surface et la 1ere couche
-!
+
 ! cdram--output-R- cdrag pour le moment
 ! cdrah--output-R- cdrag pour les flux de chaleur latente et sensible
@@ -40,5 +40,5 @@
 ! zri1---output-R- nb. Richardson entre la surface et la couche zgeop/RG
 ! pref---output-R- pression au niveau zgeop/RG
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       LOGICAL, intent(in) :: zxli 
@@ -46,8 +46,8 @@
       REAL, dimension(klon), intent(in) :: ts, qsurf, rugos, ri1 
       LOGICAL, intent(in) :: okri    
-!
+
       REAL, dimension(klon), intent(out) :: cdram, cdrah, cdran, zri1, pref
 !-------------------------------------------------------------------------
-!
+
       include "YOMCST.h"
       include "YOETHF.h"
@@ -55,5 +55,5 @@
 ! Quelques constantes :
       REAL, parameter :: RKAR=0.40, CB=5.0, CC=5.0, CD=5.0, cepdu2=(0.1)**2
-!
+
 ! Variables locales :
       INTEGER :: i
@@ -67,8 +67,4 @@
   CHARACTER (LEN=20) :: modname = 'coefcdra'
 
-
-!
-
-
 !-------------------------------------------------------------------------
       REAL :: fsta, fins, x
@@ -80,7 +76,6 @@
   CALL abort_physic(modname,abort_message,1)
 
-!
       DO i = 1, knon
-!
+
        zdphi(i) = zgeop(i)
        zdu2(i) = max(cepdu2,speed(i)**2)
@@ -97,7 +92,7 @@
        ztvd(i) = ztvd(i) * trm1(i)
        zri1(i) = zdphi(i)*(ztvd(i)-ztsolv(i))/(zdu2(i)*ztvd(i))
-!
+
 ! on teste zri1 par rapport au Richardson de la 1ere couche ri1 
-!
+
 !IM +++
        IF(1==0) THEN
@@ -111,14 +106,14 @@
        ENDIF
 !IM ---
-! 
+
        cdran(i) = (RKAR/log(1.+zdphi(i)/(RG*rugos(i))))**2
 
        IF (zri1(i) >= 0.) THEN
-!
+
 ! situation stable : pour eviter les inconsistances dans les cas 
 ! tres stables on limite zri1 a 20. cf Hess et al. (1995)
-!
+
          zri1(i) = min(20.,zri1(i))
-!
+
          IF (.NOT.zxli) THEN
            zscf(i) = SQRT(1.+CD*ABS(zri1(i)))
@@ -135,9 +130,9 @@
            cdrah(i) = cdran(i)* fsta(zri1(i))
          ENDIF
-!
+
        ELSE
-! 
+
 ! situation instable
-!
+
          IF (.NOT.zxli) THEN
            zucf(i) = 1./(1.+3.0*CB*CC*cdran(i)*SQRT(ABS(zri1(i)) &
@@ -152,7 +147,7 @@
            cdrah(i) = cdran(i)* fins(zri1(i))
          ENDIF
-!
+
 ! cdrah sur l'ocean cf. Miller et al. (1992)
-!
+
          zcr(i) = (0.0016/(cdran(i)*SQRT(zdu2(i))))*ABS(ztvd(i)-ztsolv(i)) &
                **(1./3.)
@@ -162,5 +157,5 @@
                   **(1./1.25)
        ENDIF
-!
+
       END DO
       RETURN 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/compbl.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/compbl.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/compbl.h	(revision 5099)
@@ -1,5 +1,5 @@
-      !
+
       ! $Header$
-      !
+
 !jyg+al1<
 !!      integer iflag_pbl,iflag_pbl_split
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/comsoil.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/comsoil.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/comsoil.h	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Header$
-!
 
       common /comsoil/inertie_sol,inertie_sno,inertie_sic,inertie_lic,  &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/concvl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/concvl.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/concvl.F90	(revision 5099)
@@ -149,5 +149,4 @@
   REAL, DIMENSION(klon),        INTENT(OUT)     :: epmax_diag                ! epmax_cape
 
-!
 !  Local
 !  ----
@@ -167,5 +166,5 @@
   REAL, DIMENSION(klon)                         :: supmax0, asupmaxmin
   REAL                                          :: zx_t, zdelta, zx_qs, zcor
-!
+
 !   INTEGER iflag_mix
 !   SAVE iflag_mix
@@ -240,7 +239,7 @@
     ALLOCATE (t1(klon,klev))
     ALLOCATE (q1(klon,klev))
-!
+
     convoccur(:) = 0.
-!
+
     itap = 0
     igout = klon/2 + 1/klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/conema3.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/conema3.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/conema3.h	(revision 5099)
@@ -1,6 +1,6 @@
-!
+
 ! $Header$
 !-- Modified by : Filiberti M-A 06/2005
-!
+
       real epmax             ! 0.993
       real coef_epmax_cape             ! 0.993
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/conf_phys_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/conf_phys_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/conf_phys_m.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id: conf_phys.F90 1668 2012-10-12 10:47:37Z idelkadi $
-!
-!
-!
+
+
+
 MODULE conf_phys_m
 
@@ -48,10 +48,10 @@
     INCLUDE "comsoil.h"
     INCLUDE "YOEGWD.h"
-    !
+
     ! Configuration de la "physique" de LMDZ a l'aide de la fonction
     ! GETIN de IOIPSL
-    !
+
     ! LF 05/2001
-    !
+
     ! type_ocean:      type d'ocean (force, slab, couple)
     ! version_ocean:   version d'ocean (opa8/nemo pour type_ocean=couple ou 
@@ -70,5 +70,4 @@
     ! ok_volcan: activate volcanic diags (SW heat & LW cool rate, SW & LW flux)
     ! flag_volc_surfstrat: VolMIP flag, activate forcing surface cooling rate (=1), strato heating rate (=2) or nothing (=0, default)
-    !
 
     ! Sortie:
@@ -213,5 +212,5 @@
     LOGICAL, SAVE :: ok_lic_melt_omp
     LOGICAL, SAVE :: ok_lic_cond_omp
-    !
+
     REAL, SAVE :: zrel_oro_t_omp, zstd_orodr_t_omp
     REAL, SAVE :: zpmm_orodr_t_omp, zpmm_orolf_t_omp
@@ -264,13 +263,13 @@
     !Config Def  = force
     !Config Help = Type d'ocean utilise: force, slab,couple
-    !
+
     type_ocean_omp = 'force '
     CALL getin('type_ocean', type_ocean_omp)
-    !
+
     !Config Key  = version_ocean 
     !Config Desc = Version d'ocean
     !Config Def  = xxxxxx
     !Config Help = Version d'ocean utilise: opa8/nemo/sicOBS/xxxxxx
-    !
+
     version_ocean_omp = 'xxxxxx'
     CALL getin('version_ocean', version_ocean_omp)
@@ -280,5 +279,5 @@
     !Config Def  = yyyyyy
     !Config Help = This is only for testing purpose
-    !
+
     ocean_omp = 'yyyyyy'
     CALL getin('OCEAN', ocean_omp)
@@ -294,5 +293,5 @@
     !Config Def  = 86400
     !Config Help = This is only for testing purpose
-    !
+
     t_coupl_omp = 86400.
     CALL getin('t_coupl', t_coupl_omp)
@@ -303,32 +302,27 @@
     ENDIF
 
-    !
     !Config Key  = ok_all_xml 
     !Config Desc = utiliser les xml pourles définitions des champs pour xios
     !Config Def  = .FALSE.
     !Config Help = 
-    !
+
     ok_all_xml_omp = .FALSE.
     CALL getin('ok_all_xml', ok_all_xml_omp)
 
-    !
     !Config Key  = ok_lwoff
     !Config Desc = inhiber l effet radiatif LW des nuages
     !Config Def  = .FALSE.
     !Config Help = 
-    !
+
     ok_lwoff_omp = .FALSE.
     CALL getin('ok_lwoff', ok_lwoff_omp)
-    !
-
-    !
+
     !Config Key  = VEGET 
     !Config Desc = Type de modele de vegetation
     !Config Def  = .FALSE.
     !Config Help = Type de modele de vegetation utilise
-    !
+
     type_veget_omp = 'orchidee'
     CALL getin('VEGET', type_veget_omp)
-    !
 
     ! INLANDSIS
@@ -478,8 +472,8 @@
     !Config Help = Pour creer le fichier histday contenant les sorties
     !              journalieres 
-    !
+
     ok_journe_omp = .FALSE.
     CALL getin('OK_journe', ok_journe_omp)
-    !
+
     !Config Key  = ok_hf
     !Config Desc = Pour des sorties haute frequence
@@ -487,8 +481,8 @@
     !Config Help = Pour creer le fichier histhf contenant les sorties
     !              haute frequence ( 3h ou 6h)
-    !
+
     ok_hf_omp = .FALSE.
     CALL getin('ok_hf', ok_hf_omp)
-    !
+
     !Config Key  = OK_mensuel
     !Config Desc = Pour des sorties mensuelles 
@@ -496,8 +490,8 @@
     !Config Help = Pour creer le fichier histmth contenant les sorties
     !              mensuelles 
-    !
+
     ok_mensuel_omp = .TRUE.
     CALL getin('OK_mensuel', ok_mensuel_omp)
-    !
+
     !Config Key  = OK_instan
     !Config Desc = Pour des sorties instantanees 
@@ -505,13 +499,13 @@
     !Config Help = Pour creer le fichier histins contenant les sorties
     !              instantanees 
-    !
+
     ok_instan_omp = .FALSE.
     CALL getin('OK_instan', ok_instan_omp)
-    !
+
     !Config Key  = ok_ade
     !Config Desc = Aerosol direct effect or not?
     !Config Def  = .FALSE.
     !Config Help = Used in radlwsw.F
-    !
+
     ok_ade_omp = .FALSE.
     CALL getin('ok_ade', ok_ade_omp)
@@ -521,36 +515,32 @@
     !Config Def  = .FALSE.
     !Config Help = Used in radlwsw.F
-    !
+
     ok_alw_omp = .FALSE.
     CALL getin('ok_alw', ok_alw_omp)
 
-    !
     !Config Key  = ok_aie
     !Config Desc = Aerosol indirect effect or not?
     !Config Def  = .FALSE.
     !Config Help = Used in nuage.F and radlwsw.F
-    !
+
     ok_aie_omp = .FALSE.
     CALL getin('ok_aie', ok_aie_omp)
 
-    !
     !Config Key  = ok_cdnc
     !Config Desc = ok cloud droplet number concentration
     !Config Def  = .FALSE.
     !Config Help = Used in newmicro.F
-    !
+
     ok_cdnc_omp = .FALSE.
     CALL getin('ok_cdnc', ok_cdnc_omp)
 
-    !
     !Config Key  = ok_volcan
     !Config Desc = ok to generate volcanic diags
     !Config Def  = .FALSE.
     !Config Help = Used in radlwsw_m.F
-    !
+
     ok_volcan_omp = .FALSE.
     CALL getin('ok_volcan', ok_volcan_omp)
 
-    !
     !Config Key  = flag_volc_surfstrat
     !Config Desc = impose cooling rate at the surface (=1),
@@ -558,30 +548,29 @@
     !Config Def  = 0
     !Config Help = Used in radlwsw_m.F
-    !
+
     flag_volc_surfstrat_omp = 0 ! NL: SURFSTRAT
     CALL getin('flag_volc_surfstrat', flag_volc_surfstrat_omp)
 
-    !
     !Config Key  = aerosol_couple
     !Config Desc = read aerosol in file or calcul by inca
     !Config Def  = .FALSE.
     !Config Help = Used in physiq.F
-    !
+
     aerosol_couple_omp = .FALSE.
     CALL getin('aerosol_couple', aerosol_couple_omp)
-    !
+
     !Config Key  = chemistry_couple
     !Config Desc = read O3 chemistry in file or calcul by inca
     !Config Def  = .FALSE.
     !Config Help = Used in physiq.F
-    !
+
     chemistry_couple_omp = .FALSE.
     CALL getin('chemistry_couple', chemistry_couple_omp)
-    !
+
     !Config Key  = flag_aerosol
     !Config Desc = which aerosol is use for coupled model
     !Config Def  = 1
     !Config Help = Used in physiq.F
-    !
+
     ! - flag_aerosol=0 => no aerosol
     ! - flag_aerosol=1 => so4 only (defaut) 
@@ -597,5 +586,4 @@
     CALL getin('flag_aerosol', flag_aerosol_omp)
 
-    !
     !Config Key  = flag_bc_internal_mixture
     !Config Desc = state of mixture for BC aerosols
@@ -604,23 +592,21 @@
     !Config Def  = n
     !Config Help = Used in physiq.F / aeropt
-    !
+
     flag_bc_internal_mixture_omp = .FALSE.
     CALL getin('flag_bc_internal_mixture', flag_bc_internal_mixture_omp)
 
-    ! 
     !Config Key  = aer_type 
     !Config Desc = Use a constant field for the aerosols 
     !Config Def  = scenario 
     !Config Help = Used in readaerosol.F90 
-    ! 
+
     aer_type_omp = 'scenario'
     CALL getin('aer_type', aer_type_omp)
 
-    !
     !Config Key  = bl95_b0
     !Config Desc = Parameter in CDNC-maer link (Boucher&Lohmann 1995)
     !Config Def  = .FALSE.
     !Config Help = Used in nuage.F
-    !
+
     bl95_b0_omp = 2.
     CALL getin('bl95_b0', bl95_b0_omp)
@@ -630,5 +616,5 @@
     !Config Def  = .FALSE.
     !Config Help = Used in nuage.F
-    !
+
     bl95_b1_omp = 0.2
     CALL getin('bl95_b1', bl95_b1_omp)
@@ -639,8 +625,8 @@
     !Config Def  = 10800.
     !Config Help = Used in ini_histISCCP.h
-    !
+
     freq_ISCCP_omp = 10800.
     CALL getin('freq_ISCCP', freq_ISCCP_omp)
-    !
+
     !Config Key  = ecrit_ISCCP
     !Config Desc = Frequence d'ecriture des resultats du simulateur ISCCP en nombre de jours;
@@ -648,6 +634,6 @@
     !Config Def  = 1.
     !Config Help = Used in ini_histISCCP.h
-    !
-    !
+
+
     ecrit_ISCCP_omp = 1.
     CALL getin('ecrit_ISCCP', ecrit_ISCCP_omp)
@@ -658,5 +644,5 @@
     !Config Def  = 10800.
     !Config Help = Used in ini_histdayCOSP.h
-    !
+
     freq_COSP_omp = 10800.
     CALL getin('freq_COSP', freq_COSP_omp)
@@ -667,14 +653,13 @@
     !Config Def  = 10800.
     !Config Help = Used in ini_histdayAIRS.h
-    !
+
     freq_AIRS_omp = 10800.
     CALL getin('freq_AIRS', freq_AIRS_omp)
 
-    !
     !Config Key  = ip_ebil_phy
     !Config Desc = Niveau de sortie pour les diags bilan d'energie 
     !Config Def  = 0
     !Config Help = 
-    !               
+
     ip_ebil_phy_omp = 0
     CALL getin('ip_ebil_phy', ip_ebil_phy_omp)
@@ -683,69 +668,66 @@
     ENDIF
 
-    !
     !Config Key  = seuil_inversion
     !Config Desc = Seuil ur dTh pour le choix entre les schemas de CL
     !Config Def  = -0.1
     !Config Help = 
-    !               
+
     seuil_inversion_omp = -0.1
     CALL getin('seuil_inversion', seuil_inversion_omp)
 
-    !
     ! Constante solaire & Parametres orbitaux & taux gaz effet de serre BEG
-    !
+
     !Config Key  = R_ecc
     !Config Desc = Excentricite
     !Config Def  = 0.016715
     !Config Help = 
-    !               
+
     !valeur AMIP II
     R_ecc_omp = 0.016715
     CALL getin('R_ecc', R_ecc_omp)
-    !
+
     !Config Key  = R_peri
     !Config Desc = Equinoxe
     !Config Def  = 
     !Config Help = 
-    !               
-    !
+
+
     !valeur AMIP II
     R_peri_omp = 102.7
     CALL getin('R_peri', R_peri_omp)
-    !
+
     !Config Key  = R_incl
     !Config Desc = Inclinaison
     !Config Def  = 
     !Config Help = 
-    !               
-    !
+
+
     !valeur AMIP II
     R_incl_omp = 23.441
     CALL getin('R_incl', R_incl_omp)
-    !
+
     !Config Key  = solaire
     !Config Desc = Constante solaire en W/m2
     !Config Def  = 1365.
     !Config Help = 
-    !               
-    !
+
+
     !valeur AMIP II
     solaire_omp = 1365.
     solaire_omp_init = solaire_omp     !--we keep track of the default value
     CALL getin('solaire', solaire_omp)
-    !
+
     !Config Key  = co2_ppm
     !Config Desc = concentration du CO2 en ppmv
     !Config Def  = 348.
     !Config Help = 
-    !               
+
     !valeur AMIP II
     co2_ppm_omp = 348.
     CALL getin('co2_ppm', co2_ppm_omp)
-    !
+
     !conversion en rapport de mélange massique
     RCO2_omp = co2_ppm_omp * 1.0e-06 * RMCO2 / RMD
 
-    !
     !Config Key  = co2_ppm0
     !Config Desc = concentration initiale du CO2 en ppmv pour la version ESM avec CO2 interactif dans le cas 
@@ -753,43 +735,43 @@
     !Config Def  = 284.32
     !Config Help = 
-    !               
+
     co2_ppm0_omp = 284.32
     CALL getin('co2_ppm0', co2_ppm0_omp)
-    !
+
     !Config Key  = RCH4
     !Config Desc = Concentration du CH4
     !Config Def  = 1.65E-06* 16.043/28.97
     !Config Help = 
-    !               
+
     CH4_ppb_omp = 1650.
     CALL getin('CH4_ppb', CH4_ppb_omp)
     !conversion en rapport de mélange massique
     RCH4_omp = CH4_ppb_omp * 1.0E-09 * RMCH4 / RMD
-    !
+
     !Config Key  = RN2O
     !Config Desc = Concentration du N2O
     !Config Def  = 306.E-09* 44.013/28.97
     !Config Help = 
-    !               
+
     N2O_ppb_omp = 306.
     CALL getin('N2O_ppb', N2O_ppb_omp)
     !conversion en rapport de mélange massique
     RN2O_omp = N2O_ppb_omp * 1.0E-09 * RMN2O / RMD
-    !
+
     !Config Key  = RCFC11
     !Config Desc = Concentration du CFC11
     !Config Def  = 280.E-12* 137.3686/28.97
     !Config Help = 
-    !               
+
     CFC11_ppt_omp = 280.
     CALL getin('CFC11_ppt', CFC11_ppt_omp)
     !conversion en rapport de mélange massique
     RCFC11_omp = CFC11_ppt_omp * 1.0E-12 * RMCFC11 / RMD
-    !
+
     !Config Key  = RCFC12
     !Config Desc = Concentration du CFC12
     !Config Def  = 484.E-12* 120.9140/28.97
     !Config Help = 
-    !               
+
     CFC12_ppt_omp = 484.
     CALL getin('CFC12_ppt', CFC12_ppt_omp)
@@ -797,10 +779,9 @@
     RCFC12_omp = CFC12_ppt_omp * 1.0E-12 * RMCFC12 / RMD
 
-    !
     !Config Key  = co2_ppm_per
     !Config Desc = concentration du CO2 perturbé en ppmv (CFMIP)
     !Config Def  = 348.
     !Config Help = 
-    !               
+
     co2_ppm_per_omp = co2_ppm_omp
     CALL getin('co2_ppm_per', co2_ppm_per_omp)
@@ -812,35 +793,35 @@
     !Config Def  = 1.65E-06* 16.043/28.97
     !Config Help = 
-    !               
+
     CH4_ppb_per_omp = CH4_ppb_omp
     CALL getin('CH4_ppb_per', CH4_ppb_per_omp)
     !conversion en rapport de mélange massique
     RCH4_per_omp = CH4_ppb_per_omp * 1.0E-09 * RMCH4 / RMD
-    !
+
     !Config Key  = RN2O_per
     !Config Desc = Concentration du N2O_per
     !Config Def  = 306.E-09* 44.013/28.97
     !Config Help = 
-    !               
+
     N2O_ppb_per_omp = N2O_ppb_omp
     CALL getin('N2O_ppb_per', N2O_ppb_per_omp)
     !conversion en rapport de mélange massique
     RN2O_per_omp = N2O_ppb_per_omp * 1.0E-09 * RMN2O / RMD
-    !
+
     !Config Key  = RCFC11_per
     !Config Desc = Concentration du CFC11_per
     !Config Def  = 280.E-12* 137.3686/28.97
     !Config Help = 
-    !               
+
     CFC11_ppt_per_omp = CFC11_ppt_omp
     CALL getin('CFC11_ppt_per', CFC11_ppt_per_omp)
     !conversion en rapport de mélange massique
     RCFC11_per_omp = CFC11_ppt_per_omp * 1.0E-12 * RMCFC11 / RMD
-    !
+
     !Config Key  = RCFC12_per
     !Config Desc = Concentration du CFC12_per
     !Config Def  = 484.E-12* 120.9140/28.97
     !Config Help = 
-    !               
+
     CFC12_ppt_per_omp = CFC12_ppt_omp
     CALL getin('CFC12_ppt_per', CFC12_ppt_per_omp)
@@ -848,5 +829,4 @@
     RCFC12_per_omp = CFC12_ppt_per_omp * 1.0E-12 * RMCFC12 / RMD
 
-    !
     ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique
     ! Constantes precedemment dans dyn3d/conf_gcm
@@ -1011,11 +991,9 @@
     CALL getin('ok_conserv_q', ok_conserv_q_omp)
 
-    !
-    !
-    !
+
+
     ! Constante solaire & Parametres orbitaux & taux gaz effet de serre END
-    !
+
     ! KE
-    !
 
     !Config key  = cvl_comp_threshold
@@ -1047,5 +1025,5 @@
     !Config Def  = 0.993
     !Config Help = 
-    !
+
     epmax_omp = .993
     CALL getin('epmax', epmax_omp)
@@ -1053,18 +1031,18 @@
     coef_epmax_cape_omp = 0.0
     CALL getin('coef_epmax_cape', coef_epmax_cape_omp)
-    !
+
     !Config Key  = ok_adj_ema
     !Config Desc =  
     !Config Def  = FALSE
     !Config Help = 
-    !
+
     ok_adj_ema_omp = .FALSE.
     CALL getin('ok_adj_ema', ok_adj_ema_omp)
-    !
+
     !Config Key  = iflag_clw
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_clw_omp = 0
     CALL getin('iflag_clw', iflag_clw_omp)
@@ -1075,32 +1053,29 @@
     !Config Def  = 1
     !Config Help =
-    !
+
     iflag_ratqs_omp = 1
     CALL getin('iflag_ratqs', iflag_ratqs_omp)
 
-    !
     !Config Key  = iflag_radia 
     !Config Desc =  
     !Config Def  = 1
     !Config Help = 
-    !
+
     iflag_radia_omp = 1
     CALL getin('iflag_radia', iflag_radia_omp)
 
-    !
     !Config Key  = iflag_rrtm 
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_rrtm_omp = 0
     CALL getin('iflag_rrtm', iflag_rrtm_omp)
 
-    !
     !Config Key  = NSW 
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     NSW_omp = 2
     CALL getin('NSW', NSW_omp)
@@ -1112,11 +1087,11 @@
     CALL getin('ok_chlorophyll', ok_chlorophyll_omp)
     !albedo SB <<<
-    !
+
     !Config Key  = ok_sun_time
     !Config Desc = oui ou non variabilite solaire
     !Config Def  = .FALSE.
     !Config Help =
-    !
-    !
+
+
     !valeur AMIP II
     ok_suntime_rrtm_omp = .FALSE.
@@ -1133,5 +1108,5 @@
     !Config Def  = 0
     !Config Help = Used in physiq.F
-    !
+
     flag_aerosol_strat_omp = 0
     CALL getin('flag_aerosol_strat', flag_aerosol_strat_omp)
@@ -1143,5 +1118,5 @@
     !Config Def  = T
     !Config Help = Used in physiq.F
-    !
+
     flag_aer_feedback_omp = .TRUE.
     IF (iflag_rrtm_omp==1) THEN
@@ -1153,5 +1128,5 @@
     !Config Def  = 1
     !Config Help = 
-    !
+
     iflag_cld_th_omp = 1
     ! On lit deux fois avec l'ancien et le nouveau nom 
@@ -1163,65 +1138,57 @@
     CALL getin('iflag_cld_cv', iflag_cld_cv_omp)
 
-    !
     !Config Key  = tau_cld_cv
     !Config Desc =
     !Config Def  = 10.
     !Config Help =
-    !
+
     tau_cld_cv_omp = 10.
     CALL getin('tau_cld_cv', tau_cld_cv_omp)
 
-    !
     !Config Key  = coefw_cld_cv
     !Config Desc =
     !Config Def  = 0.1
     !Config Help =
-    !
+
     coefw_cld_cv_omp = 0.1
     CALL getin('coefw_cld_cv', coefw_cld_cv_omp)
 
-
-
-
-    !
     !Config Key  = fact_cldcon
     !Config Desc =  
     !Config Def  = 0.375
     !Config Help = 
-    !
+
     fact_cldcon_omp = 0.375
     CALL getin('fact_cldcon', fact_cldcon_omp)
 
-    !
     !Config Key  = facttemps
     !Config Desc =  
     !Config Def  = 1.e-4
     !Config Help = 
-    !
+
     facttemps_omp = 1.e-4
     CALL getin('facttemps', facttemps_omp)
 
-    !
     !Config Key  = ok_newmicro
     !Config Desc =  
     !Config Def  = .TRUE.
     !Config Help = 
-    !
+
     ok_newmicro_omp = .TRUE.
     CALL getin('ok_newmicro', ok_newmicro_omp)
-    !
+
     !Config Key  = ratqsbas
     !Config Desc =  
     !Config Def  = 0.01
     !Config Help = 
-    !
+
     ratqsbas_omp = 0.01
     CALL getin('ratqsbas', ratqsbas_omp)
-    !
+
     !Config Key  = ratqshaut
     !Config Desc =  
     !Config Def  = 0.3
     !Config Help = 
-    !
+
     ratqshaut_omp = 0.3
     CALL getin('ratqshaut', ratqshaut_omp)
@@ -1231,9 +1198,8 @@
     !Config Def  = 1800.
     !Config Help = 
-    !
+
     tau_ratqs_omp = 1800.
     CALL getin('tau_ratqs', tau_ratqs_omp)
 
-    !
     !-----------------------------------------------------------------------
     ! Longitude solaire pour le calcul de l'ensoleillement en degre
@@ -1243,8 +1209,8 @@
     !Config Def  = -999.999 
     !Config Help = 
-    !
+
     solarlong0_omp = -999.999
     CALL getin('solarlong0', solarlong0_omp)
-    !
+
     !-----------------------------------------------------------------------
     !  Valeur imposee pour configuration idealisees
@@ -1257,98 +1223,92 @@
     albsno0_omp = -1.
     CALL getin('albsno0', albsno0_omp)
-    !
+
     !-----------------------------------------------------------------------
-    !
+
     !Config Key  = iflag_sic
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_sic_omp = 0
     CALL getin('iflag_sic', iflag_sic_omp)
-    !
+
     !Config Key  = iflag_inertie
     !Config Desc =
     !Config Def  = 0
     !Config Help =
-    !
+
     iflag_inertie_omp = 0
     CALL getin('iflag_inertie', iflag_inertie_omp)
-    !
+
     !Config Key  = inertie_sic
     !Config Desc =  
     !Config Def  = 2000.
     !Config Help = 
-    !
+
     inertie_sic_omp = 2000.
     CALL getin('inertie_sic', inertie_sic_omp)
-    !
+
     !Config Key  = inertie_lic
     !Config Desc =  
     !Config Def  = 2000.
     !Config Help = 
-    !
+
     inertie_lic_omp = 2000.
     CALL getin('inertie_lic', inertie_lic_omp)
-    !
+
     !Config Key  = inertie_sno
     !Config Desc =  
     !Config Def  = 2000.
     !Config Help = 
-    !
+
     inertie_sno_omp = 2000.
     CALL getin('inertie_sno', inertie_sno_omp)
-    !
+
     !Config Key  = inertie_sol
     !Config Desc =  
     !Config Def  = 2000.
     !Config Help = 
-    !
+
     inertie_sol_omp = 2000.
     CALL getin('inertie_sol', inertie_sol_omp)
 
-    !
     !Config Key  = rad_froid
     !Config Desc =  
     !Config Def  = 35.0
     !Config Help = 
-    !
+
     rad_froid_omp = 35.0
     CALL getin('rad_froid', rad_froid_omp)
 
-    !
     !Config Key  = rad_chau1
     !Config Desc =  
     !Config Def  = 13.0
     !Config Help = 
-    !
+
     rad_chau1_omp = 13.0
     CALL getin('rad_chau1', rad_chau1_omp)
 
-    !
     !Config Key  = rad_chau2
     !Config Desc =  
     !Config Def  = 9.0
     !Config Help = 
-    !
+
     rad_chau2_omp = 9.0
     CALL getin('rad_chau2', rad_chau2_omp)
 
-
-    !
     !Config Key  = iflag_ice_thermo
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_ice_thermo_omp = 0
     CALL getin('iflag_ice_thermo', iflag_ice_thermo_omp)
 
-    !
     !Config Key  = ok_ice_sursat
     !Config Desc =
     !Config Def  = 0
     !Config Help =
-    !
+
     ok_ice_sursat_omp = .FALSE.
     CALL getin('ok_ice_sursat', ok_ice_sursat_omp)
@@ -1358,5 +1318,5 @@
     !Config Def  = 0
     !Config Help =
-    !
+
     ok_plane_h2o_omp = .FALSE.
     CALL getin('ok_plane_h2o', ok_plane_h2o_omp)
@@ -1366,60 +1326,55 @@
     !Config Def  = 0
     !Config Help =
-    !
+
     ok_plane_contrail_omp = .FALSE.
     CALL getin('ok_plane_contrail', ok_plane_contrail_omp)
 
-    !
     !Config Key  = top_height
     !Config Desc =
     !Config Def  = 3
     !Config Help =
-    !
+
     top_height_omp = 3
     CALL getin('top_height', top_height_omp)
 
-    !
     !Config Key  = overlap
     !Config Desc =
     !Config Def  = 3
     !Config Help =
-    !
+
     overlap_omp = 3
     CALL getin('overlap', overlap_omp)
 
-    !
     !Config Key  = cdmmax
     !Config Desc =
     !Config Def  = 1.3E-3
     !Config Help =
-    !
+
     cdmmax_omp = 1.3E-3
     CALL getin('cdmmax', cdmmax_omp)
 
-    !
     !Config Key  = cdhmax
     !Config Desc =
     !Config Def  = 1.1E-3
     !Config Help =
-    !
+
     cdhmax_omp = 1.1E-3
     CALL getin('cdhmax', cdhmax_omp)
 
     !261103
-    !
+
     !Config Key  = ksta
     !Config Desc =
     !Config Def  = 1.0e-10
     !Config Help =
-    !
+
     ksta_omp = 1.0e-10
     CALL getin('ksta', ksta_omp)
 
-    !
     !Config Key  = ksta_ter
     !Config Desc =
     !Config Def  = 1.0e-10
     !Config Help =
-    !
+
     ksta_ter_omp = 1.0e-10
     CALL getin('ksta_ter', ksta_ter_omp)
@@ -1429,32 +1384,29 @@
     !Config Def  = 0.1
     !Config Help =
-    !
+
     f_ri_cd_min_omp = 0.1
     CALL getin('f_ri_cd_min', f_ri_cd_min_omp)
 
-    !
     !Config Key  = ok_kzmin
     !Config Desc =
     !Config Def  = .TRUE.
     !Config Help =
-    !
+
     ok_kzmin_omp = .TRUE.
     CALL getin('ok_kzmin', ok_kzmin_omp)
 
-    !
     !Config Key  = fmagic
     !Config Desc = additionnal multiplicator factor used for albedo
     !Config Def  = 1.
     !Config Help = additionnal multiplicator factor used in albedo.F
-    !
+
     fmagic_omp = 1.
     CALL getin('fmagic', fmagic_omp)
 
-    !
     !Config Key  = pmagic
     !Config Desc = additional factor used for albedo
     !Config Def  = 0.
     !Config Help = additional factor used in albedo.F
-    !
+
     pmagic_omp = 0.
     CALL getin('pmagic', pmagic_omp)
@@ -1476,7 +1428,5 @@
     CALL getin('ok_lic_cond', ok_lic_cond_omp)
 
-    !
     ! PARAMETER FOR THE PLANETARY BOUNDARY LAYER
-    !
 
     !Config Key  = iflag_pbl
@@ -1484,5 +1434,5 @@
     !Config Def  = 1
     !Config Help =
-    !
+
     iflag_pbl_omp = 1
     CALL getin('iflag_pbl', iflag_pbl_omp)
@@ -1496,5 +1446,5 @@
     !Config Def  = 0
     !Config Help =
-    !
+
     ifl_pbltree_omp = 0
     CALL getin('ifl_pbltree', ifl_pbltree_omp)
@@ -1504,41 +1454,40 @@
     !Config Def  = 7.5E-02 (valeur Masson mais fait planter avec des LAI eleves)
     !Config Help =
-    !
+
     Cd_frein_omp = 7.5E-02
     CALL getin('Cd_frein', Cd_frein_omp)
 
-    !
     !Config Key  = iflag_pbl_split
     !Config Desc = decimal flag: least signif digit = split vdf; next digit = split thermals
     !Config Def  = 0
     !Config Help = 0-> no splitting; 1-> vdf splitting; 10-> thermals splitting; 11-> full splitting
-    !
+
     iflag_pbl_split_omp = 0
     call getin('iflag_pbl_split', iflag_pbl_split_omp)
-    !
+
     !Config Key  = iflag_order2_sollw
     !Config Desc =
     !Config Def  = 0
     !Config Help =
-    !
+
     iflag_order2_sollw_omp = 0
     CALL getin('iflag_order2_sollw', iflag_order2_sollw_omp)
-    !
+
     !Config Key  = iflag_thermals
     !Config Desc =
     !Config Def  = 0
     !Config Help =
-    !
+
     iflag_thermals_omp = 0
     CALL getin('iflag_thermals', iflag_thermals_omp)
-    !
+
     !Config Key  = nsplit_thermals
     !Config Desc =
     !Config Def  = 0
     !Config Help =
-    !
+
     nsplit_thermals_omp = 1
     CALL getin('nsplit_thermals', nsplit_thermals_omp)
-    !
+
     !Config Key  = nsplit_thermals
     !Config Desc =
@@ -1554,5 +1503,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_trig_bl_omp = 0
     CALL getin('iflag_trig_bl', iflag_trig_bl_omp)
@@ -1562,5 +1511,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_strig_omp = 0
     CALL getin('iflag_strig', iflag_strig_omp)
@@ -1570,5 +1519,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     s_trig_omp = 2e7
     CALL getin('s_trig', s_trig_omp)
@@ -1578,5 +1527,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     h_trig_omp = 6000.
     CALL getin('h_trig', h_trig_omp)
@@ -1586,5 +1535,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     tau_trig_shallow_omp = 600
     CALL getin('tau_trig_shallow', tau_trig_shallow_omp)
@@ -1594,5 +1543,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     tau_trig_deep_omp = 1800
     CALL getin('tau_trig_deep', tau_trig_deep_omp)
@@ -1602,5 +1551,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_clos_bl_omp = 0
     CALL getin('iflag_clos_bl', iflag_clos_bl_omp)
@@ -1608,45 +1557,41 @@
     ! fin nrlmd le 10/04/2012
 
-    !
     !Config Key  = tau_thermals
     !Config Desc =
     !Config Def  = 0.
     !Config Help =
-    !
+
     tau_thermals_omp = 0.
     CALL getin('tau_thermals', tau_thermals_omp)
 
-    !
     !Config Key  = iflag_coupl
     !Config Desc =
     !Config Def  = 0
     !Config Help =
-    !
+
     iflag_coupl_omp = 0
     CALL getin('iflag_coupl', iflag_coupl_omp)
 
-    !
     !Config Key  = iflag_clos
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_clos_omp = 1
     CALL getin('iflag_clos', iflag_clos_omp)
-    !
+
     !Config Key  = coef_clos_ls
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     coef_clos_ls_omp = 0.
     CALL getin('coef_clos_ls', coef_clos_ls_omp)
 
-    !
     !Config Key  = iflag_cvl_sigd
     !Config Desc =  
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_cvl_sigd_omp = 0
     CALL getin('iflag_cvl_sigd', iflag_cvl_sigd_omp)
@@ -1656,5 +1601,5 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     iflag_wake_omp = 0
     CALL getin('iflag_wake', iflag_wake_omp)
@@ -1664,69 +1609,66 @@
     !Config Def  = 0
     !Config Help = 
-    !
+
     alp_offset_omp = 0.
     CALL getin('alp_offset', alp_offset_omp)
 
-    !
     !Config Key  = lev_histhf
     !Config Desc =
     !Config Def  = 1
     !Config Help =
-    !
+
     lev_histhf_omp = 1
     CALL getin('lev_histhf', lev_histhf_omp)
 
-    !
     !Config Key  = lev_histday
     !Config Desc =
     !Config Def  = 1
     !Config Help =
-    !
+
     lev_histday_omp = 1
     CALL getin('lev_histday', lev_histday_omp)
 
-    !
     !Config Key  = lev_histmth
     !Config Desc =
     !Config Def  = 2
     !Config Help =
-    !
+
     lev_histmth_omp = 2
     CALL getin('lev_histmth', lev_histmth_omp)
-    !
+
     !Config Key  = lev_histins
     !Config Desc =
     !Config Def  = 1
     !Config Help =
-    !
+
     lev_histins_omp = 1
     CALL getin('lev_histins', lev_histins_omp)
-    !
+
     !Config Key  = lev_histLES
     !Config Desc =
     !Config Def  = 1
     !Config Help =
-    !
+
     lev_histLES_omp = 1
     CALL getin('lev_histLES', lev_histLES_omp)
-    ! 
+
     !Config Key  = lev_histdayNMC
     !Config Desc =
     !Config Def  = 8
     !Config Help =
-    !
+
     lev_histdayNMC_omp = 8
     CALL getin('lev_histdayNMC', lev_histdayNMC_omp)
-    !
+
     !Config Key  = levout_histNMC
     !Config Desc =
     !Config Def  = 5
     !Config Help =
-    !
+
     levout_histNMC_omp(1) = 5
     levout_histNMC_omp(2) = 5
     levout_histNMC_omp(3) = 5
     CALL getin('levout_histNMC', levout_histNMC_omp)
-    !
+
     !histNMC BEG
     !Config Key  = ok_histNMC
@@ -1736,10 +1678,10 @@
     !Config Def  = n, n, n
     !Config Help =
-    !
+
     ok_histNMC_omp(1) = .FALSE.
     ok_histNMC_omp(2) = .FALSE.
     ok_histNMC_omp(3) = .FALSE.
     CALL getin('ok_histNMC', ok_histNMC_omp)
-    !
+
     !Config Key  = freq_outNMC
     !Config Desc = freq_outNMC(1) = frequence de sortie fichiers histmthNMC
@@ -1748,10 +1690,10 @@
     !Config Def  = 2592000., 86400., 21600. (1mois, 1jour, 6h) 
     !Config Help =
-    !
+
     freq_outNMC_omp(1) = mth_len
     freq_outNMC_omp(2) = 1.
     freq_outNMC_omp(3) = 1. / 4.
     CALL getin('freq_outNMC', freq_outNMC_omp)
-    !
+
     !Config Key  = freq_calNMC
     !Config Desc = freq_calNMC(1) = frequence de calcul fichiers histmthNMC
@@ -1760,183 +1702,176 @@
     !Config Def  = phys_tstep
     !Config Help =
-    !
+
     freq_calNMC_omp(1) = phys_tstep
     freq_calNMC_omp(2) = phys_tstep
     freq_calNMC_omp(3) = phys_tstep
     CALL getin('freq_calNMC', freq_calNMC_omp)
-    !
+
     !Config Key  = type_run
     !Config Desc =
     !Config Def  = 'AMIP'/'CFMIP'  ou 'CLIM'/'ENSP'
     !Config Help =
-    !
+
     type_run_omp = 'AMIP'
     CALL getin('type_run', type_run_omp)
 
-    !
     !Config Key  = ok_cosp
     !Config Desc =
     !Config Def  = .FALSE.
     !Config Help =
-    !
+
     ok_cosp_omp = .FALSE.
     CALL getin('ok_cosp', ok_cosp_omp)
 
-    !
     !Config Key  = ok_airs
     !Config Desc =
     !Config Def  = .FALSE.
     !Config Help =
-    !
+
     ok_airs_omp = .FALSE.
     CALL getin('ok_airs', ok_airs_omp)
 
-    !
     !Config Key  = ok_mensuelCOSP
     !Config Desc =
     !Config Def  = .TRUE.
     !Config Help =
-    !
+
     ok_mensuelCOSP_omp = .TRUE.
     CALL getin('ok_mensuelCOSP', ok_mensuelCOSP_omp)
 
-    !
     !Config Key  = ok_journeCOSP
     !Config Desc =
     !Config Def  = .TRUE.
     !Config Help = 
-    !
+
     ok_journeCOSP_omp = .TRUE.
     CALL getin('ok_journeCOSP', ok_journeCOSP_omp)
 
-    !
     !Config Key  = ok_hfCOSP
     !Config Desc =
     !Config Def  = .FALSE.
     !Config Help =
-    !
+
     ok_hfCOSP_omp = .FALSE.
     CALL getin('ok_hfCOSP', ok_hfCOSP_omp)
 
-    !
     ! coordonnees (lonmin_ins, lonmax_ins, latmin_ins, latmax_ins) pour la zone 
     ! avec sorties instantannees tous les pas de temps de la physique => "histbilKP_ins.nc"
-    !
+
     !Config Key  = lonmin_ins
     !Config Desc = 100.  
     !Config Def  = longitude minimale sorties "bilKP_ins"
     !Config Help = 
-    !
+
     lonmin_ins_omp = 100.
     CALL getin('lonmin_ins', lonmin_ins_omp)
-    !
+
     !Config Key  = lonmax_ins
     !Config Desc = 130. 
     !Config Def  = longitude maximale sorties "bilKP_ins"
     !Config Help =
-    !
+
     lonmax_ins_omp = 130.
     CALL getin('lonmax_ins', lonmax_ins_omp)
-    !
+
     !Config Key  = latmin_ins
     !Config Desc = -20.  
     !Config Def  = latitude minimale sorties "bilKP_ins"
     !Config Help = 
-    !
+
     latmin_ins_omp = -20.
     CALL getin('latmin_ins', latmin_ins_omp)
-    !
+
     !Config Key  = latmax_ins
     !Config Desc = 20. 
     !Config Def  = latitude maximale sorties "bilKP_ins"
     !Config Help =
-    !
+
     latmax_ins_omp = 20.
     CALL getin('latmax_ins', latmax_ins_omp)
-    !
+
     !Config Key  = ecrit_hf
     !Config Desc =
     !Config Def  = 1./8. !toutes les 3h
     !Config Help =
-    !
+
     ecrit_hf_omp = 1. / 8.
     CALL getin('ecrit_hf', ecrit_hf_omp)
-    !
+
     !Config Key  = ecrit_ins
     !Config Desc =
     !Config Def  = 1./48. ! toutes les 1/2 h
     !Config Help =
-    !
+
     ecrit_ins_omp = 1. / 48.
     CALL getin('ecrit_ins', ecrit_ins_omp)
-    !
+
     !Config Key  = ecrit_day
     !Config Desc =
     !Config Def  = 1.0 !tous les jours
     !Config Help = nombre de jours pour ecriture fichier histday.nc
-    !
+
     ecrit_day_omp = 1.0
     CALL getin('ecrit_day', ecrit_day_omp)
-    !
+
     !Config Key  = ecrit_mth
     !Config Desc =
     !Config Def  = 30. !tous les 30jours (1 fois par mois)
     !Config Help =
-    !
+
     ecrit_mth_omp = 30.
     CALL getin('ecrit_mth', ecrit_mth_omp)
-    !
+
     !Config Key  = ecrit_tra
     !Config Desc =
     !Config Def  = 30. !tous les 30jours (1 fois par mois)
     !Config Help =
-    !
+
     ecrit_tra_omp = 0.
     CALL getin('ecrit_tra', ecrit_tra_omp)
-    !
+
     !Config Key  = ecrit_reg
     !Config Desc =
     !Config Def  = 0.25  !4 fois par jour
     !Config Help =
-    !
+
     ecrit_reg_omp = 0.25   !4 fois par jour
     CALL getin('ecrit_reg', ecrit_reg_omp)
-    !
-    !
+
+
     print*, 'CONFPHYS OOK avant drag_ter'
-    !
+
     ! PARAMETRES CDRAG
-    !
+
     f_cdrag_ter_omp = 0.8
     CALL getin('f_cdrag_ter', f_cdrag_ter_omp)
-    !
+
     f_cdrag_oce_omp = 0.8
     CALL getin('f_cdrag_oce', f_cdrag_oce_omp)
-    !
 
     ! Gustiness flags
     f_z0qh_oce_omp = 1.
     CALL getin('f_z0qh_oce', f_z0qh_oce_omp)
-    !
+
     f_qsat_oce_omp = 1.
     CALL getin('f_qsat_oce', f_qsat_oce_omp)
-    !
+
     f_gust_bl_omp = 0.
     CALL getin('f_gust_bl', f_gust_bl_omp)
-    !
+
     f_gust_wk_omp = 0.
     CALL getin('f_gust_wk', f_gust_wk_omp)
-    !
+
     !Config Key  = iflag_z0_oce
     !Config Desc = 0 (z0h=z0m), 1 (diff. equ. for z0h and z0m), -1 (z0m=z0h=z0min)
     !Config Def  = 0   ! z0h = z0m
     !Config Help =
-    !
+
     iflag_z0_oce_omp = 0
     CALL getin('iflag_z0_oce', iflag_z0_oce_omp)
-    !
+
     iflag_gusts_omp = 0
     CALL getin('iflag_gusts', iflag_gusts_omp)
-    !
+
     min_wind_speed_omp = 1.
     CALL getin('min_wind_speed', min_wind_speed_omp)
@@ -1956,23 +1891,21 @@
 
     ! PARAMETERS FOR CONVECTIVE INHIBITION BY TROPOS. DRYNESS
-    !
+
     !Config Key  = supcrit1
     !Config Desc =
     !Config Def  = .540
     !Config Help =
-    !
+
     supcrit1_omp = .540
     CALL getin('supcrit1', supcrit1_omp)
 
-    !
     !Config Key  = supcrit2
     !Config Desc =
     !Config Def  = .600
     !Config Help =
-    !
+
     supcrit2_omp = .600
     CALL getin('supcrit2', supcrit2_omp)
 
-    !
     ! PARAMETERS FOR THE MIXING DISTRIBUTION
     ! iflag_mix: 0=OLD, 
@@ -1980,87 +1913,79 @@
     !            2=NEW + conv. depth inhib. by tropos. dryness
     ! '2' is NOT operationnal and should not be used.
-    !
+
     !Config Key  = iflag_mix
     !Config Desc =
     !Config Def  = 1
     !Config Help =
-    !
+
     iflag_mix_omp = 1
     CALL getin('iflag_mix', iflag_mix_omp)
 
-    !
     ! PARAMETERS FOR THE EROSION OF THE ADIABATIC ASCENTS
     ! iflag_mix_adiab: 0=OLD, 
     !                  1=NEW (CR),            
-    !            
-    !
+
+
     !Config Key  = iflag_mix_adiab
     !Config Desc =
     !Config Def  = 1
     !Config Help =
-    !
+
     iflag_mix_adiab_omp = 0
     CALL getin('iflag_mix_adiab', iflag_mix_adiab_omp)
 
-    !
     !Config Key  = scut
     !Config Desc =
     !Config Def  = 0.95
     !Config Help =
-    !
+
     scut_omp = 0.95
     CALL getin('scut', scut_omp)
 
-    !
     !Config Key  = qqa1
     !Config Desc =
     !Config Def  = 1.0
     !Config Help =
-    !
+
     qqa1_omp = 1.0
     CALL getin('qqa1', qqa1_omp)
 
-    !
     !Config Key  = qqa2
     !Config Desc =
     !Config Def  = 0.0
     !Config Help =
-    !
+
     qqa2_omp = 0.0
     CALL getin('qqa2', qqa2_omp)
 
-    !
     !Config Key  = gammas
     !Config Desc =
     !Config Def  = 0.05
     !Config Help =
-    !
+
     gammas_omp = 0.05
     CALL getin('gammas', gammas_omp)
 
-    !
     !Config Key  = Fmax
     !Config Desc =
     !Config Def  = 0.65
     !Config Help =
-    !
+
     Fmax_omp = 0.65
     CALL getin('Fmax', Fmax_omp)
 
-    !
     !Config Key  = tmax_fonte_cv
     !Config Desc =
     !Config Def  = 275.15
     !Config Help =
-    !
+
     tmax_fonte_cv_omp = 275.15
     CALL getin('tmax_fonte_cv', tmax_fonte_cv_omp)
 
-    !
     !Config Key  = alphas  
     !Config Desc =
     !Config Def  = -5.
     !Config Help =
-    !
+
     alphas_omp = -5.
     CALL getin('alphas', alphas_omp)
@@ -2084,5 +2009,5 @@
 
     !  Parametres pour les ondes de gravite
-    !  
+
     !  Subgrid Scale Orography (Lott Miller (1997), Lott (1999))
 
@@ -2142,5 +2067,5 @@
     !Config Help = Pour creer le fichier histLES contenant les sorties  
     !              LES                                                  
-    !                                                                   
+
     ok_LES_omp = .FALSE.
     CALL getin('OK_LES', ok_LES_omp)
@@ -2151,8 +2076,8 @@
     !Config Help = Pour creer le fichier stats contenant les sorties  
     !              stats                                                  
-    !                                                                   
+
     callstats_omp = .FALSE.
     CALL getin('callstats', callstats_omp)
-    !
+
     !Config Key  = ecrit_LES
     !Config Desc = Frequence d'ecriture des resultats du LES en nombre de jours;
@@ -2160,9 +2085,9 @@
     !Config Def  = 1./8.
     !Config Help = ... 
-    !
-    !
+
+
     adjust_tropopause = .FALSE.
     CALL getin('adjust_tropopause', adjust_tropopause_omp)
-    !
+
     !Config Key  = adjust_tropopause
     !Config Desc = Adjust the ozone field from the climoz file by stretching its
@@ -2170,9 +2095,9 @@
     !Config Def  = .FALSE.
     !Config Help = Ensure tropospheric ozone column conservation.
-    !
-    !
+
+
     ok_daily_climoz = .FALSE.
     CALL getin('ok_daily_climoz', ok_daily_climoz_omp)
-    !
+
     !Config Key  = ok_daily_climoz
     !Config Desc = Interpolate in time the ozone forcings within ce0l.
@@ -2184,5 +2109,5 @@
     ok_new_lscp_omp = .FALSE.
     CALL getin('ok_new_lscp', ok_new_lscp_omp)
-    !
+
     !Config Key  = ok_new_lscp_omp
     !Config Desc = new cloud scheme ith ice and mixed phase (Etienne and JB)
@@ -2192,5 +2117,5 @@
     ok_icefra_lscp_omp = .FALSE.
     CALL getin('ok_icefra_lscp', ok_icefra_lscp_omp)
-    !
+
     !Config Key  = ok_icefra_lscp_omp
     !Config Desc = ice fraction in radiation from lscp
@@ -2200,5 +2125,5 @@
     ok_bs_omp = .FALSE.
     CALL getin('ok_bs', ok_bs_omp)
-    !
+
     !Config Key  = ok_bs_omp
     !Config Desc = include blowing snow
@@ -2208,5 +2133,5 @@
     ok_rad_bs_omp = .FALSE.
     CALL getin('ok_rad_bs', ok_rad_bs_omp)
-    !
+
     !Config Key  = ok_rad_bs_omp
     !Config Desc = include blowing snow radiative effect
@@ -2216,5 +2141,5 @@
     ecrit_LES_omp = 1. / 8.
     CALL getin('ecrit_LES', ecrit_LES_omp)
-    !
+
     read_climoz = 0 ! default value
     CALL getin('read_climoz', read_climoz)
@@ -2256,5 +2181,5 @@
     dms_cycle_cpl_omp = .FALSE.
     CALL getin('transm_dms_oa', dms_cycle_cpl_omp)
-    !
+
     !Config Key  = dms_cycle_cpl
     !Config Desc = receive dms from pisces via oasis
@@ -2264,5 +2189,5 @@
     n2o_cycle_cpl_omp = .FALSE.
     CALL getin('transm_n2o_oa', n2o_cycle_cpl_omp)
-    !
+
     !Config Key  = n2o_cycle_cpl
     !Config Desc = receive n2o from pisces via oasis
@@ -2915,7 +2840,6 @@
 
 END MODULE conf_phys_m
-!
+
 !#################################################################
-!
 
 SUBROUTINE conf_interface(tau_calv)
@@ -2925,15 +2849,15 @@
   IMPLICIT NONE
   ! Configuration de l'interace atm/surf
-  !
+
   ! tau_calv:    temps de relaxation pour la fonte des glaciers
-  !
+
   REAL :: tau_calv
   REAL, SAVE :: tau_calv_omp
-  !
+
   !Config Key  = tau_calv
   !Config Desc = temps de relaxation pour fonte des glaciers en jours
   !Config Def  = 1 an 
   !Config Help = 
-  !
+
   tau_calv_omp = 360. * 10.
   !$OMP MASTER
@@ -2941,7 +2865,7 @@
   !$OMP END MASTER
   !$OMP BARRIER
-  !
+
   tau_calv = tau_calv_omp
-  !
+
   !$OMP MASTER
   WRITE(lunout, *)' ##############################################'
@@ -2949,5 +2873,5 @@
   WRITE(lunout, *)' tau_calv = ', tau_calv
   !$OMP END MASTER
-  !
+
   RETURN
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/MISR_simulator.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/MISR_simulator.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/MISR_simulator.F	(revision 5099)
@@ -1,11 +1,11 @@
-! 
+
 ! Copyright (c) 2009,  Roger Marchand, version 1.2
 ! All rights reserved.
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/MISR_simulator/MISR_simulator.f $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list of 
 !       conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !     * Neither the name of the University of Washington nor the names of its contributors may be used 
 !       to endorse or promote products derived from this software without specific prior written permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
 ! BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
@@ -22,5 +22,4 @@
 ! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
 ! NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
 
       SUBROUTINE MISR_simulator(
@@ -119,13 +118,11 @@
     
       tauchk = -1.*log(0.9999999)
-        
-      !
+
       ! For each GCM cell or horizontal model grid point ...
-      ! 
+
       do j=1,npoints    
 
-         !
          !  estimate distribution of Model layer tops
-         !  
+
          dist_model_layertops(j,:)=0
 
@@ -154,9 +151,7 @@
      &          dist_model_layertops(j,iMISR_ztop)+1
        enddo
-    
-    
-         !
+
          ! compute total cloud optical depth for each column
-         !       
+
        do ibox=1,ncol     
        
@@ -280,9 +275,7 @@
        enddo  ! loop of subcolumns
        enddo    ! loop of gridpoints
-       
-
-        !     
+
         !   Modify MISR CTH for satellite spatial / pattern matcher effects
-    !
+
     !   Code in this region added by roj 5/2006 to account
     !   for spatial effect of the MISR pattern matcher.
@@ -291,5 +284,5 @@
     !   a lower CTH, THEN misr will tend to but place the
     !   odd column at the same height as it neighbors.
-    !
+
     !   This setup assumes the columns represent a about a 1 to 4 km scale
     !   it will need to be modified significantly, otherwise
@@ -337,7 +330,6 @@
         endif
 
-        !     
     !     DETERMINE CLOUD TYPE FREQUENCIES
-    !
+
     !     Now that ztop and tau have been determined, 
     !     determine amount of each cloud type
@@ -407,8 +399,6 @@
 
           else
-            
-            !
+
             ! determine index for MISR bin set
-            !
 
             iMISR_ztop=2
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/array_lib.F90	(revision 5099)
@@ -4,5 +4,5 @@
 ! Compiled/Modified:
 !   07/01/06  John Haynes (haynes@atmos.colostate.edu)
-!
+
 ! infind (function)
 ! lin_interpolate (function)
@@ -19,9 +19,9 @@
   use m_mrgrnk
   implicit none
-!
+
 ! Purpose:
 !   Finds the index of an array that is closest to a value, plus the
 !   difference between the value found and the value specified
-!
+
 ! Inputs:
 !   [list]   an array of sequential values
@@ -29,14 +29,14 @@
 ! Optional input:
 !   [sort]   set to 1 if [list] is in unknown/non-sequential order
-!
+
 ! Returns:
 !   index of [list] that is closest to [val]
-!
+
 ! Optional output:
 !   [dist]   set to variable containing [list([result])] - [val]
-!
+
 ! Requires:
 !   mrgrnk library
-!
+
 ! Created:
 !   10/16/03  John Haynes (haynes@atmos.colostate.edu)
@@ -101,8 +101,8 @@
   use m_mrgrnk
   implicit none
-!
+
 ! Purpose:
 !   linearly interpolate a set of y2 values given a set of y1,x1,x2
-!
+
 ! Inputs:
 !   [yarr]    an array of y1 values
@@ -110,11 +110,11 @@
 !   [xxarr]   an array of x2 values
 !   [tol]     maximum distance for a match
-!
+
 ! Output:
 !   [yyarr]   interpolated array of y2 values
-!
+
 ! Requires:
 !   mrgrnk library
-!
+
 ! Created:
 !   06/07/06  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/atmos_lib.F90	(revision 5099)
@@ -4,5 +4,5 @@
 ! Compiled/Modified:
 !   07/01/06  John Haynes (haynes@atmos.colostate.edu)
-!
+
 ! mcclatchey (subroutine)
   
@@ -17,8 +17,8 @@
   subroutine mcclatchey(stype,hgt,prs,tk,rh)
   implicit none
-!
+
 ! Purpose:
 !   returns a standard atmospheric profile
-!
+
 ! Input:
 !   [stype]   type of profile to return
@@ -26,5 +26,5 @@
 !             2 = mid-latitude winter
 !             3 = tropical
-!
+
 ! Outputs:
 !   [hgt]     height (m)
@@ -32,5 +32,5 @@
 !   [tk]      temperature (K)
 !   [rh]      relative humidity (%)
-!
+
 ! Created:
 !   06/01/2006  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/calc_Re.F90	(revision 5099)
@@ -7,18 +7,18 @@
 ! Purpose:
 !   Calculates Effective Radius (1/2 distribution 3rd moment / 2nd moment). 
-!
+
 !   For some distribution types, the total number concentration (per kg), Np
 !   may be optionally specified.   Should be set to zero, otherwise.
-!
+
 !   Roj Marchand July 2010
 
 
 ! Inputs:
-!
+
 !   [Q]        hydrometeor mixing ratio (g/kg)  ! not needed for some distribution types
 !   [Np]       Optional Total number concentration (per kg).  0 = use defaults (p1, p2, p3)
-!
+
 !   [rho_a]    ambient air density (kg m^-3)   
-!
+
 !   Distribution parameters as per quickbeam documentation.
 !   [dtype]    distribution type
@@ -28,14 +28,12 @@
 !   [bmp]      b params for mass 
 !   [p1],[p2],[p3]  distribution parameters
-!
-!
+
+
 ! Outputs:
 !   [Re]       Effective radius, 1/2 the 3rd moment/2nd moment (um)
-!
+
 ! Created:
 !   July 2010  Roj Marchand
-!
-
- 
+
 ! ----- INPUTS -----  
   
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/congvec.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/congvec.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/congvec.h	(revision 5099)
@@ -5,9 +5,9 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/icarus-scops-4.1-bsd/congvec.f $
-! 
+
 ! Redistribution and use in source and binary forms, with or without 
 ! modification, are permitted provided that the
 ! following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above 
 !       copyright  notice, this list of conditions and the following 
@@ -21,5 +21,5 @@
 !       derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -33,5 +33,5 @@
 ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
-! 
+
 ! *****************************COPYRIGHT*******************************
 ! *****************************COPYRIGHT*******************************
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_defs.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_defs.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/cosp_defs.h	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_defs.h $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/dsd.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
   subroutine dsd(Q,Re_,Np,D,N,nsizes,dtype,rho_a,tk, &
              dmin,dmax,apm,bpm,rho_c,p1,p2,p3)
@@ -10,23 +10,23 @@
 ! Purpose:
 !   Create a discrete drop size distribution
-!
+
 !   Starting with Quickbeam V3, this routine now allows input of 
 !   both effective radius (Re) and total number concentration (Nt)
 !   Roj Marchand July 2010
-!
+
 !   The version in Quickbeam v.104 was modified to allow Re but not Nt 
 !   This is a significantly modified form for the version      
-!
+
 !   Originally Part of QuickBeam v1.03 by John Haynes
 !   http://reef.atmos.colostate.edu/haynes/radarsim
-!
+
 ! Inputs:
-!
+
 !   [Q]        hydrometeor mixing ratio (g/kg)
 !   [Re]       Optional Effective Radius (microns).  0 = use defaults (p1, p2, p3)
-!
+
 !   [D]        array of discrete drop sizes (um) where we desire to know the number concentraiton n(D).
 !   [nsizes]   number of elements of [D]
-!
+
 !   [dtype]    distribution type
 !   [rho_a]    ambient air density (kg m^-3)
@@ -36,16 +36,16 @@
 !   [rho_c]    alternate constant density (kg m^-3)
 !   [p1],[p2],[p3]  distribution parameters
-!
+
 ! Input/Output:
 !   [apm]      a parameter for mass (kg m^[-bpm])
 !   [bmp]      b params for mass
-!
+
 ! Outputs:
 !   [N]        discrete concentrations (cm^-3 um^-1)
 !              or, for monodisperse, a constant (1/cm^3)
-!
+
 ! Requires:
 !   function infind
-!
+
 ! Created:
 !   11/28/05  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/format_input.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/format_input.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/format_input.F90	(revision 5099)
@@ -4,5 +4,5 @@
 ! Compiled/Modified:
 !   08/28/2006  John Haynes (haynes@atmos.colostate.edu)
-!
+
 ! irreg_to_grid (subroutine)
 ! order_data (subroutine)
@@ -23,5 +23,5 @@
 !   Linearly interpolate sounding-level data to the hydrometeor-level
 !   resolution
-!
+
 ! Inputs:
 !   [hgt_matrix]       hydrometeor-level heights
@@ -30,10 +30,10 @@
 !   [env_p_matrix]     sounding-level pressures
 !   [env_rh_matrix]    sounding-level relative humidities
-!
+
 ! Outputs:
 !   [t_matrix]         hydrometeor-level temperatures
 !   [p_matrix]         hydrometeor-level pressures
 !   [rh_matrix]        hydrometeor-level relative humidities
-!
+
 ! Created:
 !   08/28/2006  John Haynes (haynes@atmos.colostate.edu)
@@ -73,5 +73,5 @@
 !   Ensure that input data is in top-down order/bottom-up order,
 !   for space-based/surface based radars, respectively
-!
+
 ! Inputs:
 !   [hgt_matrix]   heights
@@ -81,13 +81,13 @@
 !   [rh_matrix]    relative humidities
 !   [sfc_radar]    1=surface radar, 0=spaceborne
-!
+
 ! Outputs:
 !   [hgt_matrix],[hm_matrix],[p_matrix,[t_matrix],[rh_matrix] in proper
 !   order for input to the radar simulator routine
 !   [hgt_reversed]   T=heights were reordered,F=heights were not reordered
-!
+
 ! Note:
 !   The order for all profiles is assumed to the same as the first profile.
-!
+
 ! Created:
 !   08/28/2006  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/gases.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/gases.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/gases.F90	(revision 5099)
@@ -6,5 +6,5 @@
 ! Purpose:
 !   Compute 2-way gaseous attenuation through a volume in microwave
-!
+
 ! Inputs:
 !   [PRES_mb]   pressure (mb) (hPa)
@@ -12,11 +12,11 @@
 !   [RH]        relative humidity (%)
 !   [f]         frequency (GHz), < 300 GHz
-!
+
 ! Returns:
 !   2-way gaseous attenuation (dB/km)
-!
+
 ! Reference:
 !   Uses method of Liebe (1985)
-!
+
 ! Created:
 !   12/09/05  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/icarus.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/icarus.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/icarus.F	(revision 5099)
@@ -41,9 +41,9 @@
 ! Corporation.
 ! All rights reserved.
-! 
+
 ! Redistribution and use in source and binary forms, with or without 
 ! modification, are permitted provided that the
 ! following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above 
 !       copyright  notice, this list of conditions and the following 
@@ -58,5 +58,5 @@
 !       derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -70,5 +70,5 @@
 ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
-! 
+
 ! *****************************COPYRIGHT*******************************
 ! *****************************COPYRIGHT*******************************
@@ -153,22 +153,22 @@
                                  ! with interpolated temperature equal to the radiance
 				 ! determined cloud-top temperature
-				 !
+
 				 ! 1 = find the *lowest* altitude (highest pressure) level
 				 ! with interpolated temperature equal to the radiance
 				 ! determined cloud-top temperature
-				 !
+
 				 ! 2 = find the *highest* altitude (lowest pressure) level
 				 ! with interpolated temperature equal to the radiance 
 				 ! determined cloud-top temperature
-				 ! 
+
 				 ! ONLY APPLICABLE IF top_height EQUALS 1 or 3
 				 !				 !
 				 ! 1 = old setting: matches all versions of 
 				 ! ISCCP simulator with versions numbers 3.5.1 and lower
-				 !
+
 				 ! 2 = default setting: for version numbers 4.0 and higher
-!
+
 !     The following input variables are used only if top_height = 1 or top_height = 3
-!
+
       REAL skt(npoints)                 !  skin Temperature (K)
       REAL emsfc_lw                     !  10.5 micron emissivity of surface (fraction)                                            
@@ -222,7 +222,5 @@
       
       REAL boxptop(npoints,ncol)        !  cloud top pressure (mb) in each column
-                              
-                                                                                          
-!
+
 !     ------
 !     Working variables added when program updated to mimic Mark Webb's PV-Wave code
@@ -456,9 +454,6 @@
       enddo
 
-!
 !     ---------------------------------------------------!
 
-      
-!
 !     ---------------------------------------------------!
 !     COMPUTE CLOUD OPTICAL DEPTH FOR EACH COLUMN and
@@ -502,16 +497,13 @@
               enddo
           endif 
-!
+
 !     ---------------------------------------------------!
 
-
-
-!     
 !     ---------------------------------------------------!
 !     COMPUTE INFRARED BRIGHTNESS TEMPERUATRES
 !     AND CLOUD TOP TEMPERATURE SATELLITE SHOULD SEE
-!
+
 !     again this is only done if top_height = 1 or 3
-!
+
 !     fluxtop is the 10.5 micron radiance at the top of the
 !              atmosphere
@@ -525,7 +517,7 @@
 
         !----------------------------------------------------------------------
-        !    
+
         !             DO CLEAR SKY RADIANCE CALCULATION FIRST
-        !
+
         !compute water vapor continuum emissivity
         !this treatment follows Schwarkzopf and Ramasamy
@@ -640,9 +632,7 @@
         enddo
       endif
-    
-
-        !
+
         !           END OF CLEAR SKY CALCULATION
-        !
+
         !----------------------------------------------------------------
 
@@ -795,9 +785,9 @@
         !clouds which have partial emissivity and need the 
         !adjustment performed in this section
-        !
+
       !If it turns out that the cloud brightness temperature
       !is greater than 260K, then the liquid cloud conversion
         !factor of 2.56 is used.
-      !
+
         !Note that this is discussed on pages 85-87 of 
         !the ISCCP D level documentation (Rossow et al. 1996)
@@ -915,12 +905,10 @@
 !     ---------------------------------------------------!
 
-!     
 !     ---------------------------------------------------!
 !     DETERMINE CLOUD TOP PRESSURE
-!
+
 !     again the 2 methods differ according to whether
 !     or not you use the physical cloud top pressure (top_height = 2)
 !     or the radiatively determined cloud top pressure (top_height = 1 or 3)
-!
 
       !compute cloud top pressure
@@ -1004,18 +992,15 @@
 
 30    continue
-              
-!
-!
+
+
 !     ---------------------------------------------------!
 
-
-!     
 !     ---------------------------------------------------!
 !     DETERMINE ISCCP CLOUD TYPE FREQUENCIES
-!
+
 !     Now that ptop and tau have been determined, 
 !     determine amount of each of the 49 ISCCP cloud
 !     types
-!
+
 !     Also compute grid box mean cloud top pressure and
 !     optical thickness.  The mean cloud top pressure and
@@ -1027,5 +1012,4 @@
 !     then converting the average albedo back to a mean
 !     optical thickness.  
-!
 
       !compute isccp frequencies
@@ -1187,12 +1171,12 @@
         end if
       enddo ! j
-!
+
 !     ---------------------------------------------------!
 
 !     ---------------------------------------------------!
 !     OPTIONAL PRINTOUT OF DATA TO CHECK PROGRAM
-!
+
       if (debugcol.ne.0) then
-!     
+
          do j=1,npoints,debugcol
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/isccp_cloud_types.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/isccp_cloud_types.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/isccp_cloud_types.F	(revision 5099)
@@ -41,9 +41,9 @@
 ! (c) British Crown Copyright 2009, the Met Office.
 ! All rights reserved.
-! 
+
 ! Redistribution and use in source and binary forms, with or without 
 ! modification, are permitted provided that the
 ! following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above 
 !       copyright  notice, this list of conditions and the following 
@@ -57,5 +57,5 @@
 !       derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -69,5 +69,5 @@
 ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
-! 
+
 ! *****************************COPYRIGHT*******************************
 ! *****************************COPYRIGHT*******************************
@@ -161,22 +161,22 @@
                                  ! with interpolated temperature equal to the radiance
 				 ! determined cloud-top temperature
-				 !
+
 				 ! 1 = find the *lowest* altitude (highest pressure) level
 				 ! with interpolated temperature equal to the radiance
 				 ! determined cloud-top temperature
-				 !
+
 				 ! 2 = find the *highest* altitude (lowest pressure) level
 				 ! with interpolated temperature equal to the radiance 
 				 ! determined cloud-top temperature
-				 ! 
+
 				 ! ONLY APPLICABLE IF top_height EQUALS 1 or 3
-				 !
+
 				 ! 1 = old setting: matches all versions of 
 				 ! ISCCP simulator with versions numbers 3.5.1 and lower
-				 !
+
 				 ! 2 = default setting: for version numbers 4.0 and higher  
-!
+
 !     The following input variables are used only if top_height = 1 or top_height = 3
-!
+
       REAL skt(npoints)                 !  skin Temperature (K)
       REAL emsfc_lw                     !  10.5 micron emissivity of surface (fraction)                                            
@@ -230,7 +230,5 @@
       
       REAL boxptop(npoints,ncol)        !  cloud top pressure (mb) in each column
-                              
-                                                                                          
-!
+
 !     ------
 !     Working variables added when program updated to mimic Mark Webb's PV-Wave code
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/lidar_simulator.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/actsim/lidar_simulator.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       contributors may be used to endorse or promote products derived from this software without 
 !       specific prior written permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -31,32 +31,32 @@
                 , ls_radliq, ls_radice, cv_radliq, cv_radice &
                 , ice_type, pmol, pnorm, pnorm_perp_tot,tautot, refl )
-!
+
 !---------------------------------------------------------------------------------
 ! Purpose: To compute lidar signal from model-simulated profiles of cloud water
 !          and cloud fraction in each sub-column of each model gridbox.
-!
+
 ! References: 
 ! Chepfer H., S. Bony, D. Winker, M. Chiriaco, J.-L. Dufresne, G. Seze (2008),
 ! Use of CALIPSO lidar observations to evaluate the cloudiness simulated by a 
 ! climate model, Geophys. Res. Lett., 35, L15704, doi:10.1029/2008GL034207.
-!
+
 ! Previous references:
 ! Chiriaco et al, MWR, 2006; Chepfer et al., MWR, 2007
-!
+
 ! Contacts: Helene Chepfer (chepfer@lmd.polytechnique.fr), Sandrine Bony (bony@lmd.jussieu.fr)
-!
+
 ! May 2007: ActSim code of M. Chiriaco and H. Chepfer rewritten by S. Bony
-!
+
 ! May 2008, H. Chepfer:
 ! - Units of pressure inputs: Pa 
 ! - Non Spherical particles : LS Ice NS coefficients, CONV Ice NS coefficients
 ! - New input: ice_type (0=ice-spheres ; 1=ice-non-spherical)
-!
+
 ! June 2008, A. Bodas-Salcedo:
 ! - Ported to Fortran 90 and optimisation changes
-!
+
 ! August 2008, J-L Dufresne:
 ! - Optimisation changes (sum instructions suppressed)
-!
+
 ! October 2008, S. Bony,  H. Chepfer and J-L. Dufresne :  
 ! - Interface with COSP v2.0:
@@ -65,16 +65,16 @@
 !      depolarisation diagnostic removed
 !      parasol (polder) reflectances (for 5 different solar zenith angles) added
-!
+
 ! December 2008, S. Bony,  H. Chepfer and J-L. Dufresne : 
 ! - Modification of the integration of the lidar equation.
 ! - change the cloud detection threshold
-!
+
 ! April 2008, A. Bodas-Salcedo:
 ! - Bug fix in computation of pmol and pnorm of upper layer
-!
+
 ! April 2008, J-L. Dufresne
 ! - Bug fix in computation of pmol and pnorm, thanks to Masaki Satoh: a factor 2 
 ! was missing. This affects the ATB values but not the cloud fraction. 
-!
+
 ! January 2013, G. Cesana and H. Chepfer:
 ! - Add the perpendicular component of the backscattered signal (pnorm_perp_tot) in the arguments
@@ -83,7 +83,7 @@
 ! Reference: Cesana G. and H. Chepfer (2013): Evaluation of the cloud water phase
 ! in a climate model using CALIPSO-GOCCP, J. Geophys. Res., doi: 10.1002/jgrd.50376
-!
+
 !---------------------------------------------------------------------------------
-!
+
 ! Inputs:
 !  npoints  : number of horizontal points
@@ -106,5 +106,5 @@
 !  ice_type : ice particle shape hypothesis (ice_type=0 for spheres, ice_type=1 
 !             for non spherical particles)
-!
+
 ! Outputs:
 !  pmol : molecular attenuated backscatter lidar signal power (m^-1.sr^-1)
@@ -113,5 +113,5 @@
 !  tautot: optical thickess integrated from top to level z
 !  refl : parasol(polder) reflectance
-!
+
 ! Version 1.0 (June 2007)
 ! Version 1.1 (May 2008)
@@ -228,5 +228,5 @@
 ! as a function of the ATB for ice or liquid cloud particles derived from CALIPSO-GOCCP
 ! observations at 120m vertical grid (Cesana and Chepfer, JGR, 2013).
-!
+
 ! Relationship between ATBice and ATBperp,ice for ice particles
 !  ATBperp,ice = Alpha*ATBice 
@@ -414,6 +414,6 @@
 
 ! Total signal (molecular + particules):
-!
-!
+
+
 ! For performance reason on vector computers, the 2 following lines should not be used
 ! and should be replace by the later one.
@@ -426,5 +426,5 @@
            tautot(:,:) = tautot(:,:)  + tau_part(:,:,i)
       ENDDO ! i
-!
+
 !     Upper layer 
       pnorm(:,nlev) = betatot(:,nlev) / (2.*tautot(:,nlev)) &
@@ -585,5 +585,5 @@
 !---------------------------------------------------------
 !  Parasol/Polder module
-!
+
 !  Purpose : Compute reflectance for one particular viewing direction
 !  and 5 solar zenith angles (calculation valid only over ocean)
@@ -611,7 +611,7 @@
 
   END SUBROUTINE lidar_simulator
-!
+
 !---------------------------------------------------------------------------------
-!
+
   SUBROUTINE parasol(npoints,nrefl,undef  &
                        ,tautot_S_liq,tautot_S_ice  &
@@ -621,9 +621,9 @@
 !          of cloud water and cloud fraction in each sub-column of each model 
 !          gridbox.
-!
-!
+
+
 ! December 2008, S. Bony,  H. Chepfer and J-L. Dufresne : 
 ! - optimization for vectorization
-!
+
 ! Version 2.0 (October 2008)
 ! Version 2.1 (December 2008)
@@ -642,5 +642,5 @@
 ! outputs
     REAL refl(npoints,nrefl)     ! Parasol reflectances
-!
+
 ! Local variables
     REAL tautot_S(npoints)       ! cloud optical thickness, from TOA to surface
@@ -702,12 +702,12 @@
     rlumA_mod=0
     rlumB_mod=0
-!
+
     pi = ACOS(-1.0)
     r_norm(:)=1./ COS(pi/180.*tetas(:))
-!
+
     tautot_S_liq(:)=MAX(tautot_S_liq(:),tau(1))
     tautot_S_ice(:)=MAX(tautot_S_ice(:),tau(1))
     tautot_S(:) = tautot_S_ice(:) + tautot_S_liq(:)
-!
+
 ! relative fraction of the opt. thick due to liquid or ice clouds
     WHERE (tautot_S(:) .GT. 0.)
@@ -719,5 +719,5 @@
     END WHERE
     tautot_S(:)=MIN(tautot_S(:),tau(nbtau))
-!
+
 ! Linear interpolation :
 
@@ -730,5 +730,5 @@
       bB(:,ny) = rlumB(:,ny) - aB(:,ny)*tau(ny)
     ENDDO
-!
+
     DO it=1,ntetas
       DO ny=1,nbtau-1
@@ -739,5 +739,5 @@
       END DO
     END DO
-!
+
     DO it=1,ntetas
       refl(:,it) = frac_taucol_liq(:) * rlumA_mod(:,it) &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/m_mrgrnk.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/m_mrgrnk.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/m_mrgrnk.F90	(revision 5099)
@@ -21,9 +21,9 @@
 ! __________________________________________________________
       Real (kind=kdp) :: XVALA, XVALB
-!
+
       Integer, Dimension (SIZE(IRNGT)) :: JWRKT
       Integer :: LMTNA, LMTNC, IRNG1, IRNG2
       Integer :: NVAL, IIND, IWRKD, IWRK, IWRKF, JINDA, IINDA, IINDB
-!
+
       NVAL = Min (SIZE(XDONT), SIZE(IRNGT))
       Select Case (NVAL)
@@ -36,7 +36,7 @@
          Continue
       End Select
-!
+
 !  Fill-in the index array, creating ordered couples
-!
+
       Do IIND = 2, NVAL, 2
          If (XDONT(IIND-1) <= XDONT(IIND)) Then
@@ -51,35 +51,35 @@
          IRNGT (NVAL) = NVAL
       End If
-!
+
 !  We will now have ordered subsets A - B - A - B - ...
 !  and merge A and B couples into     C   -   C   - ...
-!
+
       LMTNA = 2
       LMTNC = 4
-!
+
 !  First iteration. The length of the ordered subsets goes from 2 to 4
-!
+
       Do
          If (NVAL <= 2) Exit
-!
+
 !   Loop on merges of A and B into C
-!
+
          Do IWRKD = 0, NVAL - 1, 4
             If ((IWRKD+4) > NVAL) Then
                If ((IWRKD+2) >= NVAL) Exit
-!
+
 !   1 2 3
-!
+
                If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Exit
-!
+
 !   1 3 2
-!
+
                If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                   IRNG2 = IRNGT (IWRKD+2)
                   IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
                   IRNGT (IWRKD+3) = IRNG2
-!
+
 !   3 1 2
-!
+
                Else
                   IRNG1 = IRNGT (IWRKD+1)
@@ -90,11 +90,11 @@
                Exit
             End If
-!
+
 !   1 2 3 4
-!
+
             If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Cycle
-!
+
 !   1 3 x x
-!
+
             If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                IRNG2 = IRNGT (IWRKD+2)
@@ -108,7 +108,7 @@
                   IRNGT (IWRKD+4) = IRNG2
                End If
-!
+
 !   3 x x x
-!
+
             Else
                IRNG1 = IRNGT (IWRKD+1)
@@ -133,21 +133,21 @@
             End If
          End Do
-!
+
 !  The Cs become As and Bs
-!
+
          LMTNA = 4
          Exit
       End Do
-!
+
 !  Iteration loop. Each time, the length of the ordered subsets
 !  is doubled.
-!
+
       Do
          If (LMTNA >= NVAL) Exit
          IWRKF = 0
          LMTNC = 2 * LMTNC
-!
+
 !   Loop on merges of A and B into C
-!
+
          Do
             IWRK = IWRKF
@@ -161,25 +161,25 @@
             IINDA = 1
             IINDB = JINDA + 1
-!
+
 !   Shortcut for the case when the max of A is smaller
 !   than the min of B. This line may be activated when the
 !   initial set is already close to sorted.
-!
+
 !          IF (XDONT(IRNGT(JINDA)) <= XDONT(IRNGT(IINDB))) CYCLE
-!
+
 !  One steps in the C subset, that we build in the final rank array
-!
+
 !  Make a copy of the rank array for the merge iteration
-!
+
             JWRKT (1:LMTNA) = IRNGT (IWRKD:JINDA)
-!
+
             XVALA = XDONT (JWRKT(IINDA))
             XVALB = XDONT (IRNGT(IINDB))
-!
+
             Do
                IWRK = IWRK + 1
-!
+
 !  We still have unprocessed values in both A and B
-!
+
                If (XVALA > XVALB) Then
                   IRNGT (IWRK) = IRNGT (IINDB)
@@ -197,15 +197,15 @@
                   XVALA = XDONT (JWRKT(IINDA))
                End If
-!
+
             End Do
          End Do
-!
+
 !  The Cs become As and Bs
-!
+
          LMTNA = 2 * LMTNA
       End Do
-!
+
       Return
-!
+
 End Subroutine D_mrgrnk
 
@@ -221,9 +221,9 @@
 ! __________________________________________________________
       Integer :: XVALA, XVALB
-!
+
       Integer, Dimension (SIZE(IRNGT)) :: JWRKT
       Integer :: LMTNA, LMTNC, IRNG1, IRNG2
       Integer :: NVAL, IIND, IWRKD, IWRK, IWRKF, JINDA, IINDA, IINDB
-!
+
       NVAL = Min (SIZE(XDONT), SIZE(IRNGT))
       Select Case (NVAL)
@@ -236,7 +236,7 @@
          Continue
       End Select
-!
+
 !  Fill-in the index array, creating ordered couples
-!
+
       Do IIND = 2, NVAL, 2
          If (XDONT(IIND-1) <= XDONT(IIND)) Then
@@ -251,35 +251,35 @@
          IRNGT (NVAL) = NVAL
       End If
-!
+
 !  We will now have ordered subsets A - B - A - B - ...
 !  and merge A and B couples into     C   -   C   - ...
-!
+
       LMTNA = 2
       LMTNC = 4
-!
+
 !  First iteration. The length of the ordered subsets goes from 2 to 4
-!
+
       Do
          If (NVAL <= 2) Exit
-!
+
 !   Loop on merges of A and B into C
-!
+
          Do IWRKD = 0, NVAL - 1, 4
             If ((IWRKD+4) > NVAL) Then
                If ((IWRKD+2) >= NVAL) Exit
-!
+
 !   1 2 3
-!
+
                If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Exit
-!
+
 !   1 3 2
-!
+
                If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                   IRNG2 = IRNGT (IWRKD+2)
                   IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
                   IRNGT (IWRKD+3) = IRNG2
-!
+
 !   3 1 2
-!
+
                Else
                   IRNG1 = IRNGT (IWRKD+1)
@@ -290,11 +290,11 @@
                Exit
             End If
-!
+
 !   1 2 3 4
-!
+
             If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Cycle
-!
+
 !   1 3 x x
-!
+
             If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                IRNG2 = IRNGT (IWRKD+2)
@@ -308,7 +308,7 @@
                   IRNGT (IWRKD+4) = IRNG2
                End If
-!
+
 !   3 x x x
-!
+
             Else
                IRNG1 = IRNGT (IWRKD+1)
@@ -333,21 +333,21 @@
             End If
          End Do
-!
+
 !  The Cs become As and Bs
-!
+
          LMTNA = 4
          Exit
       End Do
-!
+
 !  Iteration loop. Each time, the length of the ordered subsets
 !  is doubled.
-!
+
       Do
          If (LMTNA >= NVAL) Exit
          IWRKF = 0
          LMTNC = 2 * LMTNC
-!
+
 !   Loop on merges of A and B into C
-!
+
          Do
             IWRK = IWRKF
@@ -361,25 +361,25 @@
             IINDA = 1
             IINDB = JINDA + 1
-!
+
 !   Shortcut for the case when the max of A is smaller
 !   than the min of B. This line may be activated when the
 !   initial set is already close to sorted.
-!
+
 !          IF (XDONT(IRNGT(JINDA)) <= XDONT(IRNGT(IINDB))) CYCLE
-!
+
 !  One steps in the C subset, that we build in the final rank array
-!
+
 !  Make a copy of the rank array for the merge iteration
-!
+
             JWRKT (1:LMTNA) = IRNGT (IWRKD:JINDA)
-!
+
             XVALA = XDONT (JWRKT(IINDA))
             XVALB = XDONT (IRNGT(IINDB))
-!
+
             Do
                IWRK = IWRK + 1
-!
+
 !  We still have unprocessed values in both A and B
-!
+
                If (XVALA > XVALB) Then
                   IRNGT (IWRK) = IRNGT (IINDB)
@@ -397,15 +397,15 @@
                   XVALA = XDONT (JWRKT(IINDA))
                End If
-!
+
             End Do
          End Do
-!
+
 !  The Cs become As and Bs
-!
+
          LMTNA = 2 * LMTNA
       End Do
-!
+
       Return
-!
+
 End Subroutine I_mrgrnk
 end module m_mrgrnk
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/math_lib.F90	(revision 5099)
@@ -4,5 +4,5 @@
 ! Compiled/Modified:
 !   07/01/06  John Haynes (haynes@atmos.colostate.edu)
-! 
+
 ! gamma (function)
 ! path_integral (function)
@@ -19,14 +19,14 @@
   function gamma(x)
   implicit none
-!
+
 ! Purpose:
 !   Returns the gamma function
-!
+
 ! Input:
 !   [x]   value to compute gamma function of
-!
+
 ! Returns:
 !   gamma(x)
-!
+
 ! Coded:
 !   02/02/06  John Haynes (haynes@atmos.colostate.edu)
@@ -100,9 +100,9 @@
   use array_lib
   implicit none
-!
+
 ! Purpose:
 !   evalues the integral (f ds) between f(index=i1) and f(index=i2)
 !   using the AVINT procedure
-!
+
 ! Inputs:
 !   [f]    functional values
@@ -110,14 +110,14 @@
 !   [i1]   index of lower limit
 !   [i2]   index of upper limit
-!
+
 ! Returns:
 !   result of path integral
-!
+
 ! Notes:
 !   [s] may be in forward or reverse numerical order
-!
+
 ! Requires:
 !   mrgrnk package
-!
+
 ! Created:
 !   02/02/06  John Haynes (haynes@atmos.colostate.edu)
@@ -162,8 +162,8 @@
   subroutine avint ( ftab, xtab, ntab, a_in, b_in, result )
   implicit none
-!
+
 ! Purpose:
 !   estimate the integral of unevenly spaced data
-!
+
 ! Inputs:
 !   [ftab]     functional values
@@ -172,31 +172,31 @@
 !   [a]        lower limit of integration
 !   [b]        upper limit of integration
-!
+
 ! Outputs:
 !   [result]   approximate value of integral
-!
+
 ! Reference:
 !   From SLATEC libraries, in public domain
-!
+
 !***********************************************************************
-!
+
 !  AVINT estimates the integral of unevenly spaced data.
-!
+
 !  Discussion:
-!
+
 !    The method uses overlapping parabolas and smoothing.
-!
+
 !  Modified:
-!
+
 !    30 October 2000
 !    4 January 2008, A. Bodas-Salcedo. Error control for XTAB taken out of
 !                    loop to allow vectorization.
-!
+
 !  Reference:
-!
+
 !    Philip Davis and Philip Rabinowitz,
 !    Methods of Numerical Integration,
 !    Blaisdell Publishing, 1967.
-!
+
 !    P E Hennion,
 !    Algorithm 77,
@@ -204,25 +204,25 @@
 !    Communications of the Association for Computing Machinery,
 !    Volume 5, page 96, 1962.
-!
+
 !  Parameters:
-!
+
 !    Input, real ( kind = 8 ) FTAB(NTAB), the function values,
 !    FTAB(I) = F(XTAB(I)).
-!
+
 !    Input, real ( kind = 8 ) XTAB(NTAB), the abscissas at which the
 !    function values are given.  The XTAB's must be distinct
 !    and in ascending order.
-!
+
 !    Input, integer NTAB, the number of entries in FTAB and
 !    XTAB.  NTAB must be at least 3.
-!
+
 !    Input, real ( kind = 8 ) A, the lower limit of integration.  A should
 !    be, but need not be, near one endpoint of the interval
 !    (X(1), X(NTAB)).
-!
+
 !    Input, real ( kind = 8 ) B, the upper limit of integration.  B should
 !    be, but need not be, near one endpoint of the interval
 !    (X(1), X(NTAB)).
-!
+
 !    Output, real ( kind = 8 ) RESULT, the approximate value of the integral.
 
@@ -293,7 +293,7 @@
     return
   end if
-!
+
 !  If B < A, temporarily switch A and B, and store sign.
-!
+
   if ( b < a ) then
     syl = b
@@ -305,7 +305,7 @@
     ind = 1
   end if
-!
+
 !  Bracket A and B between XTAB(ILO) and XTAB(IHI).
-!
+
   ilo = 1
   ihi = ntab
@@ -330,7 +330,7 @@
   ihi = min ( ihi, ntab - 1 )
   ihi = max ( ilo, ihi - 1 )
-!
+
 !  Carry out approximate integration from XTAB(ILO) to XTAB(IHI).
-!
+
   sum1 = 0.0D+00
  
@@ -380,8 +380,8 @@
         + cb * 0.5D+00 * ( b**2 - syl**2 ) &
         + cc * ( b - syl )
-!
+
 !  Restore original values of A and B, reverse sign of integral
 !  because of earlier switch.
-!
+
   if ( ind /= 1 ) then
     ind = 1
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp.F90	(revision 5099)
@@ -1,8 +1,8 @@
 ! (c) British Crown Copyright 2008, the Met Office.
 ! All rights reserved.
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -13,5 +13,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_constants.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_constants.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_constants.F90	(revision 5099)
@@ -1,8 +1,8 @@
 ! (c) British Crown Copyright 2008, the Met Office.
 ! All rights reserved.
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -13,5 +13,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -23,5 +23,4 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-!
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
@@ -29,7 +28,6 @@
 ! Oct 2008 - H. Chepfer       - Added PARASOL_NREFL
 ! Jun 2010 - R. Marchand      - Modified to support quickbeam V3, added ifdef for hydrometeor definitions
-! 
-!
-! 
+
+
 
 !!#INCLUDE "cosp_defs.h"
@@ -143,10 +141,7 @@
                                              shape=(/2,MISR_N_CTH/))
 
-
-    !
     ! The following code was modifed by Roj with implementation of quickbeam V3
     !   (1) use ifdef to support more than one microphyscis scheme 
     !   (2) added constants  microphysic_scheme_name, LOAD_scale_LUTs, and SAVE_scale_LUTs 
-    !
 
     ! directory where LUTs will be stored
@@ -155,13 +150,10 @@
 #ifdef MMF_V3_SINGLE_MOMENT
 
-    !        
     !  Table hclass for quickbeam to support one-moment (bulk) microphysics scheme used by MMF V3.0 & V3.5
-    !
-
-    !
+
     ! NOTE:  if ANY value in this section of code is changed, the existing LUT 
     !        (i.e., the associated *.dat file) MUST be deleted so that a NEW
     !        LUT will be created !!!
-    !
+
     character*120 :: RADAR_SIM_MICROPHYSICS_SCHEME_NAME = 'MMF_v3_single_moment'
 
@@ -190,5 +182,5 @@
 
     ! NOTES on HCLASS variables
-    !
+
     ! TYPE - Set to
     ! 1 for modified gamma distribution,
@@ -217,5 +209,5 @@
     ! P1, P2, P3 - are default distribution parameters that depend on the type
     ! of distribution (see quickmbeam documentation for more information)
-    !
+
     ! Modified Gamma (must set P3 and one of P1 or P2)
     ! P1 - Set to the total particle number concentration Nt /rho_a (kg-1 ), where
@@ -223,21 +215,19 @@
     ! P2 - Set to the particle mean diameter D (micron).
     ! P3 - Set to the distribution width nu.
-    !
+
     ! Exponetial (set one of)
     ! P1 - Set to a constant intercept parameter N0 (m-4).
     ! P2 - Set to a constant lambda (micron-1).
-    !
+
     ! Power Law
     ! P1 - Set this to the value of a constant power law parameter br
-    !
+
     ! Monodisperse
     ! P1 - Set to a constant diameter D0 (micron) = Re.
-    !
+
     ! Log-normal (must set P3 and one of P1 or P2)
     ! P1 - Set to the total particle number concentration Nt /rho_a (kg-1 )
     ! P2 - Set to the geometric mean particle radius rg (micron).
     ! P3 - Set to the natural logarithm of the geometric standard deviation.
-    !
-
 
     real,dimension(N_HYDRO) :: N_ax,N_bx,alpha_x,c_x,d_x,g_x,a_x,b_x,gamma_1,gamma_2,gamma_3,gamma_4
@@ -265,17 +255,14 @@
 #ifdef MMF_V3p5_TWO_MOMENT
 
-    !
     !  Table hclass for quickbeam to support two-moment "morrison" microphysics scheme used by V3.5 (SAM 6.8)
-    !
+
     !  This Number concentriation Np in [1/kg] MUST be input to COSP/radar simulator
-    !
+
     !  NOTE:  Be sure to check that the ice-density (rho) set it this tables matches what you used
-    !
-
-    !
+
     ! NOTE:  if ANY value in this section of code is changed, the existing LUT 
     !        (i.e., the associated *.dat file) MUST be deleted so that a NEW
     !        LUT will be created !!!
-    !
+
     character*120 :: RADAR_SIM_MICROPHYSICS_SCHEME_NAME = 'MMF_v3.5_two_moment'
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_isccp_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_isccp_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_isccp_simulator.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_isccp_simulator.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_lidar.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_lidar.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_lidar.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_lidar.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -25,5 +25,4 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-!
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
@@ -32,6 +31,6 @@
 !                               frac_out changed in sgx%frac_out)
 ! Jun 2011 - G. Cesana        - Added betaperp_tot argument
-!
-! 
+
+
 MODULE MOD_COSP_LIDAR
   USE MOD_COSP_CONSTANTS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_misr_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_misr_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_misr_simulator.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_misr_simulator.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -25,9 +25,7 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-!
 ! History:
 ! Nov 2008 - A. Bodas-Salcedo - Initial version
-!
-!
+
 
 MODULE MOD_COSP_MISR_SIMULATOR
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_modis_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_modis_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_modis_simulator.F90	(revision 5099)
@@ -4,8 +4,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 07:08:38 -0700 (Wed, 13 Nov 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_modis_simulator.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -16,5 +16,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -25,11 +25,9 @@
 ! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
-
-!
+
 ! History:
 !   May 2009 - Robert Pincus - Initial version
 !   Dec 2009 - Robert Pincus - Tiny revisions
-!
+
 MODULE MOD_COSP_Modis_Simulator
   USE MOD_COSP_CONSTANTS
@@ -44,13 +42,12 @@
   !------------------------------------------------------------------------------------------------
   ! Public type
-  !
+
   ! Summary statistics from MODIS retrievals
   type COSP_MODIS
      ! Dimensions
      integer :: Npoints   ! Number of gridpoints
-     
-     !
+
      ! Grid means; dimension nPoints
-     ! 
+
      real, dimension(:),       pointer :: & 
        Cloud_Fraction_Total_Mean,       Cloud_Fraction_Water_Mean,       Cloud_Fraction_Ice_Mean,       &
@@ -61,7 +58,7 @@
        Cloud_Top_Pressure_Total_Mean,                                                                   &
                                         Liquid_Water_Path_Mean,          Ice_Water_Path_Mean
-     !
+
      ! Also need the ISCCP-type optical thickness/cloud top pressure histogram
-     !
+
      real, dimension(:, :, :), pointer :: Optical_Thickness_vs_Cloud_Top_Pressure
      real, dimension(:, :, :), pointer :: Optical_Thickness_vs_ReffICE
@@ -126,8 +123,7 @@
     integer, dimension(count(gridBox%sunlit(:) <= 0)) :: notSunlit
     ! ------------------------------------------------------------
-    
-    !
+
     ! Are there any sunlit points? 
-    !
+
     nSunlit = count(gridBox%sunlit(:) > 0)
     if(nSunlit > 0) then 
@@ -135,21 +131,19 @@
       nPoints  = gridBox%Npoints
       nSubCols = subCols%Ncolumns
-      !
+
       ! This is a vector index indicating which points are sunlit
-      !
+
       sunlit(:)    = pack((/ (i, i = 1, nPoints ) /), mask =       gridBox%sunlit(:) > 0)
       notSunlit(:) = pack((/ (i, i = 1, nPoints ) /), mask = .not. gridBox%sunlit(:) > 0)
-               
-      !
+
       ! Copy needed quantities, reversing vertical order and removing points with no sunlight 
-      !
+
       pressureLevels(:, 1) = 0.0 ! Top of model, following ISCCP sim
       temperature(:, :)     = gridBox%T (sunlit(:), nLevels:1:-1) 
       pressureLayers(:, :)  = gridBox%p (sunlit(:), nLevels:1:-1) 
       pressureLevels(:, 2:) = gridBox%ph(sunlit(:), nLevels:1:-1) 
-      
-      !
+
       ! Subcolumn properties - first stratiform cloud...
-      ! 
+
       where(subCols%frac_out(sunlit(:), :, :) == I_LSC)
         !opticalThickness(:, :, :) = & 
@@ -180,7 +174,6 @@
       end do
 
-      !
       ! .. then add convective cloud...
-      !
+
       where(subCols%frac_out(sunlit(:), :, :) == I_CVC) 
         !opticalThickness(:, :, :) = &
@@ -201,7 +194,6 @@
       end do
 
-      !
       ! Reverse vertical order 
-      !
+
       opticalThickness(:, :, :)  = opticalThickness(:, :, nLevels:1:-1)
       cloudWater      (:, :, :)  = cloudWater      (:, :, nLevels:1:-1)
@@ -242,8 +234,7 @@
                         jointHistogram,jointHistogram2,jointHistogram3)
       ! DJS2015: END
-      
-      !
+
       ! Copy results into COSP structure
-      !
+
       modisSim%Cloud_Fraction_Total_Mean(sunlit(:)) = cfTotal(:)
       modisSim%Cloud_Fraction_Water_Mean(sunlit(:)) = cfLiquid
@@ -273,12 +264,12 @@
       modisSim%Optical_Thickness_vs_ReffICE(sunlit(:),2:numModisTauBins+1,:)              = jointHistogram2(:, :, :)
       modisSim%Optical_Thickness_vs_ReffLIQ(sunlit(:),2:numModisTauBins+1,:)              = jointHistogram3(:, :, :)
-      ! 
+
       ! Reorder pressure bins in joint histogram to go from surface to TOA 
-      !
+
       modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:,:,:) = modisSim%Optical_Thickness_vs_Cloud_Top_Pressure(:, :, numModisPressureBins:1:-1)
       if(nSunlit < nPoints) then 
-        !
+
         ! Where it's night and we haven't done the retrievals the values are undefined
-        !
+
         modisSim%Cloud_Fraction_Total_Mean(notSunlit(:)) = R_UNDEF
         modisSim%Cloud_Fraction_Water_Mean(notSunlit(:)) = R_UNDEF
@@ -310,7 +301,7 @@
       end if 
     else
-      !
+
       ! It's nightime everywhere - everything is undefined
-      !
+
       modisSim%Cloud_Fraction_Total_Mean(:) = R_UNDEF
       modisSim%Cloud_Fraction_Water_Mean(:) = R_UNDEF
@@ -350,7 +341,7 @@
     integer,           intent(in)  :: Npoints  ! Number of sampled points
     type(cosp_MODIS),  intent(out) :: x
-    !
+
     ! Allocate minumum storage if simulator not used
-    !
+
     if (cfg%LMODIS_sim) then
       x%nPoints  = nPoints
@@ -398,8 +389,7 @@
   SUBROUTINE FREE_COSP_MODIS(x)
     type(cosp_MODIS),intent(inout) :: x
-    !
+
     ! Free space used by cosp_modis variable. 
-    !
-    
+
     if(associated(x%Cloud_Fraction_Total_Mean)) deallocate(x%Cloud_Fraction_Total_Mean) 
     if(associated(x%Cloud_Fraction_Water_Mean)) deallocate(x%Cloud_Fraction_Water_Mean) 
@@ -439,8 +429,8 @@
     type(cosp_modis),      intent(in   ) :: orig
     type(cosp_modis),      intent(  out) :: copy
-    !
+
     ! Copy a set of grid points from one cosp_modis variable to another.
     !   Should test to be sure ix and iy refer to the same number of grid points 
-    !
+
     integer :: orig_start, orig_end, copy_start, copy_end
     
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_radar.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_radar.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_radar.F90	(revision 5099)
@@ -1,8 +1,8 @@
 ! (c) British Crown Copyright 2008, the Met Office.
 ! All rights reserved.
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -13,5 +13,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_simulator.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_simulator.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -25,9 +25,7 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-!
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
 ! Jan 2013 - G. Cesana - Add new variables linked to the lidar cloud phase 
-!
 
 #include "cosp_defs.h" 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_stats.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_stats.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_stats.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_stats.F90 $
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted
 ! provided that the following conditions are met:
-!
+
 !     * Redistributions of source code must retain the above copyright notice, this list
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written
 !       permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
@@ -25,5 +25,4 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-!
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
@@ -34,6 +33,6 @@
 ! Jan 2013 - G. Cesana        - Added betaperp and temperature arguments 
 !                             - Added phase 3D/3Dtemperature/Map output variables in diag_lidar 
-!
-!
+
+
 #include "cosp_defs.h" 
 MODULE MOD_COSP_STATS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_types.F90	(revision 5099)
@@ -1,8 +1,8 @@
 ! (c) British Crown Copyright 2008, the Met Office.
 ! All rights reserved.
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -13,5 +13,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_cosp_utils.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/cosp_utils.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -25,8 +25,6 @@
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-!
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
-!
 
 MODULE MOD_COSP_UTILS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_llnl_stats.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_llnl_stats.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_llnl_stats.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/llnl/llnl_stats.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       nor the names of its contributors may be used to endorse or promote products derived from 
 !       this software without specific prior written permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -24,10 +24,8 @@
 ! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
-!
+
 ! Jan 2013 - G. Cesana        - Added betaperp_tot and temp_tot arguments 
-!
-
 
 MODULE MOD_LLNL_STATS
@@ -62,5 +60,5 @@
    ! bmin: mimumum value of first bin
    ! bwidth: bin width
-   !
+
    ! Output: 2D histogram on each horizontal point (Npoints,Nbins,Nlevels)
    
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_lmd_ipsl_stats.F90	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 15:08:38 +0100 (mer. 13 nov. 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/actsim/lmd_ipsl_stats.F90 $
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted
 ! provided that the following conditions are met:
-!
+
 !     * Redistributions of source code must retain the above copyright notice, this list
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       contributors may be used to endorse or promote products derived from this software without
 !       specific prior written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
@@ -38,8 +38,8 @@
                   ,cfad2,srbval,ncat,ntype,lidarcld,lidarcldtype,lidarcldphase,cldlayer & !OPAQ
                   ,cldtype,cldlayerphase,lidarcldtmp,parasolrefl,vgrid_z,profSR)          !OPAQ !TIBO
-!
+
 ! -----------------------------------------------------------------------------------
 ! Lidar outputs :
-!
+
 ! Diagnose cloud fraction (3D cloud fraction + low/middle/high/total cloud fraction)
 ! and phase cloud fraction (3D, low/mid/high/total and 3D temperature)
@@ -47,7 +47,7 @@
 !      +
 ! Compute CFADs of lidar scattering ratio SR and of depolarization index
-!
+
 ! Authors: Sandrine Bony and Helene Chepfer (LMD/IPSL, CNRS, UPMC, France).
-!
+
 ! December 2008, S. Bony,  H. Chepfer and J-L. Dufresne :
 ! - change of the cloud detection threshold S_cld from 3 to 5, for better
@@ -62,5 +62,5 @@
 ! June 2010, T. Yokohata, T. Nishimura and K. Ogochi
 ! Optimisation of COSP_CFAD_SR
-!
+
 ! January 2013, G. Cesana, H. Chepfer:
 ! - Add the perpendicular component of the backscattered signal (pnorm_perp) in the arguments
@@ -73,5 +73,5 @@
 ! Reference: Cesana G. and H. Chepfer (2013): Evaluation of the cloud water phase
 ! in a climate model using CALIPSO-GOCCP, J. Geophys. Res., doi: 10.1002/jgrd.50376
-!
+
 ! ------------------------------------------------------------------------------------
 
@@ -133,10 +133,8 @@
       real, parameter  ::  S_cld_att = 30. ! New threshold for undefine cloud phase detection	
 
-
-!
 ! c -------------------------------------------------------
 ! c 0- Initializations
 ! c -------------------------------------------------------
-!
+
 !  Should be modified in future version
       xmax=undef-1.0
@@ -174,5 +172,5 @@
 ! c -------------------------------------------------------
       if (ok_lidar_cfad) then
-!
+
 ! c CFADs of subgrid-scale lidar scattering ratios :
 ! c -------------------------------------------------------
@@ -224,8 +222,8 @@
 ! S_att: Threshold for full attenuation
 ! S_clr: Threshold for clear-sky layer
-!
+
 !--- Input-Outout arguments
 ! x: variable to process (Npoints,Ncolumns,Nlevels), mofified where saturation occurs
-!
+
 ! -- Output arguments
 ! srbval : values of the histogram bins
@@ -528,5 +526,4 @@
           enddo
           endif
-!
 
           iz=1
@@ -600,8 +597,8 @@
 
 !____________________________________________________________________________________________________
-!
+
 !4.1.a Ice: ATBperp above the phase discrimination line
 !____________________________________________________________________________________________________
-!
+
            if( (ATBperp(i,ncol,nlev)-ATBperp_tmp).ge.0. )then   ! Ice clouds
              ! ICE with temperature above 273,15°K = Liquid (false ice)
@@ -645,8 +642,8 @@
 
 !____________________________________________________________________________________________________
-!
+
 ! 4.1.b Liquid: ATBperp below the phase discrimination line
 !____________________________________________________________________________________________________
-!
+
              else                                        ! Liquid clouds
               ! Liquid with temperature above 231,15°K
@@ -710,8 +707,8 @@
                           ATB(i,ncol,nlev)*epsilon50 + zeta50
 !____________________________________________________________________________________________________
-!
+
 ! 4.2.a Ice: ATBperp above the phase discrimination line
 !____________________________________________________________________________________________________
-!
+
             ! ICE with temperature above 273,15°K = Liquid (false ice)
           if( (ATBperp(i,ncol,nlev)-ATBperp_tmp).ge.0. )then   ! Ice clouds
@@ -756,8 +753,8 @@
 
 !____________________________________________________________________________________________________
-!
+
 ! 4.2.b Liquid: ATBperp below the phase discrimination line
 !____________________________________________________________________________________________________
-!
+
           else  
              ! Liquid with temperature above 231,15°K
@@ -816,9 +813,9 @@
 
 !____________________________________________________________________________________________________
-!
+
 ! Undefined phase: For a cloud located below another cloud with SR>30 
 ! see Cesana and Chepfer 2013 Sect.III.2
 !____________________________________________________________________________________________________
-!
+
 if(toplvlsat.ne.0)then     	
       do nlev=toplvlsat,1,-1
@@ -849,8 +846,7 @@
 
 !____________________________________________________________________________________________________
-!
+
 ! Computation of final cloud phase diagnosis
 !____________________________________________________________________________________________________
-!
 
 ! Compute the Ice percentage in cloud = ice/(ice+liq) as a function
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_modis_sim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_modis_sim.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/mod_modis_sim.F90	(revision 5099)
@@ -4,8 +4,8 @@
 ! $Revision: 88 $, $Date: 2013-11-13 07:08:38 -0700 (Wed, 13 Nov 2013) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/MODIS_simulator/modis_simulator.F90 $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -16,5 +16,5 @@
 !       to endorse or promote products derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
@@ -25,7 +25,5 @@
 ! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
 ! OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
-
-!
+
 ! History:
 !   May 2009 - Robert Pincus - Initial version
@@ -34,7 +32,5 @@
 !   November 2009 - Robert Pincus - Bux fixes and speed-ups after experience with Rick Hemler using AM2 (GFDL) 
 !   January 2010 - Robert Pincus - Added high, middle, low cloud fractions 
-!
-
-!
+
 ! Notes on using the MODIS simulator: 
 !  *) You may provide either layer-by-layer values of optical thickness at 0.67 and 2.1 microns, or 
@@ -47,8 +43,7 @@
 !     libraries (parameters re_water_min, re_ice_min, etc.) the simulator returns missing values (re_fill)
 
-!
 ! When error conditions are encountered this code calls the function complain_and_die, supplied at the 
 !   bottom of this module. Users probably want to replace this with something more graceful. 
-!
+
 module mod_modis_sim
   USE MOD_COSP_TYPES, only: R_UNDEF, ok_debug_cosp
@@ -56,10 +51,9 @@
   ! ------------------------------
   ! Algorithmic parameters
-  !
- 
+
   real, parameter :: ice_density          = 0.93               ! liquid density is 1.  
-  !
+
   ! Retrieval parameters
-  !
+
   real, parameter :: min_OpticalThickness = 0.3,             & ! Minimum detectable optical thickness
                      CO2Slicing_PressureLimit = 700. * 100., & ! Cloud with higher pressures use thermal methods, units Pa
@@ -73,8 +67,8 @@
   
   logical, parameter :: useSimpleReScheme = .false. 
-  !
+
   ! These are the limits of the libraries for the MODIS collection 5 algorithms 
   !   They are also the limits used in the fits for g and w0
-  !
+
   real,    parameter :: re_water_min= 4., re_water_max= 30., re_ice_min= 5., re_ice_max= 90.
   integer, parameter :: num_trial_res = 15             ! increase to make the linear pseudo-retrieval of size more accurate
@@ -82,7 +76,7 @@
 !  logical, parameter :: use_two_re_iterations = .false. ! do two retrieval iterations? 
 ! DJS2015 END  
-  !
+
   ! Precompute near-IR optical params vs size for retrieval scheme
-  !
+
   integer, private :: i 
   real, dimension(num_trial_res), parameter :: & 
@@ -94,5 +88,5 @@
   ! ------------------------------
   ! Bin boundaries for the joint optical thickness/cloud top pressure histogram
-  !
+
   integer, parameter :: numTauHistogramBins = 6, numPressureHistogramBins = 7
 
@@ -103,7 +97,7 @@
     pressureHistogramBoundaries = (/ 0., 18000., 31000., 44000., 56000., 68000., 80000., 1000000. /) 
   real, parameter :: highCloudPressureLimit = 440. * 100., lowCloudPressureLimit = 680. * 100.
-  !
+
   ! For output - nominal bin centers and  bin boundaries. On output pressure bins are highest to lowest. 
-  !
+
   integer, private :: k, l
   real, parameter, dimension(2, numTauHistogramBins) ::   &
@@ -155,5 +149,5 @@
   !     subroutine modis_L2_simulator_oneTau, or 
   !  2) Provide ice and liquid optical depths in each layer
-  !
+
   interface modis_L2_simulator
     module procedure modis_L2_simulator_oneTau, modis_L2_simulator_twoTaus
@@ -162,8 +156,8 @@
   !------------------------------------------------------------------------------------------------
   ! MODIS simulator using specified liquid and ice optical thickness in each layer 
-  !
+
   !   Note: this simulator operates on all points; to match MODIS itself night-time 
   !     points should be excluded
-  !
+
   !   Note: the simulator requires as input the optical thickness and cloud top pressure 
   !     derived from the ISCCP simulator run with parameter top_height = 1. 
@@ -171,5 +165,5 @@
   !     and reverts to a thermal algorithm much like ISCCP's. Rather than replicate that 
   !     alogrithm in this simulator we simply report the values from the ISCCP simulator. 
-  !
+
   subroutine modis_L2_simulator_twoTaus(                                       &
                                 temp, pressureLayers, pressureLevels,          &
@@ -212,8 +206,7 @@
     nSubcols = size(liquid_opticalThickness, 1)
     nLevels  = size(liquid_opticalThickness, 2) 
- 
-    !
+
     ! Initial error checks 
-    !   
+
     if(any((/ size(ice_opticalThickness, 1), size(waterSize, 1), size(iceSize, 1), &
               size(isccpTau), size(isccpCloudTopPressure),              &
@@ -234,7 +227,7 @@
              
     ! ---------------------------------------------------
-    !
+
     ! Compute the total optical thickness and the proportion due to liquid in each cell
-    !
+
     where(liquid_opticalThickness(:, :) + ice_opticalThickness(:, :) > 0.) 
       tauLiquidFraction(:, :) = liquid_opticalThickness(:, :)/(liquid_opticalThickness(:, :) + ice_opticalThickness(:, :))
@@ -243,20 +236,17 @@
     end  where 
     tauTotal(:, :) = liquid_opticalThickness(:, :) + ice_opticalThickness(:, :) 
-    
-    !
+
     ! Optical depth retrieval 
     !   This is simply a sum over the optical thickness in each layer 
     !   It should agree with the ISCCP values after min values have been excluded 
-    !
+
     retrievedTau(:) = sum(tauTotal(:, :), dim = 2)
 
-    !
     ! Cloud detection - does optical thickness exceed detection threshold? 
-    !
+
     cloudMask = retrievedTau(:) >= min_OpticalThickness
-    
-    !
+
     ! Initialize initial estimates for size retrievals
-    !
+
     if(any(cloudMask) .and. .not. useSimpleReScheme) then 
       g_w(:)  = get_g_nir(  phaseIsLiquid, trial_re_w(:))
@@ -268,5 +258,5 @@
     do i = 1, nSubCols
       if(cloudMask(i)) then 
-        !
+
         ! Cloud top pressure determination 
         !   MODIS uses CO2 slicing for clouds with tops above about 700 mb and thermal methods for clouds
@@ -276,15 +266,13 @@
         ! This assumes linear variation in p between levels. Linear in ln(p) is probably better, 
         !   though we'd need to deal with the lowest pressure gracefully. 
-        !
+
         retrievedCloudTopPressure(i) = cloud_top_pressure((/ 0., tauTotal(i, :) /), &
                                                           pressureLevels,           &
                                                           CO2Slicing_TauLimit)  
-        
-        
-        !
+
         ! Phase determination - determine fraction of total tau that's liquid 
         ! When ice and water contribute about equally to the extinction we can't tell 
         !   what the phase is 
-        !
+
         integratedLiquidFraction = weight_by_extinction(tauTotal(i, :),          &
                                                         tauLiquidFraction(i, :), &
@@ -297,11 +285,10 @@
           retrievedPhase(i) = phaseIsUndetermined
         end if 
-        
-        !
+
         ! Size determination 
-        !
+
         if(useSimpleReScheme) then 
           !   This is the extinction-weighted size considering only the phase we've chosen 
-          !
+
           if(retrievedPhase(i) == phaseIsIce) then 
             retrievedSize(i) = weight_by_extinction(ice_opticalThickness(i, :),  &
@@ -323,7 +310,7 @@
         end if 
       else 
-        !
+
         ! Values when we don't think there's a cloud. 
-        !
+
         retrievedCloudTopPressure(i) = R_UNDEF 
         retrievedPhase(i) = phaseIsNone
@@ -337,5 +324,5 @@
     !   mimics what MODIS does to first order. 
     !   Of course, ISCCP cloud top pressures are in mb. 
-    !   
+
     where(cloudMask(:) .and. retrievedCloudTopPressure(:) > CO2Slicing_PressureLimit) &
       retrievedCloudTopPressure(:) = isccpCloudTopPressure * 100. 
@@ -343,8 +330,8 @@
   end subroutine modis_L2_simulator_twoTaus
   !------------------------------------------------------------------------------------------------
-  !
+
   ! MODIS simulator: provide a single optical thickness and the cloud ice and liquid contents; 
   !   we'll partition this into ice and liquid optical thickness and call the full MODIS simulator 
-  ! 
+
   subroutine modis_L2_simulator_oneTau(                                         &
                                 temp, pressureLayers, pressureLevels,           &
@@ -399,7 +386,7 @@
         tauLiquidFraction(:, :) = 0. 
       elsewhere 
-        ! 
+
         ! Geometic optics limit - tau as LWP/re  (proportional to LWC/re) 
-        !
+
 ! Modif AI 02 2018 
         tauLiquidFraction(:, :) = (cloudWater(:, :)/max(waterSize(:, :), seuil) ) / &
@@ -682,12 +669,12 @@
                                         Liquid_Water_Path_Mean,          Ice_Water_Path_Mean,           &    
        Optical_Thickness_vs_Cloud_Top_Pressure)
-    !
+
     ! Inputs; dimension nPoints, nSubcols
-    !
+
     integer, dimension(:, :),   intent(in)  :: phase
     real,    dimension(:, :),   intent(in)  :: cloud_top_pressure, optical_thickness, particle_size
-    !
+
     ! Outputs; dimension nPoints
-    !
+
     real,    dimension(:),      intent(out) :: &
        Cloud_Fraction_Total_Mean,       Cloud_Fraction_Water_Mean,       Cloud_Fraction_Ice_Mean,       &
@@ -702,5 +689,5 @@
     ! ---------------------------
     ! Local variables
-    !
+
     real, parameter :: LWP_conversion = 2./3. * 1000. ! MKS units  
     integer :: i, j
@@ -714,7 +701,7 @@
     nPoints  = size(phase, 1) 
     nSubcols = size(phase, 2) 
-    !
+
     ! Array conformance checks
-    !
+
     if(any( (/ size(cloud_top_pressure, 1), size(optical_thickness, 1), size(particle_size, 1),                                &
                size(Cloud_Fraction_Total_Mean),       size(Cloud_Fraction_Water_Mean),       size(Cloud_Fraction_Ice_Mean),    &
@@ -728,16 +715,14 @@
     if(any( (/ size(cloud_top_pressure, 2), size(optical_thickness, 2), size(particle_size, 2) /)  /= nSubcols)) &
       call complain_and_die("Some L3 arrays have wrong number of subcolumns") 
-    
-    
-    !
+
     ! Include only those pixels with successful retrievals in the statistics 
-    !
+
     validRetrievalMask(:, :) = particle_size(:, :) > 0.
     cloudMask      = phase(:, :) /= phaseIsNone   .and. validRetrievalMask(:, :)
     waterCloudMask = phase(:, :) == phaseIsLiquid .and. validRetrievalMask(:, :)
     iceCloudMask   = phase(:, :) == phaseIsIce    .and. validRetrievalMask(:, :)
-    !
+
     ! Use these as pixel counts at first 
-    !
+
     Cloud_Fraction_Total_Mean(:) = real(count(cloudMask,      dim = 2))
     Cloud_Fraction_Water_Mean(:) = real(count(waterCloudMask, dim = 2))
@@ -747,8 +732,7 @@
     Cloud_Fraction_Low_Mean(:)  = real(count(cloudMask .and. cloud_top_pressure >  lowCloudPressureLimit,  dim = 2)) 
     Cloud_Fraction_Mid_Mean(:)  = Cloud_Fraction_Total_Mean(:) - Cloud_Fraction_High_Mean(:) - Cloud_Fraction_Low_Mean(:)
-    
-    !
+
     ! Don't want to divide by 0, even though the sums will be 0 where the pixel counts are 0. 
-    !
+
     where (Cloud_Fraction_Total_Mean == 0) Cloud_Fraction_Total_Mean = -1. 
     where (Cloud_Fraction_Water_Mean == 0) Cloud_Fraction_Water_Mean = -1.
@@ -780,8 +764,7 @@
                              / Cloud_Fraction_Ice_Mean(:)
 
-    !
     ! Normalize pixel counts to fraction
     !   The first three cloud fractions have been set to -1 in cloud-free areas, so set those places to 0.
-    ! 
+
     Cloud_Fraction_Total_Mean(:) = max(0., Cloud_Fraction_Total_Mean(:)/nSubcols)
     Cloud_Fraction_Water_Mean(:) = max(0., Cloud_Fraction_Water_Mean(:)/nSubcols)
@@ -794,5 +777,5 @@
     ! ----
     ! Joint histogram 
-    ! 
+
     do i = 1, numTauHistogramBins 
       where(cloudMask(:, :)) 
@@ -826,9 +809,8 @@
     real,               intent(in) :: tauLimit
     real                           :: cloud_top_pressure
-    !
+
     ! Find the extinction-weighted pressure. Assume that pressure varies linearly between 
     !   layers and use the trapezoidal rule.
-    !
-    
+
     real :: deltaX, totalTau, totalProduct
     integer :: i 
@@ -839,8 +821,8 @@
         deltaX = tauLimit - totalTau
         totalTau = totalTau + deltaX
-        !
+
         ! Result for trapezoidal rule when you take less than a full step
         !   tauIncrement is a layer-integrated value
-        !
+
         totalProduct = totalProduct           &
                      + pressure(i-1) * deltaX &
@@ -859,8 +841,7 @@
     real,               intent(in) :: tauLimit
     real                           :: weight_by_extinction
-    !
+
     ! Find the extinction-weighted value of f(tau), assuming constant f within each layer
-    !
-    
+
     real    :: deltaX, totalTau, totalProduct
     integer :: i 
@@ -892,7 +873,7 @@
     ice_g(:)    = get_g_nir(  phaseIsIce,    ice_size) 
     ice_w0(:)   = get_ssa_nir(phaseIsIce,    ice_size) 
-    !
+
     ! Combine ice and water optical properties
-    !
+
     g(:) = 0; w0(:) = 0. 
     tau(:) = ice_tau(:) + water_tau(:) 
@@ -913,5 +894,5 @@
       real,    intent(in) :: tau, obs_Refl_nir
       real                :: retrieve_re
-      !
+
       ! Finds the re that produces the minimum mis-match between predicted and observed reflectance in 
       !   MODIS band 7 (near IR)
@@ -920,9 +901,9 @@
       !  two-stream for layer reflectance and transmittance as a function of optical thickness tau, g, and w0
       !  adding-doubling for total reflectance 
-      !  
-      !
-      !
+
+
+
       ! Local variables
-      !
+
       real, parameter :: min_distance_to_boundary = 0.01
       real    :: re_min, re_max, delta_re
@@ -946,12 +927,12 @@
         w0(:)  = w0_i(:)
       end if
-      !
+
       ! 1st attempt at index: w/coarse re resolution
-      !
+
       predicted_Refl_nir(:) = two_stream_reflectance(tau, g(:), w0(:))
       retrieve_re = interpolate_to_min(trial_re(:), predicted_Refl_nir(:), obs_Refl_nir) 
-      !
+
       ! If first retrieval works, can try 2nd iteration using greater re resolution 
-      !
+
 ! DJS2015: Remove unused piece of code      
 !      if(use_two_re_iterations .and. retrieve_re > 0.) then
@@ -959,5 +940,5 @@
 !        re_max = retrieve_re + delta_re
 !        delta_re = (re_max - re_min)/real(num_trial_res-1)
-!  
+
 !        trial_re(:) = re_min + delta_re * (/ (i - 1, i = 1, num_trial_res) /) 
 !        g(:)  = get_g_nir(  phase, trial_re(:))
@@ -977,8 +958,8 @@
     real,               intent(in) :: yobs
     real                           :: interpolate_to_min
-    ! 
+
     ! Given a set of values of y as y(x), find the value of x that minimizes abs(y - yobs)
     !   y must be monotonic in x
-    !
+
     real, dimension(size(x)) :: diff
     integer                  :: nPoints, minDiffLoc, lowerBound, upperBound
@@ -1005,7 +986,7 @@
     
     if(diff(lowerBound) * diff(upperBound) < 0) then     
-      !
+
       ! Interpolate the root position linearly if we bracket the root
-      !
+
       interpolate_to_min = x(upperBound) - & 
                            diff(upperBound) * (x(upperBound) - x(lowerBound)) / (diff(upperBound) - diff(lowerBound))
@@ -1020,9 +1001,8 @@
   ! --------------------------------------------
   elemental function get_g_nir (phase, re)
-    !
+
     ! Polynomial fit for asummetry parameter g in MODIS band 7 (near IR) as a function 
     !   of size for ice and water
     ! Fits from Steve Platnick
-    !
 
     integer, intent(in) :: phase
@@ -1056,9 +1036,9 @@
         real,    intent(in) :: re
         real                :: get_ssa_nir
-        !
+
         ! Polynomial fit for single scattering albedo in MODIS band 7 (near IR) as a function 
         !   of size for ice and water
         ! Fits from Steve Platnick
-        !
+
         real, dimension(4), parameter :: ice_coefficients   = (/ 0.9625, -1.8069e-2, 3.3281e-4,-2.2865e-6/)
         real, dimension(3), parameter :: water_coefficients = (/ 1.0044, -1.1397e-2, 1.3300e-4 /)
@@ -1107,7 +1087,7 @@
     integer                               :: i
     ! ---------------------------------------
-    !
+
     ! This wrapper reports reflectance only and strips out non-cloudy elements from the calculation
-    !
+
     cloudMask = tau(:) > 0. 
     cloudIndicies = pack((/ (i, i = 1, size(tau)) /), mask = cloudMask) 
@@ -1125,8 +1105,8 @@
     real, intent(in)  :: tauint, gint, w0int
     real, intent(out) :: ref, tra
-    !
+
     ! Compute reflectance in a single layer using the two stream approximation 
     !   The code itself is from Lazaros Oreopoulos via Steve Platnick 
-    !
+
     ! ------------------------
     ! Local variables 
@@ -1137,8 +1117,8 @@
     real :: tau, w0, g, f, gamma1, gamma2, gamma3, gamma4, &
             rh, a1, a2, rk, r1, r2, r3, r4, r5, t1, t2, t3, t4, t5, beta, e1, e2, ef1, ef2, den, th
-    !
+
     ! Compute reflectance and transmittance in a single layer using the two stream approximation 
     !   The code itself is from Lazaros Oreopoulos via Steve Platnick 
-    !
+
     f   = gint**2
     tau = (1 - w0int * f) * tauint
@@ -1204,8 +1184,8 @@
     real, intent(in) :: tauint, gint, w0int
     real             :: two_stream_reflectance
-    !
+
     ! Compute reflectance in a single layer using the two stream approximation 
     !   The code itself is from Lazaros Oreopoulos via Steve Platnick 
-    !
+
     ! ------------------------
     ! Local variables 
@@ -1279,8 +1259,7 @@
       real,    dimension(:), intent(in)  :: Refl,     Tran
       real,                  intent(out) :: Refl_tot, Tran_tot
-      !
+
       ! Use adding/doubling formulas to compute total reflectance and transmittance from layer values
-      !
-      
+
       integer :: i
       real, dimension(size(Refl)) :: Refl_cumulative, Tran_cumulative
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/optics_lib.F90	(revision 5099)
@@ -4,5 +4,5 @@
 ! Compiled/Modified:
 !   07/01/06  John Haynes (haynes@atmos.colostate.edu)
-!
+
 ! m_wat (subroutine)
 ! m_ice (subroutine)
@@ -19,19 +19,19 @@
   subroutine m_wat(freq, tk, n_r, n_i)
   implicit none
-!  
+
 ! Purpose:
 !   compute complex index of refraction of liquid water
-!
+
 ! Inputs:
 !   [freq]    frequency (GHz)
 !   [tk]       temperature (K)
-!
+
 ! Outputs:
 !   [n_r]     real part index of refraction
 !   [n_i]     imaginary part index of refraction
-!
+
 ! Reference:
 !   Based on the work of Ray (1972)
-!
+
 ! Coded:
 !   03/22/05  John Haynes (haynes@atmos.colostate.edu)
@@ -83,19 +83,19 @@
   subroutine m_ice(freq,t,n_r,n_i)
   implicit none
-!
+
 ! Purpose:
 !   compute complex index of refraction of ice
-!
+
 ! Inputs:
 !   [freq]    frequency (GHz)
 !   [t]       temperature (K)
-!
+
 ! Outputs:
 !   [n_r]     real part index of refraction
 !   [n_i]     imaginary part index of refraction
-!
+
 ! Reference:
 !    Fortran 90 port from IDL of REFICE by Stephen G. Warren
-!
+
 ! Modified:
 !   05/31/05  John Haynes (haynes@atmos.colostate.edu)
@@ -121,21 +121,21 @@
 ! Allowable wavelength range extends from 0.045 microns to 8.6 meter
 ! temperature dependence only considered beyond 167 microns.
-! 
+
 ! interpolation is done     n_r  vs. log(xlam)
 !                           n_r  vs.        t
 !                       log(n_i) vs. log(xlam)
 !                       log(n_i) vs.        t
-!
+
 ! Stephen G. Warren - 1983
 ! Dept. of Atmospheric Sciences
 ! University of Washington
 ! Seattle, Wa  98195
-!
+
 ! Based on
-!
+
 !    Warren,S.G.,1984.
 !    Optical constants of ice from the ultraviolet to the microwave.
 !    Applied Optics,23,1206-1225
-!
+
 ! Reference temperatures are -1.0,-5.0,-20.0, and -60.0 deg C
  
@@ -576,5 +576,5 @@
 ! subroutine MIEINT
 ! ----------------------------------------------------------------------------
-!
+
 !     General purpose Mie scattering routine for single particles
 !     Author: R Grainger 1990
@@ -583,5 +583,5 @@
 !     code to ensure correct calculation of backscatter coeficient
 !     Options/Extend_Source
-!
+
       Subroutine MieInt(Dx, SCm, Inp, Dqv, Dqxt, Dqsc, Dbsc, Dg, Xs1, Xs2, DPh, Error)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/pf_to_mr.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/pf_to_mr.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/pf_to_mr.F	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/llnl/pf_to_mr.f $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       nor the names of its contributors may be used to endorse or promote products derived from 
 !       this software without specific prior written permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/prec_scops.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/prec_scops.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/prec_scops.F	(revision 5099)
@@ -3,8 +3,8 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/llnl/prec_scops.f $
-! 
+
 ! Redistribution and use in source and binary forms, with or without modification, are permitted 
 ! provided that the following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above copyright notice, this list 
 !       of conditions and the following disclaimer.
@@ -15,5 +15,5 @@
 !       nor the names of its contributors may be used to endorse or promote products derived from 
 !       this software without specific prior written permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR 
 ! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator.F90	(revision 5099)
@@ -17,32 +17,32 @@
   
 ! Purpose:
-!
+
 !   Simulates a vertical profile of radar reflectivity
 !   Originally Part of QuickBeam v1.04 by John Haynes & Roger Marchand.
 !   but has been substantially modified since that time by
 !   Laura Fowler and Roger Marchand (see modifications below).
-!
+
 ! Inputs:
-!
+
 !   [hp]              structure that defines hydrometeor types and other radar properties
-!
+
 !   [nprof]           number of hydrometeor profiles
 !   [ngate]           number of vertical layers
-!
+
 !   [undef]           missing data value
 !   (The following 5 arrays must be in order from closest to the radar
 !    to farthest...)
-!
+
 !   [hgt_matrix]      height of hydrometeors (km)
 !   [p_matrix]        pressure profile (hPa)
 !   [t_matrix]        temperature profile (K)
 !   [rh_matrix]       relative humidity profile (%) -- only needed if gaseous aborption calculated.
-!
+
 !   [hm_matrix]       table of hydrometeor mixing rations (g/kg)
 !   [re_matrix]       table of hydrometeor effective radii.  0 ==> use defaults. (units=microns)    
 !   [Np_matrix]	      table of hydrometeor number concentration.  0 ==> use defaults. (units = 1/kg)
-!
+
 ! Outputs:
-!
+
 !   [Ze_non]          radar reflectivity without attenuation (dBZ)
 !   [Ze_ray]          Rayleigh reflectivity (dBZ)
@@ -50,5 +50,5 @@
 !   [g_atten_to_vol]  gaseous atteunation, radar to vol (dB)
 !   [dBZe]            effective radar reflectivity factor (dBZ)
-!
+
 ! Optional:
 !   [g_to_vol_in]     integrated atten due to gases, r>v (dB).
@@ -57,8 +57,8 @@
 !   [g_to_vol_out]    integrated atten due to gases, r>v (dB).
 !                     If present then gaseous absorption for each profile is returned here.
-!
+
 ! Created:
 !   11/28/2005  John Haynes (haynes@atmos.colostate.edu)
-!
+
 ! Modified:
 !   09/2006  placed into subroutine form (Roger Marchand,JMH)
@@ -66,5 +66,5 @@
 !   01/2008  'Do while' to determine if hydrometeor(s) present in volume
 !             changed for vectorization purposes (A. Bodas-Salcedo)
-!
+
 !   07/2010  V3.0 ... Modified to load or save scale factors to disk as a Look-Up Table (LUT)
 !  ... All hydrometeor and radar simulator properties now included in hp structure
@@ -73,12 +73,12 @@
 !     Also ... Support of Morrison 2-moment style microphyscis (Np_matrix) added 
 !  ... Changes implement by Roj Marchand following work by Laura Fowler
-!
+
 !   10/2011  Modified ngate loop to go in either direction depending on flag 
 !     hp%radar_at_layer_one.  This affects the direction in which attenuation is summed.
-!
+
 !     Also removed called to AVINT for gas and hydrometeor attenuation and replaced with simple
 !     summation. (Roger Marchand)
-!
-!
+
+
 ! ----- INPUTS -----  
  
@@ -153,7 +153,6 @@
   g_to_vol_out_present = present(g_to_vol_out)
 
-  !
   ! load scaling matricies from disk -- but only the first time this subroutine is called
-  !
+
   if(hp%load_scale_LUTs) then
     call load_scale_LUTs(hp)
@@ -223,5 +222,5 @@
           if(Re.gt.0) then
             ! determine index in to scale LUT
-            !
+
             ! distance between Re points (defined by "base" and "step") for
             ! each interval of size Re_BIN_LENGTH
@@ -278,5 +277,5 @@
                 ! alternative is to comment out above two lines and use the following block
                 ! MG Mie approach - adjust density of sphere with D = D_characteristic to match particle density
-                !
+
                 ! hp%rho_eff(tp,1:ns,iRe_type) = (6/pi)*hp%apm(tp)*(Di*1E-6)**(hp%bpm(tp)-3)   !MG Mie approach
 
@@ -373,5 +372,5 @@
 
       !     :: attenuation due to hydrometeors between radar and volume
-      !
+
       ! NOTE old scheme integrates attenuation only for the layers ABOVE
       ! the current layer ... i.e. 1 to k-1 rather than 1 to k ...
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator_init.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator_init.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/radar_simulator_init.F90	(revision 5099)
@@ -12,43 +12,43 @@
   
 ! Purpose:
-!
+
 !   Initialize variables used by the radar simulator.
 !   Part of QuickBeam v3.0 by John Haynes and Roj Marchand
-!   
-!
+
+
 ! Inputs:  
 !   []   from data in hydrometeor class input 
-! 
+
 !   [freq]            radar frequency (GHz)
-!
+
 !   [k2]              |K|^2, the dielectric constant, set to -1 to use the
 !                     frequency dependent default
-!
+
 !   [use_gas_abs]     1=do gaseous abs calcs, 0=no gasesous absorbtion calculated,
 !                     2=calculate (and use) absorption for first profile on all profiles
-!
+
 !   [undef]           mising data value
 !   [nhclass]         number of hydrometeor types
-!
+
 !   For each hydrometero type:
 !       hclass_type     Type of distribution (see quickbeam documentation)
 !       hclass_phase            1==ice, 0=liquid
-!
+
 !       hclass_dmin         minimum diameter allowed is drop size distribution N(D<Dmin)=0
 !       hclass_dmax         maximum diameter allowed is drop size distribution N(D>Dmax)=0
-!
+
 !   hclass_apm,hclass_bpm   Density of partical apm*D^bpm or constant = rho
 !   hclass_rho, 
-!   
+
 !       hclass_p1,hclass_p2,    Default values of DSD parameters (see quickbeam documentation)
 !   hclass_p3, 
-!
+
 !   load_scale_LUTs_flag    Flag, load scale factors Look Up Table from file at start of run
 !   update_scale_LUTs_flag  Flag, save new scale factors calculated during this run to LUT
 !   LUT_file_name       Name of file containing LUT
-!
+
 ! Outputs:
 !   [hp]            structure that define hydrometeor types
-!
+
 ! Modified:
 !   08/23/2006  placed into subroutine form (Roger Marchand)
@@ -75,8 +75,7 @@
   integer :: i,j
   real*8  :: delt, deltp
-        
-    !
+
     ! set radar simulation properites
-    !
+
     hp%freq=freq
     hp%k2=k2
@@ -88,8 +87,7 @@
     hp%update_scale_LUTs=update_scale_LUTs_flag
     hp%scale_LUT_file_name=LUT_file_name
-    
-    ! 
+
         ! Store settings for hydrometeor types in hp (class_parameter) structure.   
-        !
+
         do i = 1,nhclass
         hp%dtype(i) = hclass_type(i)
@@ -104,8 +102,7 @@
         hp%p3(i)    = hclass_p3(i)
         enddo
-   
-        ! 
+
         ! initialize scaling array
-        !
+
         hp%N_scale_flag = .false.
         hp%fc = undef
@@ -116,8 +113,7 @@
         hp%Zr_scaled = 0.0
         hp%kr_scaled = 0.0
-  
-        !
+
     ! set up Re bin "structure" for z_scaling
-        !
+
     hp%base_list(1)=0;
     do j=1,Re_MAX_BIN
@@ -131,7 +127,6 @@
     enddo
 
-    !
     ! set up Temperature bin structure used for z scaling
-    !
+
     do i=1,cnt_ice
         hp%mt_tti(i)=(i-1)*5-90 + 273.15
@@ -141,8 +136,7 @@
         hp%mt_ttl(i)=(i-1)*5-60 + 273.15
     enddo 
-  
-    !
+
         ! define array discrete diameters used in mie calculations
-        !
+
         delt = (log(dmax)-log(dmin))/(nd-1)
         deltp = exp(delt)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scale_luts_io.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scale_luts_io.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scale_luts_io.F90	(revision 5099)
@@ -1,4 +1,4 @@
   ! scale_LUT_io:  Contains subroutines to load and save scaling Look Up Tables (LUTs) to a file
-  ! 
+
   ! June 2010   Written by Roj Marchand
   
@@ -16,8 +16,7 @@
     logical :: LUT_file_exists
     integer :: i,j,k,ind
-    
-    !
+
     ! load scale LUT from file 
-    !
+
     inquire(file=trim(hp%scale_LUT_file_name) // '_radar_Z_scale_LUT.dat', &
         exist=LUT_file_exists)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scops.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scops.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/scops.F	(revision 5099)
@@ -8,9 +8,9 @@
 ! $Revision: 23 $, $Date: 2011-03-31 15:41:37 +0200 (jeu. 31 mars 2011) $
 ! $URL: http://cfmip-obs-sim.googlecode.com/svn/stable/v1.4.0/icarus-scops-4.1-bsd/scops.f $
-! 
+
 ! Redistribution and use in source and binary forms, with or without 
 ! modification, are permitted provided that the
 ! following conditions are met:
-! 
+
 !     * Redistributions of source code must retain the above 
 !       copyright  notice, this list of conditions and the following 
@@ -24,5 +24,5 @@
 !       derived from this software without specific prior written 
 !       permission.
-! 
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 ! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
@@ -36,5 +36,5 @@
 ! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
-! 
+
 ! *****************************COPYRIGHT*******************************
 ! *****************************COPYRIGHT*******************************
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/zeff.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/zeff.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cosp/zeff.F90	(revision 5099)
@@ -10,5 +10,5 @@
 !   Part of QuickBeam v1.03 by John Haynes
 !   http://reef.atmos.colostate.edu/haynes/radarsim
-!
+
 ! Inputs:
 !   [freq]      radar frequency (GHz)
@@ -23,10 +23,10 @@
 !   [qs]        ... efficiencies; otherwise set to -1
 !   [rho_e]     medium effective density (kg m^-3) (-1 = pure)
-!
+
 ! Outputs:
 !   [z_eff]     unattenuated effective reflectivity factor (mm^6/m^3)
 !   [z_ray]     reflectivity factor, Rayleigh only (mm^6/m^3)
 !   [kr]        attenuation coefficient (db km^-1)
-!
+
 ! Created:
 !   11/28/05  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/MISR_simulator.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2009, Roger Marchand, version 1.2
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Modified for COSPv2.0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/array_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/array_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/array_lib.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,10 +26,10 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! 10/16/03  John Haynes   - Original version (haynes@atmos.colostate.edu)
 ! 01/31/06  John Haynes   - IDL to Fortran 90
 ! 01/01/15  Dustin Swales - Modified for COSPv2.0
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 module array_lib
@@ -47,5 +47,5 @@
     !   Finds the index of an array that is closest to a value, plus the
     !   difference between the value found and the value specified
-    !
+
     ! Inputs:
     !   [list]   an array of sequential values
@@ -53,14 +53,14 @@
     ! Optional input:
     !   [sort]   set to 1 if [list] is in unknown/non-sequential order
-    !
+
     ! Returns:
     !   index of [list] that is closest to [val]
-    !
+
     ! Optional output:
     !   [dist]   set to variable containing [list([result])] - [val]
-    !
+
     ! Requires:
     !   mrgrnk library
-    !
+
     ! ##########################################################################
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -26,10 +26,10 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015- D. Swales - Original version
 ! Mar 2018- R. Guzman - Added OPAQ diagnostics and GLID simulator
 ! Apr 2018- R. Guzman - Added ATLID simulator
-!
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_atlid_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_atlid_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_atlid_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! Apr 2018 - R. Guzman - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_calipso_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_calipso_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_calipso_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Original version
@@ -69,5 +69,5 @@
     ! derived from CALIPSO-GOCCP observations at 120m vertical grid 
     ! (Cesana and Chepfer, JGR, 2013).
-    !
+
     ! Relationship between ATBice and ATBperp,ice for ice particles:
     !                ATBperp,ice = Alpha*ATBice 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_cloudsat_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_cloudsat_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_cloudsat_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_config.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_config.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_config.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
@@ -39,5 +39,5 @@
 ! Mar 2018 - R. Guzman        - Added LIDAR_NTYPE for the OPAQ diagnostics
 ! Apr 2018 - R. Guzman        - Added parameters for GROUND LIDAR and ATLID simulators
-!
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_errorHandling.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_errorHandling.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_errorHandling.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015- D. Swales - Original version
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_grLidar532_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_grLidar532_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_grLidar532_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! Apr 2018 - R. Guzman - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_isccp_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_isccp_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_isccp_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_kinds.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_kinds.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_kinds.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015- D. Swales - Original version
-!
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 MODULE cosp_kinds
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_misr_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_misr_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_misr_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_modis_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_modis_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_modis_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_optics.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,10 +26,10 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! 05/01/15  Dustin Swales - Original version
 ! 04/04/18  Rodrigo Guzman- Added CALIOP-like Ground LIDar routines (GLID)
 ! 10/04/18  Rodrigo Guzman- Added ATLID-like (EarthCare) lidar routines (ATLID)
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 module cosp_optics
@@ -50,5 +50,5 @@
   ! ##########################################################################
   !                          COSP_SIMULATOR_OPTICS
-  !
+
   ! Used by: ISCCP, MISR and MODIS simulators
   ! ##########################################################################
@@ -107,5 +107,5 @@
   ! ##############################################################################
   !                           MODIS_OPTICS_PARTITION
-  !
+
   ! For the MODIS simulator, there are times when only a sinlge optical depth
   ! profile, cloud-ice and cloud-water are provided. In this case, the optical
@@ -154,5 +154,5 @@
   ! ########################################################################################
   !                                   MODIS_OPTICS
-  ! 
+
   ! ########################################################################################
   subroutine modis_optics(nPoints,nLevels,nSubCols,tauLIQ,sizeLIQ,tauICE,sizeICE,fracLIQ, g, w0)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_parasol_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_parasol_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_parasol_interface.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Original version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_phys_constants.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_phys_constants.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_phys_constants.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015- D. Swales - Original version
-!
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 MODULE cosp_phys_constants
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_stats.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_utils.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_utils.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/cosp_utils.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,9 +26,9 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! Jul 2007 - A. Bodas-Salcedo - Initial version
 ! May 2015 - Dustin Swales    - Modified for COSPv2.0
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 MODULE MOD_COSP_UTILS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/icarus.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2009, Lawrence Livemore National Security Limited Liability
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Modified for COSPv2.0
@@ -251,5 +251,5 @@
        ! ############################################################################
        !                        Clear-sky radiance calculation
-       !       
+
        ! Compute water vapor continuum emissivity this treatment follows Schwarkzopf 
        ! and Ramasamy JGR 1999,vol 104, pages 9467-9499. The emissivity is calculated
@@ -329,5 +329,5 @@
        ! #################################################################################  
        !                            Cloud-Top Temperature
-       !
+
        ! Now that you have the top of atmosphere radiance, account for ISCCP 
        ! procedures to determine cloud top temperature account for partially
@@ -392,5 +392,5 @@
     ! ####################################################################################
     !                           Cloud-Top Pressure
-    !
+
     ! The 2 methods differ according to whether or not you use the physical cloud
     ! top pressure (isccp_top_height = 2) or the radiatively determined cloud top
@@ -516,5 +516,5 @@
     ! ####################################################################################
     !                 Determines ISCCP cloud type frequencies
-    !
+
     ! Now that boxptop and boxtau have been determined, determine amount of each of the 
     ! 49 ISCCP cloud types. Also compute grid box mean cloud top pressure and 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lidar_simulator.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2009, Centre National de la Recherche Scientifique
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,19 +26,19 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2007: ActSim code of M. Chiriaco and H. Chepfer rewritten by S. Bony
-!
+
 ! May 2008, H. Chepfer:
 ! - Units of pressure inputs: Pa 
 ! - Non Spherical particles : LS Ice NS coefficients, CONV Ice NS coefficients
 ! - New input: ice_type (0=ice-spheres ; 1=ice-non-spherical)
-!
+
 ! June 2008, A. Bodas-Salcedo:
 ! - Ported to Fortran 90 and optimisation changes
-!
+
 ! August 2008, J-L Dufresne:
 ! - Optimisation changes (sum instructions suppressed)
-!
+
 ! October 2008, S. Bony,  H. Chepfer and J-L. Dufresne :  
 ! - Interface with COSP v2.0:
@@ -47,16 +47,16 @@
 !      depolarisation diagnostic removed
 !      parasol (polder) reflectances (for 5 different solar zenith angles) added
-!
+
 ! December 2008, S. Bony,  H. Chepfer and J-L. Dufresne : 
 ! - Modification of the integration of the lidar equation.
 ! - change the cloud detection threshold
-!
+
 ! April 2008, A. Bodas-Salcedo:
 ! - Bug fix in computation of pmol and pnorm of upper layer
-!
+
 ! April 2008, J-L. Dufresne
 ! - Bug fix in computation of pmol and pnorm, thanks to Masaki Satoh: a factor 2 
 ! was missing. This affects the ATB values but not the cloud fraction. 
-!
+
 ! January 2013, G. Cesana and H. Chepfer:
 ! - Add the perpendicular component of the backscattered signal (pnorm_perp_tot) in the arguments
@@ -65,10 +65,10 @@
 ! Reference: Cesana G. and H. Chepfer (2013): Evaluation of the cloud water phase
 ! in a climate model using CALIPSO-GOCCP, J. Geophys. Res., doi: 10.1002/jgrd.50376
-!
+
 ! May 2015 - D. Swales - Modified for COSPv2.0
-!
+
 ! Mar 2018 - R. Guzman - Added OPAQ subroutines
 ! References OPAQ:
-!
+
 !       Guzman et al. (2017): Direct atmosphere opacity observations from CALIPSO provide 
 ! new constraints on cloud-radiation interactions. JGR-Atmospheres, DOI: 10.1002/2016JD025946
@@ -76,5 +76,5 @@
 ! the altitude at which a spaceborne lidar beam is fully attenuated. AMT, 10, 4659-4685,
 ! https://doi.org/10.5194/amt-10-4659-2017
-!
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 module mod_lidar_simulator
@@ -90,5 +90,5 @@
   ! derived from CALIPSO-GOCCP observations at 120m vertical grid 
   ! (Cesana and Chepfer, JGR, 2013).
-  !
+
   ! Relationship between ATBice and ATBperp,ice for ice particles:
   !                ATBperp,ice = Alpha*ATBice 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_construct_destroy_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_construct_destroy_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_construct_destroy_mod.F90	(revision 5099)
@@ -1,6 +1,6 @@
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! Module pour construir et detruire les variables "cospIN", "cospstateIN" et "cospOUT"
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -118,5 +118,5 @@
   ! ######################################################################################
   ! SUBROUTINE construct_cosp_outputs
-  !
+
   ! This subroutine allocates output fields based on input logical flag switches.
   ! ######################################################################################  
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_interface.F90	(revision 5099)
@@ -1,4 +1,4 @@
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! Nouveau code d'interface entre LMDZ et COSPv2 (version 2)
 ! L'ancienne interface s'appelait "phys_cosp2" et avait ete concue pour COSPv1.4.
@@ -9,8 +9,8 @@
 ! Cette version de COSP propose aussi de nombreux nouveaux diagnostics, notamment pour
 ! le simulateur lidar (diagnostics CALIPSO-OPAQ, lidar sol 532nm et lidar ATLID 355nm).
-!
+
 ! Interface reecrite par R.Guzman (01/2019), a partir de l'interface initiale concue
 ! et ecrite par A.Idelkadi 
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 !  subroutine phys_cosp2( itap,dtime,freq_cosp, &
@@ -87,7 +87,7 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! Declaration des variables 
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -211,7 +211,7 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 1) Lecture du fichier "cosp_input_nl.txt", parametres d'entree pour COSP
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -356,7 +356,7 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 3) Calculs des champs d'entree COSP a partir des variables LMDZ
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -427,8 +427,8 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 4a) On construit la variable cospOUT qui contient tous les diagnostics de sortie.
 ! Elle sera remplie lors de l'appel du simulateur COSP
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -437,8 +437,8 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 4b) On construit la variable cospstateIN que l'on va remplir avec les champs LMDZ
 ! Les champ verticaux doivent etre donnes a l'envers, c-a-d : (Nlevels:1) = (TOA:SFC)
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -463,10 +463,10 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 4c) On construit la variable cospIN qui contient les proprietes optiques subcolumn
 ! pour COSP. Elle sera essentiellement remplie dans la subroutine subsample_and_optics
 ! ou sont appeles SCOPS, PREC_SCOPS et les subroutines qui calculent les signaux
 ! simules pour chaque simulateur actif.
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -477,8 +477,8 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 5) Appel de subsample_and_optics : Les champs verticaux doivent etre donnes a
 ! l'envers comme pour le remplissage de cospstateIN, c-a-d : (Nlevels:1) = (TOA:SFC)
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -503,7 +503,7 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 6) On appelle le simulateur COSPv2 
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -516,10 +516,10 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 7a) Ecriture des sorties 1: on cree d'abord les fichiers NCDF pour ecrire les sorties
 ! en appelant lmdz_cosp_output_open (lors du premier appel de cette interface pour les
 ! 2 options d'ecriture), ou sont definis les axes et les caracteristiques
 ! des fichiers de sortie avec les diagnostics.
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -541,14 +541,14 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 7b) Ecriture des sorties 2: le remplissage des fichiers de sortie se fait a chaque
 ! appel de cette interface avec une difference entre les 2 options d'ecriture:
-!
+
 ! AVEC xios, on commence a remplir les fichiers de sortie a partir du DEUXIEME
 ! appel de cette interface (lorsque cosp_init_flag = 1).
-!
+
 ! SANS xios, on commence a remplir les fichiers de sortie a partir du PREMIER
 ! appel de cette interface (lorsque cosp_init_flag = 1).
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
@@ -558,7 +558,7 @@
 
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! 8) On libere la memoire allouee lors de cet appel a l'interface
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_mod.F90	(revision 5099)
@@ -3,9 +3,9 @@
 !! La routine cosp_output_open (appelee 1 seule fois dans phy_cosp.F90) permet :
 !! de creer les fichiers avec leurs grilles horizontales et verticales
-!
+
 ! R.Guzman jan 2019 (mise a jour pour COSPv2)
 ! On change le nom du module a "lmdz_cosp_output_mod" et celui de la routine a "lmdz_cosp_output_open"
 ! pour qu'on sache qu'il s'agit d'un module specifique a l'implementation de COSP dans LMDZ
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   MODULE lmdz_cosp_output_mod
@@ -347,5 +347,5 @@
 !!! Variables d'entree
 
-  ! ug Variables utilisées pour récupérer le calendrier pour xios
+  ! ug Variables utilis�es pour r�cup�rer le calendrier pour xios
   INTEGER :: x_an, x_mois, x_jour
   REAL :: x_heure
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_output_write_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
 !!!! Abderrahmane Idelkadi aout 2013 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! Module pour definir (au 1er appel) et ecrire les variables dans les fichiers de sortie cosp
-!
+
 ! R.Guzman jan 2019 (mise a jour pour COSPv2)
 ! On change le nom du module a "lmdz_cosp_output_write_mod" et celui de la routine a "lmdz_cosp_output_write"
 ! pour qu on sache qu il s agit d un module specifique a l implementation de COSP dans LMDZ
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    MODULE lmdz_cosp_output_write_mod
@@ -669,6 +669,6 @@
     CHARACTER(LEN=20) :: typeecrit
 
-    ! ug On rÃ©cupÃ¨re le type Ã©crit de la structure:
-    !       Assez moche, Ã|  refaire si meilleure mÃ©thode...
+    ! ug On récupère le type écrit de la structure:
+    !       Assez moche, �|  refaire si meilleure méthode...
     IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN
        typeecrit = 'once'
@@ -765,6 +765,6 @@
       END IF
 
-    ! ug On rÃ©cupÃ¨re le type Ã©crit de la structure:
-    !       Assez moche, Ã|  refaire si meilleure mÃ©thode...
+    ! ug On récupère le type écrit de la structure:
+    !       Assez moche, �|  refaire si meilleure méthode...
     IF (INDEX(var%cosp_typeecrit(iff), "once") > 0) THEN
        typeecrit = 'once'
@@ -827,9 +827,9 @@
     IF (prt_level >= 9) WRITE(lunout,*)'Begin histrwrite2d ',var%name
 
-  ! On regarde si on est dans la phase de dÃ©finition ou d'Ã©criture:
+  ! On regarde si on est dans la phase de définition ou d'écriture:
   IF(.NOT.cosp_varsdefined) THEN
 !$OMP MASTER
       print*,'var, cosp_varsdefined dans cosp_varsdefined ',var%name, cosp_varsdefined
-      !Si phase de dÃ©finition.... on dÃ©finit
+      !Si phase de définition.... on définit
       CALL conf_cospoutputs(var%name,var%cles)
       DO iff=1, 3
@@ -840,5 +840,5 @@
 !$OMP END MASTER
   ELSE
-    !Et sinon on.... Ã©crit
+    !Et sinon on.... écrit
     IF (SIZE(field)/=klon) &
   CALL abort_physic('iophy::histwrite2d_cosp','Field first DIMENSION not equal to klon',1) 
@@ -921,7 +921,7 @@
                nom=var%name
       END IF
-  ! On regarde si on est dans la phase de dÃ©finition ou d'Ã©criture:
+  ! On regarde si on est dans la phase de définition ou d'écriture:
   IF(.NOT.cosp_varsdefined) THEN
-      !Si phase de dÃ©finition.... on dÃ©finit
+      !Si phase de définition.... on définit
 !$OMP MASTER
       CALL conf_cospoutputs(var%name,var%cles)
@@ -933,5 +933,5 @@
 !$OMP END MASTER
   ELSE
-    !Et sinon on.... Ã©crit
+    !Et sinon on.... écrit
     IF (SIZE(field,1)/=klon) &
    CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)                                  
@@ -1000,5 +1000,5 @@
 
   IF(cosp_varsdefined) THEN
-    !Et sinon on.... Ã©crit
+    !Et sinon on.... écrit
     IF (SIZE(field,1)/=klon) &
    CALL abort_physic('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)            
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/lmdz_cosp_subsample_and_optics_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! Module pour remplir la variable "cospIN", calculs des proprietes optiques subcolumn
 ! pour les differents simulateurs
-!
+
 !%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/math_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/math_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/math_lib.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,9 +26,9 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! July 2006: John Haynes      - Initial version
 ! May 2015:  Dustin Swales    - Modified for COSPv2.0
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 module math_lib
@@ -49,5 +49,5 @@
     !   evalues the integral (f ds) between f(index=i1) and f(index=i2)
     !   using the AVINT procedure
-    !
+
     ! Inputs:
     !   [f]    functional values
@@ -55,14 +55,14 @@
     !   [i1]   index of lower limit
     !   [i2]   index of upper limit
-    !
+
     ! Returns:
     !   result of path integral
-    !
+
     ! Notes:
     !   [s] may be in forward or reverse numerical order
-    !
+
     ! Requires:
     !   mrgrnk package
-    !
+
     ! Created:
     !   02/02/06  John Haynes (haynes@atmos.colostate.edu)
@@ -114,5 +114,5 @@
     ! Purpose:
     !   estimate the integral of unevenly spaced data
-    !
+
     ! Inputs:
     !   [ftab]     functional values
@@ -121,31 +121,31 @@
     !   [a]        lower limit of integration
     !   [b]        upper limit of integration
-    !
+
     ! Outputs:
     !   [result]   approximate value of integral
-    !
+
     ! Reference:
     !   From SLATEC libraries, in public domain
-    !
+
     !***********************************************************************
-    !
+
     !  AVINT estimates the integral of unevenly spaced data.
-    !
+
     !  Discussion:
-    !
+
     !    The method uses overlapping parabolas and smoothing.
-    !
+
     !  Modified:
-    !
+
     !    30 October 2000
     !    4 January 2008, A. Bodas-Salcedo. Error control for XTAB taken out of
     !                    loop to allow vectorization.
-    !
+
     !  Reference:
-    !
+
     !    Philip Davis and Philip Rabinowitz,
     !    Methods of Numerical Integration,
     !    Blaisdell Publishing, 1967.
-    !
+
     !    P E Hennion,
     !    Algorithm 77,
@@ -153,25 +153,25 @@
     !    Communications of the Association for Computing Machinery,
     !    Volume 5, page 96, 1962.
-    !
+
     !  Parameters:
-    !
+
     !    Input, real ( kind = 8 ) FTAB(NTAB), the function values,
     !    FTAB(I) = F(XTAB(I)).
-    !
+
     !    Input, real ( kind = 8 ) XTAB(NTAB), the abscissas at which the
     !    function values are given.  The XTAB's must be distinct
     !    and in ascending order.
-    !
+
     !    Input, integer NTAB, the number of entries in FTAB and
     !    XTAB.  NTAB must be at least 3.
-    !
+
     !    Input, real ( kind = 8 ) A, the lower limit of integration.  A should
     !    be, but need not be, near one endpoint of the interval
     !    (X(1), X(NTAB)).
-    !
+
     !    Input, real ( kind = 8 ) B, the upper limit of integration.  B should
     !    be, but need not be, near one endpoint of the interval
     !    (X(1), X(NTAB)).
-    !
+
     !    Output, real ( kind = 8 ) RESULT, the approximate value of the integral.
     ! ##########################################################################  
@@ -328,11 +328,11 @@
   ! Purpose:
   !   Returns the gamma function
-  !
+
   ! Input:
   !   [x]   value to compute gamma function of
-  !
+
   ! Returns:
   !   gamma(x)
-  !
+
   ! Coded:
   !   02/02/06  John Haynes (haynes@atmos.colostate.edu)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mo_rng.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mo_rng.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mo_rng.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015- D. Swales - Original version
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 MODULE mod_rng
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/modis_simulator.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2009:      Robert Pincus - Initial version
@@ -37,5 +37,5 @@
 ! May 2015:      Dustin Swales - Modified for COSPv2.0
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-!
+
 ! Notes on using the MODIS simulator: 
 !  *) You may provide either layer-by-layer values of optical thickness at 0.67 and 2.1
@@ -48,9 +48,9 @@
 !     the MODIS retrieval libraries (parameters re_water_min, re_ice_min, etc.) the 
 !     simulator returns missing values (re_fill)
-!
+
 ! When error conditions are encountered this code calls the function complain_and_die, 
 ! supplied at the bottom of this module. Users probably want to replace this with 
 ! something more graceful. 
-!
+
 module mod_modis_sim
   USE MOD_COSP_CONFIG, only: R_UNDEF,modis_histTau,modis_histPres,numMODISTauBins,       &
@@ -102,8 +102,8 @@
   ! ########################################################################################
   ! MODIS simulator using specified liquid and ice optical thickness in each layer 
-  !
+
   ! Note: this simulator operates on all points; to match MODIS itself night-time 
   !       points should be excluded
-  !
+
   ! Note: the simulator requires as input the optical thickness and cloud top pressure 
   !       derived from the ISCCP simulator run with parameter top_height = 1. 
@@ -443,8 +443,8 @@
         deltaX = tauLimit - totalTau
         totalTau = totalTau + deltaX
-        !
+
         ! Result for trapezoidal rule when you take less than a full step
         !   tauIncrement is a layer-integrated value
-        !
+
         totalProduct = totalProduct           &
                      + pressure(i-1) * deltaX &
@@ -534,7 +534,7 @@
     
     if(diff(lowerBound) * diff(upperBound) < 0) then     
-      !
+
       ! Interpolate the root position linearly if we bracket the root
-      !
+
       interpolate_to_min = x(upperBound) - & 
                            diff(upperBound) * (x(upperBound) - x(lowerBound)) / (diff(upperBound) - diff(lowerBound))
@@ -611,9 +611,8 @@
   
   elemental function get_g_nir (phase, re)
-    !
+
     ! Polynomial fit for asummetry parameter g in MODIS band 7 (near IR) as a function 
     !   of size for ice and water
     ! Fits from Steve Platnick
-    !
 
     integer, intent(in) :: phase
@@ -647,9 +646,9 @@
         real(wp),    intent(in) :: re
         real(wp)                :: get_ssa_nir
-        !
+
         ! Polynomial fit for single scattering albedo in MODIS band 7 (near IR) as a function 
         !   of size for ice and water
         ! Fits from Steve Platnick
-        !
+
         real(wp), dimension(4), parameter :: ice_coefficients   = (/ 0.9625, -1.8069e-2, 3.3281e-4,-2.2865e-6/)
         real(wp), dimension(3), parameter :: water_coefficients = (/ 1.0044, -1.1397e-2, 1.3300e-4 /)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mrgrnk.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mrgrnk.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/mrgrnk.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015:  Dustin Swales    - Modified for COSPv2.0
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 Module m_mrgrnk
@@ -56,9 +56,9 @@
     ! __________________________________________________________
     Real (wp) :: XVALA, XVALB
-    !
+
     Integer, Dimension (SIZE(IRNGT)) :: JWRKT
     Integer :: LMTNA, LMTNC, IRNG1, IRNG2
     Integer :: NVAL, IIND, IWRKD, IWRK, IWRKF, JINDA, IINDA, IINDB
-    !
+
     NVAL = Min (SIZE(XDONT), SIZE(IRNGT))
     Select Case (NVAL)
@@ -71,7 +71,7 @@
        Continue
     End Select
-    !
+
     ! Fill-in the index array, creating ordered couples
-    !
+
     Do IIND = 2, NVAL, 2
        If (XDONT(IIND-1) <= XDONT(IIND)) Then
@@ -86,35 +86,35 @@
        IRNGT (NVAL) = NVAL
     End If
-    !
+
     ! We will now have ordered subsets A - B - A - B - ...
     ! and merge A and B couples into C - C - ...
-    !
+
     LMTNA = 2
     LMTNC = 4
-    !
+
     ! First iteration. The length of the ordered subsets goes from 2 to 4
-    !
+
     Do
        If (NVAL <= 2) Exit
-       !
+
        ! Loop on merges of A and B into C
-       !
+
        Do IWRKD = 0, NVAL - 1, 4
           If ((IWRKD+4) > NVAL) Then
              If ((IWRKD+2) >= NVAL) Exit
-             !
+
              ! 1 2 3
-             !
+
              If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Exit
-             !
+
              ! 1 3 2
-             !
+
              If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                 IRNG2 = IRNGT (IWRKD+2)
                 IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
                 IRNGT (IWRKD+3) = IRNG2
-                !
+
                 ! 3 1 2
-                !
+
              Else
                 IRNG1 = IRNGT (IWRKD+1)
@@ -125,11 +125,11 @@
              Exit
           End If
-          !
+
           ! 1 2 3 4
-          !
+
           If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Cycle
-          !
+
           ! 1 3 x x
-          !
+
           If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
              IRNG2 = IRNGT (IWRKD+2)
@@ -143,7 +143,7 @@
                 IRNGT (IWRKD+4) = IRNG2
              End If
-             !
+
              ! 3 x x x
-             !
+
           Else
              IRNG1 = IRNGT (IWRKD+1)
@@ -168,21 +168,21 @@
           End If
        End Do
-       !
+
        ! The Cs become As and Bs
-       !
+
        LMTNA = 4
        Exit
     End Do
-    !
+
     ! Iteration loop. Each time, the length of the ordered subsets
     ! is doubled.
-    !
+
     Do
        If (LMTNA >= NVAL) Exit
        IWRKF = 0
        LMTNC = 2 * LMTNC
-       !
+
        ! Loop on merges of A and B into C
-       !
+
        Do
           IWRK = IWRKF
@@ -196,25 +196,25 @@
           IINDA = 1
           IINDB = JINDA + 1
-          !
+
           ! Shortcut for the case when the max of A is smaller
           ! than the min of B. This line may be activated when the
           ! initial set is already close to sorted.
-          !
+
           ! IF (XDONT(IRNGT(JINDA)) <= XDONT(IRNGT(IINDB))) CYCLE
-          !
+
           ! One steps in the C subset, that we build in the final rank array
-          !
+
           ! Make a copy of the rank array for the merge iteration
-          !
+
           JWRKT (1:LMTNA) = IRNGT (IWRKD:JINDA)
-          !
+
           XVALA = XDONT (JWRKT(IINDA))
           XVALB = XDONT (IRNGT(IINDB))
-          !
+
           Do
              IWRK = IWRK + 1
-             !
+
              ! We still have unprocessed values in both A and B
-             !
+
              If (XVALA > XVALB) Then
                 IRNGT (IWRK) = IRNGT (IINDB)
@@ -232,15 +232,15 @@
                 XVALA = XDONT (JWRKT(IINDA))
              End If
-             !
+
           End Do
        End Do
-       !
+
        ! The Cs become As and Bs
-       !
+
        LMTNA = 2 * LMTNA
     End Do
-    !
+
     Return
-    !
+
   End Subroutine D_mrgrnk
   
@@ -256,9 +256,9 @@
     ! __________________________________________________________
     Real(wp) :: XVALA, XVALB
-    !
+
     Integer, Dimension (SIZE(IRNGT)) :: JWRKT
     Integer :: LMTNA, LMTNC, IRNG1, IRNG2
     Integer :: NVAL, IIND, IWRKD, IWRK, IWRKF, JINDA, IINDA, IINDB
-    !
+
     NVAL = Min (SIZE(XDONT), SIZE(IRNGT))
     Select Case (NVAL)
@@ -271,7 +271,7 @@
        Continue
     End Select
-    !
+
     ! Fill-in the index array, creating ordered couples
-    !
+
     Do IIND = 2, NVAL, 2
        If (XDONT(IIND-1) <= XDONT(IIND)) Then
@@ -286,35 +286,35 @@
        IRNGT (NVAL) = NVAL
     End If
-    !
+
     ! We will now have ordered subsets A - B - A - B - ...
     ! and merge A and B couples into C - C - ...
-    !
+
     LMTNA = 2
     LMTNC = 4
-    !
+
     ! First iteration. The length of the ordered subsets goes from 2 to 4
-    !
+
     Do
        If (NVAL <= 2) Exit
-       !
+
        ! Loop on merges of A and B into C
-       !
+
        Do IWRKD = 0, NVAL - 1, 4
           If ((IWRKD+4) > NVAL) Then
              If ((IWRKD+2) >= NVAL) Exit
-             !
+
              ! 1 2 3
-             !
+
              If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Exit
-             !
+
              ! 1 3 2
-             !
+
              If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                 IRNG2 = IRNGT (IWRKD+2)
                 IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
                 IRNGT (IWRKD+3) = IRNG2
-                !
+
                 ! 3 1 2
-                !
+
              Else
                 IRNG1 = IRNGT (IWRKD+1)
@@ -325,11 +325,11 @@
              Exit
           End If
-          !
+
           ! 1 2 3 4
-          !
+
           If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Cycle
-          !
+
           ! 1 3 x x
-          !
+
           If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
              IRNG2 = IRNGT (IWRKD+2)
@@ -343,7 +343,7 @@
                 IRNGT (IWRKD+4) = IRNG2
              End If
-             !
+
              ! 3 x x x
-             !
+
           Else
              IRNG1 = IRNGT (IWRKD+1)
@@ -368,21 +368,21 @@
           End If
        End Do
-       !
+
        ! The Cs become As and Bs
-       !
+
        LMTNA = 4
        Exit
     End Do
-    !
+
     ! Iteration loop. Each time, the length of the ordered subsets
     ! is doubled.
-    !
+
     Do
        If (LMTNA >= NVAL) Exit
        IWRKF = 0
        LMTNC = 2 * LMTNC
-       !
+
        ! Loop on merges of A and B into C
-       !
+
        Do
           IWRK = IWRKF
@@ -396,25 +396,25 @@
           IINDA = 1
           IINDB = JINDA + 1
-          !
+
           ! Shortcut for the case when the max of A is smaller
           ! than the min of B. This line may be activated when the
           ! initial set is already close to sorted.
-          !
+
           ! IF (XDONT(IRNGT(JINDA)) <= XDONT(IRNGT(IINDB))) CYCLE
-          !
+
           ! One steps in the C subset, that we build in the final rank array
-          !
+
           ! Make a copy of the rank array for the merge iteration
-          !
+
           JWRKT (1:LMTNA) = IRNGT (IWRKD:JINDA)
-          !
+
           XVALA = XDONT (JWRKT(IINDA))
           XVALB = XDONT (IRNGT(IINDB))
-          !
+
           Do
              IWRK = IWRK + 1
-             !
+
              ! We still have unprocessed values in both A and B
-             !
+
              If (XVALA > XVALB) Then
                 IRNGT (IWRK) = IRNGT (IINDB)
@@ -432,15 +432,15 @@
                 XVALA = XDONT (JWRKT(IINDA))
              End If
-             !
+
           End Do
        End Do
-       !
+
        ! The Cs become As and Bs
-       !
+
        LMTNA = 2 * LMTNA
     End Do
-    !
+
     Return
-    !
+
   End Subroutine R_mrgrnk
   Subroutine I_mrgrnk (XDONT, IRNGT)
@@ -455,9 +455,9 @@
     ! __________________________________________________________
     Integer :: XVALA, XVALB
-    !
+
     Integer, Dimension (SIZE(IRNGT)) :: JWRKT
     Integer :: LMTNA, LMTNC, IRNG1, IRNG2
     Integer :: NVAL, IIND, IWRKD, IWRK, IWRKF, JINDA, IINDA, IINDB
-    !
+
     NVAL = Min (SIZE(XDONT), SIZE(IRNGT))
     Select Case (NVAL)
@@ -470,7 +470,7 @@
        Continue
     End Select
-    !
+
     ! Fill-in the index array, creating ordered couples
-    !
+
     Do IIND = 2, NVAL, 2
        If (XDONT(IIND-1) <= XDONT(IIND)) Then
@@ -485,35 +485,35 @@
        IRNGT (NVAL) = NVAL
     End If
-    !
+
     ! We will now have ordered subsets A - B - A - B - ...
     ! and merge A and B couples into C - C - ...
-    !
+
     LMTNA = 2
     LMTNC = 4
-    !
+
     ! First iteration. The length of the ordered subsets goes from 2 to 4
-    !
+
     Do
        If (NVAL <= 2) Exit
-       !
+
        ! Loop on merges of A and B into C
-       !
+
        Do IWRKD = 0, NVAL - 1, 4
           If ((IWRKD+4) > NVAL) Then
              If ((IWRKD+2) >= NVAL) Exit
-             !
+
              ! 1 2 3
-             !
+
              If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Exit
-             !
+
              ! 1 3 2
-             !
+
              If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
                 IRNG2 = IRNGT (IWRKD+2)
                 IRNGT (IWRKD+2) = IRNGT (IWRKD+3)
                 IRNGT (IWRKD+3) = IRNG2
-                !
+
                 ! 3 1 2
-                !
+
              Else
                 IRNG1 = IRNGT (IWRKD+1)
@@ -524,11 +524,11 @@
              Exit
           End If
-          !
+
           ! 1 2 3 4
-          !
+
           If (XDONT(IRNGT(IWRKD+2)) <= XDONT(IRNGT(IWRKD+3))) Cycle
-          !
+
           ! 1 3 x x
-          !
+
           If (XDONT(IRNGT(IWRKD+1)) <= XDONT(IRNGT(IWRKD+3))) Then
              IRNG2 = IRNGT (IWRKD+2)
@@ -542,7 +542,7 @@
                 IRNGT (IWRKD+4) = IRNG2
              End If
-             !
+
              ! 3 x x x
-             !
+
           Else
              IRNG1 = IRNGT (IWRKD+1)
@@ -567,21 +567,21 @@
           End If
        End Do
-       !
+
        ! The Cs become As and Bs
-       !
+
        LMTNA = 4
        Exit
     End Do
-    !
+
     ! Iteration loop. Each time, the length of the ordered subsets
     ! is doubled.
-    !
+
     Do
        If (LMTNA >= NVAL) Exit
        IWRKF = 0
        LMTNC = 2 * LMTNC
-       !
+
        ! Loop on merges of A and B into C
-       !
+
        Do
           IWRK = IWRKF
@@ -595,25 +595,25 @@
           IINDA = 1
           IINDB = JINDA + 1
-          !
+
           ! Shortcut for the case when the max of A is smaller
           ! than the min of B. This line may be activated when the
           ! initial set is already close to sorted.
-          !
+
           ! IF (XDONT(IRNGT(JINDA)) <= XDONT(IRNGT(IINDB))) CYCLE
-          !
+
           ! One steps in the C subset, that we build in the final rank array
-          !
+
           ! Make a copy of the rank array for the merge iteration
-          !
+
           JWRKT (1:LMTNA) = IRNGT (IWRKD:JINDA)
-          !
+
           XVALA = XDONT (JWRKT(IINDA))
           XVALB = XDONT (IRNGT(IINDB))
-          !
+
           Do
              IWRK = IWRK + 1
-             !
+
              ! We still have unprocessed values in both A and B
-             !
+
              If (XVALA > XVALB) Then
                 IRNGT (IWRK) = IRNGT (IINDB)
@@ -631,15 +631,15 @@
                 XVALA = XDONT (JWRKT(IINDA))
              End If
-             !
+
           End Do
        End Do
-       !
+
        ! The Cs become As and Bs
-       !
+
        LMTNA = 2 * LMTNA
     End Do
-    !
+
     Return
-    !
+
   End Subroutine I_mrgrnk
 end module m_mrgrnk
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/optics_lib.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/optics_lib.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/optics_lib.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,9 +26,9 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! July 2006: John Haynes      - Initial version
 ! May 2015:  Dustin Swales    - Modified for COSPv2.0
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 module optics_lib
@@ -44,19 +44,19 @@
   subroutine m_wat(freq, tk, n_r, n_i)
     ! ############################################################################
-    !  
+
     ! Purpose:
     !   compute complex index of refraction of liquid water
-    !
+
     ! Inputs:
     !   [freq]    frequency (GHz)
     !   [tk]       temperature (K)
-    !
+
     ! Outputs:
     !   [n_r]     real part index of refraction
     !   [n_i]     imaginary part index of refraction
-    !
+
     ! Reference:
     !   Based on the work of Ray (1972)
-    !
+
     ! Coded:
     !   03/22/05  John Haynes (haynes@atmos.colostate.edu)
@@ -111,19 +111,19 @@
   subroutine m_ice(freq,t,n_r,n_i)
     ! ##########################################################################
-    !
+
     ! Purpose:
     !   compute complex index of refraction of ice
-    !
+
     ! Inputs:
     !   [freq]    frequency (GHz)
     !   [t]       temperature (K)
-    !
+
     ! Outputs:
     !   [n_r]     real part index of refraction
     !   [n_i]     imaginary part index of refraction
-    !
+
     ! Reference:
     !    Fortran 90 port from IDL of REFICE by Stephen G. Warren
-    !
+
     ! Modified:
     !   05/31/05  John Haynes (haynes@atmos.colostate.edu)
@@ -505,21 +505,21 @@
     ! Allowable wavelength range extends from 0.045 microns to 8.6 meter
     ! temperature dependence only considered beyond 167 microns.
-    ! 
+
     ! interpolation is done     n_r  vs. log(xlam)
     !                           n_r  vs.        t
     !                       log(n_i) vs. log(xlam)
     !                       log(n_i) vs.        t
-    !
+
     ! Stephen G. Warren - 1983
     ! Dept. of Atmospheric Sciences
     ! University of Washington
     ! Seattle, Wa  98195
-    !
+
     ! Based on
-    !
+
     !    Warren,S.G.,1984.
     !    Optical constants of ice from the ultraviolet to the microwave.
     !    Applied Optics,23,1206-1225
-    !
+
     ! Reference temperatures are -1.0,-5.0,-20.0, and -60.0 deg C
     ! #####################################################################
@@ -594,5 +594,5 @@
   Subroutine MieInt(Dx, SCm, Inp, Dqv, Dqxt, Dqsc, Dbsc, Dg, Xs1, Xs2, DPh, Error)
     ! ##########################################################################
-    !
+
     !     General purpose Mie scattering routine for single particles
     !     Author: R Grainger 1990
@@ -601,5 +601,5 @@
     !     code to ensure correct calculation of backscatter coeficient
     !     Options/Extend_Source
-    !
+
     ! ##########################################################################
     ! INPUTS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/parasol.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2009, Centre National de la Recherche Scientifique
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! December 2008, S. Bony,  H. Chepfer and J-L. Dufresne : 
@@ -46,9 +46,9 @@
     !          of cloud water and cloud fraction in each sub-column of each model 
     !          gridbox.
-    !
-    !
+
+
     ! December 2008, S. Bony,  H. Chepfer and J-L. Dufresne : 
     ! - optimization for vectorization
-    !
+
     ! Version 2.0 (October 2008)
     ! Version 2.1 (December 2008)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/prec_scops.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/prec_scops.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/prec_scops.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2008, Lawrence Livermore National Security Limited Liability Corporation
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015- D. Swales - Modified for COSPv2.0
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 module mod_prec_scops
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! 11/2005: John Haynes - Created
@@ -33,5 +33,5 @@
 ! 01/2008  'Do while' to determine if hydrometeor(s) present in volume
 !           changed for vectorization purposes (A. Bodas-Salcedo)
-!
+
 ! 07/2010  V3.0 ... Modified to load or save scale factors to disk as a Look-Up Table (LUT)
 !  ... All hydrometeor and radar simulator properties now included in hp structure
@@ -40,8 +40,8 @@
 !     Also ... Support of Morrison 2-moment style microphyscis (Np_matrix) added 
 !  ... Changes implement by Roj Marchand following work by Laura Fowler
-!
+
 !   10/2011  Modified ngate loop to go in either direction depending on flag 
 !     hp%radar_at_layer_one.  This affects the direction in which attenuation is summed.
-!
+
 !     Also removed called to AVINT for gas and hydrometeor attenuation and replaced with simple
 !     summation. (Roger Marchand)
@@ -315,5 +315,5 @@
   ! ######################################################################################
   ! SUBROUTINE cloudsat_precipOccurence
-  !
+
   ! Notes from July 2016: Add precip flag also looped over subcolumns
   ! Modified by Tristan L'Ecuyer (TSL) to add precipitation flagging
@@ -321,7 +321,7 @@
   ! To mimic the satellite algorithm, this code applies thresholds to non-attenuated
   ! reflectivities, Ze_non, consistent with those outlined in Haynes et al, JGR (2009).
-  !
+
   ! Procedures/Notes:
-  !
+
   ! (1) If the 2-way attenuation exceeds 40 dB, the pixel will be flagged as 'heavy rain'
   ! consistent with the multiple-scattering analysis of Battaglia et al, JGR (2008).
@@ -334,5 +334,5 @@
   ! due to differening attenuation corrections from hydrometeors aloft, the non-attenuated
   ! reflectivities used in the computation of this flag cannot vary across sub-columns.
-  !
+
   ! radar_prec_flag = 1-Rain possible 2-Rain probable 3-Rain certain 
   !                   4-Snow possible 5-Snow certain 
@@ -340,5 +340,5 @@
   !                   8-Heavy Rain
   !                   9- default value
-  !
+
   ! Modified by Dustin Swales (University of Colorado) for use with COSP2.
   ! *NOTE* All inputs (Ze_out, Ze_non_out, fracPrecipIce) are at a single level from the
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/quickbeam_optics.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2015, Regents of the University of Colorado
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,8 +26,8 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History:
 ! May 2015:  Dustin Swales - Initial version
-! 
+
 ! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 module mod_quickbeam_optics
@@ -251,5 +251,5 @@
                          ! alternative is to comment out above two lines and use the following block
                          ! MG Mie approach - adjust density of sphere with D = D_characteristic to match particle density
-                         !
+
                          ! rcfg%rho_eff(tp,1:ns,iRe_type) = (6/pi)*sd%apm(tp)*(Di*1E-6)**(sd%bpm(tp)-3)   !MG Mie approach
                          
@@ -354,16 +354,16 @@
     ! Purpose:
     !   Calculates Effective Radius (1/2 distribution 3rd moment / 2nd moment). 
-    !
+
     !   For some distribution types, the total number concentration (per kg), Np
     !   may be optionally specified.   Should be set to zero, otherwise.
-    !
+
     !   Roj Marchand July 2010
-    !
+
     ! Inputs:
-    !
+
     !   [Q]        hydrometeor mixing ratio (g/kg)  ! not needed for some distribution types
     !   [Np]       Optional Total number concentration (per kg).  0 = use defaults (p1, p2, p3)
     !   [rho_a]    ambient air density (kg m^-3)   
-    !
+
     !   Distribution parameters as per quickbeam documentation.
     !   [dtype]    distribution type
@@ -371,13 +371,13 @@
     !   [bmp]      b params for mass 
     !   [p1],[p2],[p3]  distribution parameters
-    !
+
     ! Outputs:
     !   [Re]       Effective radius, 1/2 the 3rd moment/2nd moment (um)
-    !
+
     ! Created:
     !   July 2010  Roj Marchand
     ! Modified:
     !   12/18/14  Dustin Swales: Define type REALs as double precision (dustin.swales@noaa.gov)
-    !
+
     ! ##############################################################################################
     ! ##############################################################################################
@@ -549,23 +549,23 @@
     ! Purpose:
     !   Create a discrete drop size distribution
-    !
+
     !   Starting with Quickbeam V3, this routine now allows input of 
     !   both effective radius (Re) and total number concentration (Nt)
     !   Roj Marchand July 2010
-    !
+
     !   The version in Quickbeam v.104 was modified to allow Re but not Nt 
     !   This is a significantly modified form for the version      
-    !
+
     !   Originally Part of QuickBeam v1.03 by John Haynes
     !   http://reef.atmos.colostate.edu/haynes/radarsim
-    !
+
     ! Inputs:
-    !
+
     !   [Q]        hydrometeor mixing ratio (g/kg)
     !   [Re]       Optional Effective Radius (microns).  0 = use defaults (p1, p2, p3)
-    !
+
     !   [D]        array of discrete drop sizes (um) where we desire to know the number concentraiton n(D).
     !   [nsizes]   number of elements of [D]
-    !
+
     !   [dtype]    distribution type
     !   [rho_a]    ambient air density (kg m^-3)
@@ -575,16 +575,16 @@
     !   [rho_c]    alternate constant density (kg m^-3)
     !   [p1],[p2],[p3]  distribution parameters
-    !
+
     ! Input/Output:
     !   [apm]      a parameter for mass (kg m^[-bpm])
     !   [bmp]      b params for mass
-    !
+
     ! Outputs:
     !   [N]        discrete concentrations (cm^-3 um^-1)
     !              or, for monodisperse, a constant (1/cm^3)
-    !
+
     ! Requires:
     !   function infind
-    !
+
     ! Created:
     !   11/28/05  John Haynes (haynes@atmos.colostate.edu)
@@ -868,5 +868,5 @@
     !   Part of QuickBeam v1.03 by John Haynes
     !   http://reef.atmos.colostate.edu/haynes/radarsim
-    !
+
     ! Inputs:
     !   [freq]      radar frequency (GHz)
@@ -881,10 +881,10 @@
     !   [qs]        ... efficiencies; otherwise set to -1
     !   [rho_e]     medium effective density (kg m^-3) (-1 = pure)
-    !
+
     ! Outputs:
     !   [z_eff]     unattenuated effective reflectivity factor (mm^6/m^3)
     !   [z_ray]     reflectivity factor, Rayleigh only (mm^6/m^3)
     !   [kr]        attenuation coefficient (db km^-1)
-    !
+
     ! Created:
     !   11/28/05  John Haynes (haynes@atmos.colostate.edu)
@@ -1046,5 +1046,5 @@
     ! Purpose:
     !   Compute 2-way gaseous attenuation through a volume in microwave
-    !
+
     ! Inputs:
     !   [PRES_mb]   pressure (mb) (hPa)
@@ -1052,11 +1052,11 @@
     !   [RH]        relative humidity (%)
     !   [f]         frequency (GHz), < 300 GHz
-    !
+
     ! Returns:
     !   2-way gaseous attenuation (dB/km)
-    !
+
     ! Reference:
     !   Uses method of Liebe (1985)
-    !
+
     ! Created:
     !   12/09/05  John Haynes (haynes@atmos.colostate.edu)
@@ -1234,8 +1234,8 @@
     ! ##############################################################################################
     ! Purpose:
-    !
+
     !   Initialize variables used by the radar simulator.
     !   Part of QuickBeam v3.0 by John Haynes and Roj Marchand
-    !   
+
     ! Inputs:  
     !   NAME            SIZE        DESCRIPTION
@@ -1244,5 +1244,5 @@
     ! Outputs:
     !   [sd]                        Structure that define hydrometeor types
-    !
+
     ! Local variables:
     !   [n_hydro]       (1)         Number of hydrometeor types
@@ -1265,5 +1265,5 @@
     ! ####################################################################################
     ! NOTES on HCLASS variables
-    !
+
     ! TYPE - Set to
     ! 1 for modified gamma distribution,
@@ -1272,5 +1272,5 @@
     ! 4 for monodisperse distribution,
     ! 5 for lognormal distribution.
-	!
+
     ! PHASE - Set to 0 for liquid, 1 for ice.
     ! DMIN  - The minimum drop size for this class (micron), ignored for monodisperse.
@@ -1286,8 +1286,8 @@
     ! BPM - The beta_m coefficient in equation (1), see section 4.1.
     ! RHO - Hydrometeor density (kg m-3 ).
-    ! 
+
     ! P1, P2, P3 - are default distribution parameters that depend on the type
     ! of distribution (see quickmbeam documentation for more information)
-    !
+
     ! Modified Gamma (must set P3 and one of P1 or P2)
     ! P1 - Set to the total particle number concentration Nt /rho_a (kg-1 ), where
@@ -1295,15 +1295,15 @@
     ! P2 - Set to the particle mean diameter D (micron).
     ! P3 - Set to the distribution width nu.
-    !
+
     ! Exponetial (set one of)
     ! P1 - Set to a constant intercept parameter N0 (m-4).
     ! P2 - Set to a constant lambda (micron-1).
-    !
+
     ! Power Law
     ! P1 - Set this to the value of a constant power law parameter br
-    !
+
     ! Monodisperse
     ! P1 - Set to a constant diameter D0 (micron) = Re.
-    !
+
     ! Log-normal (must set P3 and one of P1 or P2)
     ! P1 - Set to the total particle number concentration Nt /rho_a (kg-1 )
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cospv2/scops.F90	(revision 5099)
@@ -2,19 +2,19 @@
 ! Copyright (c) 2009, British Crown Copyright, the Met Office
 ! All rights reserved.
-!
+
 ! Redistribution and use in source and binary forms, with or without modification, are 
 ! permitted provided that the following conditions are met:
-!
+
 ! 1. Redistributions of source code must retain the above copyright notice, this list of 
 !    conditions and the following disclaimer.
-!
+
 ! 2. Redistributions in binary form must reproduce the above copyright notice, this list
 !    of conditions and the following disclaimer in the documentation and/or other 
 !    materials provided with the distribution.
-!
+
 ! 3. Neither the name of the copyright holder nor the names of its contributors may be 
 !    used to endorse or promote products derived from this software without specific prior
 !    written permission.
-!
+
 ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 ! EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
@@ -26,5 +26,5 @@
 ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-!
+
 ! History
 ! May 2015 - D. Swales - Modified for COSPv2.0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cpl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cpl_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cpl_mod.F90	(revision 5099)
@@ -1,14 +1,14 @@
-!
+
 MODULE cpl_mod
-!
+
 ! This module excahanges and transforms all fields that should be recieved or sent to 
 ! coupler. The transformation of the fields are done from the grid 1D-array in phylmd 
 ! to the regular 2D grid accepted by the coupler. Cumulation of the fields for each 
 ! timestep is done in here. 
-!
+
 ! Each type of surface that recevie fields from the coupler have a subroutine named 
 ! cpl_receive_XXX_fields and each surface that have fields to be sent to the coupler 
 ! have a subroutine named cpl_send_XXX_fields.
-!
+
 !*************************************************************************************
 
@@ -129,7 +129,7 @@
   
 CONTAINS
-!
+
 !************************************************************************************
-!
+
   SUBROUTINE cpl_init(dtime, rlon, rlat)
     USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day
@@ -178,5 +178,5 @@
 !*************************************************************************************
 ! Calculate coupling period
-!
+
 !*************************************************************************************
      
@@ -191,5 +191,5 @@
 !*************************************************************************************
 ! Allocate variables
-!
+
 !*************************************************************************************
     error = 0
@@ -324,5 +324,5 @@
 !*************************************************************************************
 ! Initialize the allocated varaibles
-!
+
 !*************************************************************************************
     DO ig = 1, klon
@@ -332,5 +332,5 @@
 !*************************************************************************************
 ! Initialize coupling
-!
+
 !*************************************************************************************
     idtime = INT(dtime)
@@ -341,5 +341,5 @@
 !*************************************************************************************
 ! initialize NetCDF output
-!
+
 !*************************************************************************************
     IF (is_sequential) THEN
@@ -390,5 +390,5 @@
 !*************************************************************************************
 ! compatibility test
-!
+
 !*************************************************************************************
     IF (carbon_cycle_cpl .AND. version_ocean=='opa8') THEN
@@ -398,9 +398,7 @@
 
   END SUBROUTINE cpl_init
-  
-!
-!*************************************************************************************
-!
- 
+
+!*************************************************************************************
+
   SUBROUTINE cpl_receive_frac(itime, dtime, pctsrf, is_modified)
 ! This subroutine receives from coupler for both ocean and seaice
@@ -442,5 +440,5 @@
 ! Start calculation
 ! Get fields from coupler
-!
+
 !*************************************************************************************
 
@@ -510,5 +508,5 @@
 !  Transform seaice fraction (read_sic : ocean-seaice mask) into global 
 !  fraction (pctsrf : ocean-seaice-land-landice mask)
-!
+
 !*************************************************************************************
        CALL cpl2gath(read_sic, read_sic1D, klon, unity)
@@ -530,15 +528,13 @@
   END SUBROUTINE cpl_receive_frac
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_receive_ocean_fields(knon, knindex, tsurf_new, u0_new, &
        v0_new, sss)
-!
+
 ! This routine returns the field for the ocean that has been read from the coupler
 ! (done earlier with cpl_receive_frac). The field is the temperature.
 ! The temperature is transformed into 1D array with valid points from index 1 to knon.
-!
+
     USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_ocn_day
     USE indice_sol_mod
@@ -568,5 +564,5 @@
 !*************************************************************************************
 ! Transform read_sst into compressed 1D variable tsurf_new
-!
+
 !*************************************************************************************
     CALL cpl2gath(read_sst, tsurf_new, knon, knindex)
@@ -579,5 +575,5 @@
 ! Transform read_co2 into uncompressed 1D variable fco2_ocn_day added directly in 
 ! the module carbon_cycle_mod
-!
+
 !*************************************************************************************
     IF (carbon_cycle_cpl) THEN
@@ -591,5 +587,5 @@
 ! The fields received from the coupler have to be weighted with the fraction of ocean 
 ! in relation to the total sea-ice+ocean
-!
+
 !*************************************************************************************
     DO i=1, knon
@@ -599,16 +595,13 @@
   END SUBROUTINE cpl_receive_ocean_fields
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_receive_seaice_fields(knon, knindex, &
        tsurf_new, alb_new, u0_new, v0_new)
-!
+
 ! This routine returns the fields for the seaice that have been read from the coupler
 ! (done earlier with cpl_receive_frac). These fields are the temperature and 
 ! albedo at sea ice surface and fraction of sea ice.
 ! The fields are transformed into 1D arrays with valid points from index 1 to knon. 
-!
 
 ! Input arguments
@@ -631,5 +624,5 @@
 !*************************************************************************************
 ! Transform fields read from coupler from 2D into compressed 1D variables
-!
+
 !*************************************************************************************
     CALL cpl2gath(read_sit, tsurf_new, knon, knindex)
@@ -642,5 +635,5 @@
 ! The fields received from the coupler have to be weighted with the sea-ice 
 ! concentration (in relation to the total sea-ice + ocean).
-!
+
 !*************************************************************************************
     DO i= 1, knon
@@ -651,7 +644,5 @@
   END SUBROUTINE cpl_receive_seaice_fields
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_send_ocean_fields(itime, knon, knindex, &
@@ -715,5 +706,5 @@
 ! Start calculation
 ! The ocean points are saved with second array index=1
-!
+
 !*************************************************************************************
     cpl_index = 1
@@ -721,5 +712,5 @@
 !*************************************************************************************
 ! Reset fields to zero in the beginning of a new coupling period 
-!
+
 !*************************************************************************************
     IF (MOD(itime, nexca) == 1) THEN
@@ -751,5 +742,5 @@
 !*************************************************************************************
 ! Cumulate at each time-step
-!
+
 !*************************************************************************************    
     DO ig = 1, knon
@@ -802,5 +793,5 @@
 ! fields are transformed to the 2D grid. 
 ! No sending to the coupler (it is done from cpl_send_seaice_fields).
-!
+
 !*************************************************************************************
     IF (MOD(itime, nexca) == 0) THEN
@@ -915,7 +906,5 @@
   END SUBROUTINE cpl_send_ocean_fields
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_send_seaice_fields(itime, dtime, knon, knindex, &
@@ -924,10 +913,10 @@
        precip_rain, precip_snow, evap, tsurf, fder, albsol, taux, tauy,&
        sens_prec_liq, sens_prec_sol, lat_prec_liq, lat_prec_sol)
-!
+
 ! This subroutine cumulates some fields for each time-step during a coupling 
 ! period. At last time-step in a coupling period the fields are transformed to the 
 ! grid accepted by the coupler. All fields for all types of surfaces are sent to
 ! the coupler.
-!
+
     USE carbon_cycle_mod, ONLY : carbon_cycle_cpl
     USE indice_sol_mod
@@ -962,5 +951,5 @@
 ! Start calulation
 ! The sea-ice points are saved with second array index=2
-!
+
 !*************************************************************************************
     cpl_index = 2
@@ -968,5 +957,5 @@
 !*************************************************************************************
 ! Reset fields to zero in the beginning of a new coupling period 
-!
+
 !*************************************************************************************
     IF (MOD(itime, nexca) == 1) THEN
@@ -988,5 +977,5 @@
 !*************************************************************************************
 ! Cumulate at each time-step
-!
+
 !*************************************************************************************    
     DO ig = 1, knon
@@ -1022,5 +1011,5 @@
 ! If the time-step corresponds to the end of coupling period the 
 ! fields are transformed to the 2D grid and all fields are sent to coupler.
-!
+
 !*************************************************************************************
     IF (MOD(itime, nexca) == 0) THEN
@@ -1119,15 +1108,13 @@
   END SUBROUTINE cpl_send_seaice_fields
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_send_land_fields(itime, knon, knindex, rriv_in, rcoa_in)
-!
+
 ! This subroutine cumulates some fields for each time-step during a coupling 
 ! period. At last time-step in a coupling period the fields are transformed to the 
 ! grid accepted by the coupler. No sending to the coupler will be done from here 
 ! (it is done in cpl_send_seaice_fields).
-!
+
     USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
 
@@ -1148,5 +1135,5 @@
 ! Rearrange fields in 2D variables 
 ! First initialize to zero to avoid unvalid points causing problems
-!
+
 !*************************************************************************************
 !$OMP MASTER
@@ -1159,5 +1146,5 @@
 !*************************************************************************************
 ! Reset cumulated fields to zero in the beginning of a new coupling period 
-!
+
 !*************************************************************************************
     IF (MOD(itime, nexca) == 1) THEN
@@ -1170,5 +1157,5 @@
 !*************************************************************************************
 ! Cumulate : Following fields should be cumulated at each time-step
-!
+
 !*************************************************************************************    
 !$OMP MASTER
@@ -1179,7 +1166,5 @@
   END SUBROUTINE cpl_send_land_fields
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_send_landice_fields(itime, knon, knindex, rlic_in, rlic_in_frac)
@@ -1187,5 +1172,4 @@
 ! during a coupling period. This routine will not send to coupler. Sending 
 ! will be done in cpl_send_seaice_fields.
-!
 
     USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
@@ -1208,5 +1192,5 @@
 ! Rearrange field in a 2D variable 
 ! First initialize to zero to avoid unvalid points causing problems
-!
+
 !*************************************************************************************
 !$OMP MASTER
@@ -1217,5 +1201,5 @@
 !*************************************************************************************
 ! Reset field to zero in the beginning of a new coupling period 
-!
+
 !*************************************************************************************
     IF (MOD(itime, nexca) == 1) THEN
@@ -1227,5 +1211,5 @@
 !*************************************************************************************
 ! Cumulate : Melting ice should be cumulated at each time-step
-!
+
 !*************************************************************************************    
 !$OMP MASTER
@@ -1235,7 +1219,5 @@
   END SUBROUTINE cpl_send_landice_fields
 
-!
-!*************************************************************************************
-!
+!*************************************************************************************
 
   SUBROUTINE cpl_send_all(itime, dtime, pctsrf, lafin, rlon, rlat)
@@ -1243,5 +1225,5 @@
 ! This subroutine should be executed after calculations by the last surface(sea-ice),
 ! all calculations at the different surfaces have to be done before. 
-!    
+
     USE surface_data
     USE carbon_cycle_mod, ONLY : carbon_cycle_cpl
@@ -1253,5 +1235,5 @@
 
 ! Some includes
-!    
+
 ! Input arguments
 !*************************************************************************************
@@ -1295,5 +1277,5 @@
 ! All fields are stored in a table tab_flds(:,:,:)
 ! First store the fields which are already on the right format
-!
+
 !*************************************************************************************
 !$OMP MASTER
@@ -1329,5 +1311,5 @@
 !*************************************************************************************
 ! Transform the fraction of sub-surfaces from 1D to 2D array
-!
+
 !*************************************************************************************
     pctsrf2D(:,:,:) = 0.
@@ -1342,5 +1324,5 @@
 ! Calculate the average calving per latitude
 ! Store calving in tab_flds(:,:,19)
-! 
+
 !*************************************************************************************      
     IF (is_omp_root) THEN
@@ -1403,5 +1385,5 @@
 ! Calculate total flux for snow, rain and wind with weighted addition using the 
 ! fractions of ocean and seaice.
-!
+
 !*************************************************************************************    
        ! fraction oce+seaice
@@ -1507,5 +1489,5 @@
 !*************************************************************************************
 ! NetCDF output of all fields just before sending to coupler.
-!
+
 !*************************************************************************************
     IF (is_sequential) THEN
@@ -1517,5 +1499,5 @@
 !*************************************************************************************
 ! Send the table of all fields
-!
+
 !*************************************************************************************
     time_sec=(itime-1)*dtime
@@ -1528,5 +1510,5 @@
 !*************************************************************************************
 ! Finish with some dellocate
-!
+
 !*************************************************************************************  
     sum_error=0
@@ -1555,21 +1537,21 @@
     
   END SUBROUTINE cpl_send_all
-!
-!*************************************************************************************
-!
+
+!*************************************************************************************
+
   SUBROUTINE cpl2gath(champ_in, champ_out, knon, knindex)
   USE mod_phys_lmdz_para
 ! Cette routine transforme un champs de la grille 2D recu du coupleur sur la grille 
 ! 'gathered' (la grille physiq comprime).
-!
-! 
+
+
 ! input:         
 !   champ_in     champ sur la grille 2D
 !   knon         nombre de points dans le domaine a traiter
 !   knindex      index des points de la surface a traiter
-!
+
 ! output:
 !   champ_out    champ sur la grille 'gatherd'
-!
+
     USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
 
@@ -1588,6 +1570,4 @@
 
 !*************************************************************************************
-!
-    
 
 ! Transform from 2 dimensions (nbp_lon,jj_nb) to 1 dimension (klon)
@@ -1605,20 +1585,20 @@
 
   END SUBROUTINE cpl2gath
-!
-!*************************************************************************************
-!
+
+!*************************************************************************************
+
   SUBROUTINE gath2cpl(champ_in, champ_out, knon, knindex)
   USE mod_phys_lmdz_para
 ! Cette routine ecrit un champ 'gathered' sur la grille 2D pour le passer
 ! au coupleur.
-!
+
 ! input:         
 !   champ_in     champ sur la grille gathere        
 !   knon         nombre de points dans le domaine a traiter
 !   knindex      index des points de la surface a traiter
-!
+
 ! output:
 !   champ_out    champ sur la grille 2D
-!
+
     USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     
@@ -1658,7 +1638,7 @@
     
   END SUBROUTINE gath2cpl
-!
-!*************************************************************************************
-!
+
+!*************************************************************************************
+
 END MODULE cpl_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/create_etat0_unstruct_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/create_etat0_unstruct_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/create_etat0_unstruct_mod.F90	(revision 5099)
@@ -31,17 +31,17 @@
     IF (is_omp_master) THEN
 
-      IF (NF90_OPEN("ocean_fraction.nc", NF90_NOWRITE, file_id)==NF90_NOERR) THEN
+      IF (NF90_OPEN("ocean_fraction.nc", NF90_NOWRITE, file_id)==nf90_noerr) THEN
         CALL xios_set_file_attr("frac_ocean",enabled=.TRUE.)
         CALL xios_set_field_attr("mask",field_ref="frac_ocean_read")
         iret=NF90_CLOSE(file_id)
-      ELSE IF (NF90_OPEN("land_water_0.05.nc", NF90_NOWRITE, file_id)==NF90_NOERR) THEN
+      ELSE IF (NF90_OPEN("land_water_0.05.nc", NF90_NOWRITE, file_id)==nf90_noerr) THEN
         CALL xios_set_file_attr("land_water",name="land_water_0.05",enabled=.TRUE.)
         CALL xios_set_field_attr("mask",field_ref="land_water")
         iret=NF90_CLOSE(file_id)
-      ELSE IF (NF90_OPEN("land_water_0.25.nc", NF90_NOWRITE, file_id)==NF90_NOERR) THEN
+      ELSE IF (NF90_OPEN("land_water_0.25.nc", NF90_NOWRITE, file_id)==nf90_noerr) THEN
         CALL xios_set_file_attr("land_water",name="land_water_0.25",enabled=.TRUE.)
         CALL xios_set_field_attr("mask",field_ref="land_water")
         iret=NF90_CLOSE(file_id)
-      ELSE IF (NF90_OPEN("land_water_0.50.nc", NF90_NOWRITE, file_id)==NF90_NOERR) THEN
+      ELSE IF (NF90_OPEN("land_water_0.50.nc", NF90_NOWRITE, file_id)==nf90_noerr) THEN
         CALL xios_set_file_attr("land_water",name="land_water_0.50",enabled=.TRUE.)
         CALL xios_set_field_attr("mask",field_ref="land_water")
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/create_limit_unstruct_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/create_limit_unstruct_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/create_limit_unstruct_mod.F90	(revision 5099)
@@ -227,7 +227,7 @@
   END SUBROUTINE time_interpolation
   !-------------------------------------------------------------------------------
-  !
+
   FUNCTION year_len(y,cal_in)
-  !
+
   !-------------------------------------------------------------------------------
     USE ioipsl, ONLY : ioget_calendar,ioconf_calendar,lock_calendar,ioget_year_len
@@ -255,12 +255,12 @@
   
   END FUNCTION year_len
-  !
-  !-------------------------------------------------------------------------------
-  
-  
-  !-------------------------------------------------------------------------------
-  !
+
+  !-------------------------------------------------------------------------------
+  
+  
+  !-------------------------------------------------------------------------------
+
   FUNCTION mid_months(y,cal_in,nm)
-  !
+
   !-------------------------------------------------------------------------------
     USE ioipsl, ONLY : ioget_calendar,ioconf_calendar,lock_calendar,ioget_mon_len
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv30param.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv30param.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv30param.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !------------------------------------------------------------
 ! Parameters for convectL, iflag_con=30:
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_inip.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_inip.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_inip.F90	(revision 5099)
@@ -8,5 +8,5 @@
   ! modified by :                                                      *
   ! *******************************************************************
-!
+
 !----------------------------------------------
 !  INPUT (from Common YOMCST2 in "YOMCST2.h") : 
@@ -17,15 +17,15 @@
 ! Fmax
 ! scut
-!
+
 !----------------------------------------------
 !  INPUT/OUTPUT (from and to Common YOMCST2 in "YOMCST2.h") : 
 ! qqa1
 ! qqa2
-!
+
 !----------------------------------------------
 !  OUTPUT (to Common YOMCST2 in "YOMCST2.h") :
 ! Qcoef1max
 ! Qcoef2max
-!
+
 !----------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90	(revision 5099)
@@ -56,5 +56,5 @@
 !jyg<
 !  noff is chosen such that nl = k_upper so that upmost loops end at about 22 km
-!
+
   noff = min(max(nd-k_upper, 1), (nd+1)/2)
 !!  noff = 1
@@ -1250,7 +1250,7 @@
              qnk(i)*(lv0-clmcpv*(tnk(i)-273.15)) + gznk(i)
   END DO
-!
+
 !  Ice fraction
-!
+
   IF (cvflag_ice) THEN
     DO k = minorig, nl
@@ -1307,14 +1307,13 @@
   END DO
 !>jyg
-!
 
 ! ***  Find lifted parcel quantities above cloud base    ***
 
 !----------------------------------------------------------------------------
-!
+
   IF (icvflag_Tpa == 2) THEN
-!
+
 !----------------------------------------------------------------------------
-!
+
     DO k = minorig + 1, nl
       DO i = 1,ncum
@@ -1392,5 +1391,5 @@
                   Ux*  (ah0(i) - ahg - ddelta)           /aa
             ENDIF ! (tg .gt. Tx)
-!
+
 !!     print *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta
 !!     print *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff
@@ -1420,9 +1419,9 @@
     END DO ! k = minorig + 1, nl
 !----------------------------------------------------------------------------
-!
+
   ELSE IF (icvflag_Tpa == 1) THEN  ! (icvflag_Tpa == 2)
-!
+
 !----------------------------------------------------------------------------
-!
+
     DO k = minorig + 1, nl
       DO i = 1,ncum
@@ -1487,5 +1486,5 @@
         END IF ! (k>=(icbs(i)+1))
       END DO ! i = 1, ncum
-!
+
       IF (cvflag_prec_eject) THEN
         DO i = 1, ncum
@@ -1510,5 +1509,5 @@
 !   ejection.
 !  =====================================================================================
-!  
+
 !   Verif
             qpreca(i,k) = ejectliq*qpl(i,k) + ejectice*qps(i,k)                                   !!jygprl
@@ -1516,7 +1515,7 @@
             frac_s(i,k) = (1.-ejectliq)*frac(i,k) + &                                             !!jygprl
                ejectliq*(1. - (qpl(i,k)+(1.-frac(i,k))*qcld(i,k))/max(clw(i,k),smallestreal))     !!jygprl
-!          
+
             denomm1 = 1./(1. - qpreca(i,k))
-!          
+
             qta(i,k) = qta(i,k-1) - &
                       qpreca(i,k)*(1.-qta(i,k-1))*denomm1
@@ -1537,13 +1536,13 @@
         END DO ! i = 1, ncum
       ENDIF  ! (cvflag_prec_eject)
-! 
+
     END DO ! k = minorig + 1, nl
-!
+
 !----------------------------------------------------------------------------
-!
+
   ELSE IF (icvflag_Tpa == 0) THEN! (icvflag_Tpa == 2) ELSE IF(icvflag_Tpa == 1)
-!
+
 !----------------------------------------------------------------------------
-!
+
   DO k = minorig + 1, nl
     DO i = 1, ncum
@@ -1703,14 +1702,14 @@
 
 !----------------------------------------------------------------------------
-!
+
   ENDIF ! (icvflag_Tpa == 2) ELSEIF (icvflag_Tpa == 1) ELSE (icvflag_Tpa == 0)
-!
+
 !----------------------------------------------------------------------------
-!
+
 ! =====================================================================
 ! --- SET THE PRECIPITATION EFFICIENCIES 
 ! --- THESE MAY BE FUNCTIONS OF TP(I), P(I) AND CLW(I)
 ! =====================================================================
-!
+
   IF (flag_epkeorig/=1) THEN
     DO k = 1, nl ! convect3
@@ -1748,5 +1747,5 @@
     END DO
   END IF
-!
+
 !   =========================================================================
   IF (prt_level >= 10) THEN
@@ -1754,5 +1753,5 @@
                           (k, tp(1,k), tvp(1,k), k = 1,nl)
   ENDIF
-!
+
 ! =====================================================================
 ! --- CALCULATE VIRTUAL TEMPERATURE AND LIFTED PARCEL
@@ -1986,7 +1985,7 @@
 
 !jyg : cvflag_ice test outside the loops (07042015)
-!
+
   IF (cvflag_ice) THEN
-!
+
   IF (cvflag_prec_eject) THEN
 !!    DO k = minorig + 1, nl
@@ -2020,7 +2019,7 @@
       END DO
     END DO
-!
+
   ELSE   ! (cvflag_ice)
-!
+
     DO k = minorig + 1, nl
       DO i = 1, ncum
@@ -2036,5 +2035,5 @@
       END DO
     END DO
-!
+
   END IF  ! (cvflag_ice)
 
@@ -2049,5 +2048,5 @@
 ! ===================================================================
 ! ---  CLOSURE OF CONVECT3
-!
+
 ! vectorization: S. Bony
 ! ===================================================================
@@ -2855,7 +2854,6 @@
   END DO
 
-!
 ! Get adiabatic ascent mass flux 
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (adiab_ascent_mass_flux_depends_on_ejectliq) THEN
@@ -2892,7 +2890,7 @@
 
 ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!
+
 ! ***                    begin downdraft loop                    ***
-!
+
 ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
@@ -2910,6 +2908,6 @@
 ! ***  integrate liquid water equation to find condensed water   ***
 ! ***                and condensed water flux                    ***
-!
-!
+
+
 ! ***              calculate detrained precipitation             ***
 
@@ -3037,10 +3035,9 @@
         bfac = 1./(sigd(il)*wt(il,i))
 
-!
     IF (prt_level >= 20) THEN
       Print*, 'cv3_unsat after provisional rp estimate: rp, afac, bfac ', &
           i, rp(1, i), afac,bfac
     ENDIF
-!
+
 !JYG1
 ! cc        sigt=1.0
@@ -3117,10 +3114,9 @@
           evap(il, i) = (wdtrain(il)+sigd(il)*wt(il,i)*(prec(il,i+1)-prec(il,i))) / &
                         (sigd(il)*(ph(il,i)-ph(il,i+1))*100.)
-!
+
     IF (prt_level >= 20) THEN
       Print*, 'cv3_unsat after evap computation: wdtrain, sigd, wt, prec(i+1),prec(i) ', &
           i, wdtrain(1), sigd(1), wt(1,i), prec(1,i+1),prec(1,i)
     ENDIF
-!
 
 !jyg<
@@ -3349,10 +3345,9 @@
     END DO
 ! ----------------------------------------------------------------
-!
+
     IF (prt_level >= 20) THEN
       Print*, 'cv3_unsat after mp computation: mp, b(i), b(i-1) ', &
           i, mp(1, i), b(1,i), b(1,max(i-1,1))
     ENDIF
-!
 
 ! ***       find mixing ratio of precipitating downdraft     ***
@@ -3495,5 +3490,5 @@
       REAL, DIMENSION (nloc, na),INTENT(IN)              :: qpreca
       REAL, INTENT(IN)                                   :: tau_cld_cv, coefw_cld_cv
-!
+
 !input/output:
       REAL, DIMENSION (nloc, na), INTENT (INOUT)         :: m, mp
@@ -3502,5 +3497,5 @@
       REAL, DIMENSION (nloc, nd), INTENT (INOUT)         :: sig
       REAL, DIMENSION (nloc), INTENT (INOUT)             :: sigd
-!
+
 !outputs:
       REAL, DIMENSION (nloc), INTENT (OUT)               :: precip
@@ -3518,5 +3513,5 @@
       REAL, DIMENSION (nloc), INTENT (OUT)               :: wd                          ! gust
       REAL, DIMENSION (nloc), INTENT (OUT)               :: cbmf
-!
+
 !local variables:
       INTEGER                                            :: i, k, il, n, j, num1
@@ -3544,5 +3539,5 @@
       REAL, DIMENSION (nloc, nd, nd)                     :: qdet
       REAL sumdq !jyg
-! 
+
 ! -------------------------------------------------------------
 
@@ -3712,5 +3707,5 @@
   ENDIF ! (adiab_ascent_mass_flux_depends_on_ejectliq) ELSE
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
+
 !    print*,'cv3_yield avant ft'
 ! am is the part of cbmf taken from the first level
@@ -3846,17 +3841,16 @@
            IF (ok_optim_yield) THEN                       !|
 !-----------------------------------------------------------
-!
+
 !***                                                      ***
 !***    Compute convective mass fluxes upwd and dnwd      ***
 
-!
 ! =================================================
 !              upward fluxes                      |
 ! ------------------------------------------------
-!
+
 upwd(:,:) = 0.
 up_to(:,:) = 0.
 up_from(:,:) = 0.
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (adiab_ascent_mass_flux_depends_on_ejectliq) THEN
@@ -3866,5 +3860,5 @@
 !! WARNING : in the present version, taking into account the mass-flux decrease due to 
 !! precipitation ejection leads to water conservation violation.
-!
+
 ! - Upward mass flux of mixed draughts
 !---------------------------------------
@@ -3878,5 +3872,5 @@
   ENDDO
 ENDDO
-!
+
 DO j = 3, nl
   DO i = 2, j-1
@@ -3888,9 +3882,9 @@
   ENDDO
 ENDDO
-!
+
 ! The difference between upwd(il,i) and upwd(il,i-1) is due to updrafts ending in layer 
 !(i-1) (theses drafts cross interface (i-1) but not interface(i)) and to updrafts starting 
 !from layer (i-1) (theses drafts cross interface (i) but not interface(i-1)): 
-! 
+
 DO i = 2, nlp
   DO il = 1, ncum
@@ -3900,5 +3894,5 @@
   ENDDO
 ENDDO
-!
+
 ! - Total upward mass flux
 !---------------------------
@@ -3915,5 +3909,5 @@
 !! The decrease of the adiabatic ascent mass flux due to ejection of precipitation 
 !! is not taken into account. 
-!
+
 ! - Upward mass flux
 !-------------------
@@ -3932,5 +3926,5 @@
   ENDDO
 ENDDO
-!
+
 DO i = 1, nl
   DO il = 1, ncum
@@ -3940,5 +3934,5 @@
   ENDDO
 ENDDO
-!
+
 DO j = 3, nl
   DO i = 2, j-1
@@ -3950,9 +3944,9 @@
   ENDDO
 ENDDO
-!
+
 ! The difference between upwd(il,i) and upwd(il,i-1) is due to updrafts ending in layer 
 !(i-1) (theses drafts cross interface (i-1) but not interface(i)) and to updrafts starting 
 !from layer (i-1) (theses drafts cross interface (i) but not interface(i-1)): 
-! 
+
 DO i = 2, nlp
   DO il = 1, ncum
@@ -3967,5 +3961,4 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-!
 ! =================================================
 !              downward fluxes                    |
@@ -3984,5 +3977,5 @@
   ENDDO
 ENDDO
-!
+
 DO j = 1, nl
   DO i = j+1, nl
@@ -3995,9 +3988,9 @@
   ENDDO
 ENDDO
-!
+
 ! The difference between dnwd(il,i) and dnwd(il,i+1) is due to downdrafts ending in layer 
 !(i) (theses drafts cross interface (i+1) but not interface(i)) and to downdrafts 
 !starting from layer (i) (theses drafts cross interface (i) but not interface(i+1)): 
-!
+
 DO i = nl-1, 1, -1
   DO il = 1, ncum
@@ -4007,5 +4000,5 @@
 ENDDO
 ! =================================================
-!
+
 !-----------------------------------------------------------
         ENDIF !(ok_optim_yield)                           !|
@@ -4031,5 +4024,4 @@
     IF (num1<=0) GO TO 500
 
-!
 !jyg<
 !-----------------------------------------------------------
@@ -4089,9 +4081,9 @@
       END DO
     END DO
-!
+
 !-----------------------------------------------------------
         ENDIF !(ok_optim_yield)                           !|
 !-----------------------------------------------------------
-!
+
 !!   print *,'yield, i, amp1, ad', i, amp1(1), ad(1)
 
@@ -4150,5 +4142,5 @@
                                     t(il,i)*(cpv-cpd)*(rr(il,i)-qent(il,i,i)))*cpinv
         END IF
-!
+
 ! sb: on ne fait pas encore la correction permettant de mieux
 ! conserver l'eau:
@@ -4207,6 +4199,6 @@
             ft(il, i) = ft(il, i) + 0.01*grav*dpinv*ment(il, k, i) * &
                  (hent(il,k,i)-h(il,i)+t(il,i)*(cpv-cpd)*(rr(il,i)+awat(il)-qent(il,k,i)))*cpinv
-!
-!
+
+
           END IF ! i
         END DO
@@ -4555,9 +4547,9 @@
     END IF
   END DO
-!
+
     IF (prt_level >= 5) THEN
       print *,' CV3_YIELD : alpha_qpos ',alpha_qpos(1)
     ENDIF
-!
+
   DO il = 1, ncum
     IF (iflag(il)<=1) THEN
@@ -4966,5 +4958,5 @@
   REAL, DIMENSION (len, na, na), INTENT (OUT)        :: phi, phi2, epmlmMm
   REAL, DIMENSION (len, na), INTENT (OUT)            :: da, d1a, dam, eplaMm
-!
+
 ! variables pour tracer dans precip de l'AA et des mel
 !local variables:
@@ -5129,5 +5121,5 @@
 !AC! 2110    continue
 !AC! 2100   continue
-!
+
   RETURN
 END SUBROUTINE cv3_uncompress
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3a_compress.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3a_compress.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3a_compress.F90	(revision 5099)
@@ -60,8 +60,8 @@
   REAL, DIMENSION (len), INTENT (IN)                 :: Ale1, Alp1
   REAL, DIMENSION (len, nd), INTENT (IN)             :: omega1
-!
+
   ! in/out 
   INTEGER, INTENT (INOUT)                            :: ncum
-!
+
   ! outputs:
   ! en fait, on a nloc=len pour l'instant (cf cv_driver)
@@ -137,5 +137,5 @@
     END DO
   END DO
-!
+
   ! AC!      do 121 j=1,ntra
   ! AC!ccccc      do 111 k=1,nl+1
@@ -187,10 +187,10 @@
     CALL abort_physic(modname, abort_message, 1)
   END IF
-!
+
 !jyg<
   ELSE  !(compress)
-!
+
       ncum = len
-!
+
       wghti(:,1:nl+1) = wghti1(:,1:nl+1)
       t(:,1:nl+1) = t1(:,1:nl+1)
@@ -223,5 +223,5 @@
       w0(:,1:nl+1) = w01(:,1:nl+1)
       omega(:,1:nl+1) = omega1(:,1:nl+1)
-!
+
       s_wake(:) = s1_wake(:)
       iflag(:) = iflag1(:)
@@ -242,5 +242,5 @@
       Ale(:) = Ale1(:)
       Alp(:) = Alp1(:)
-!
+
   ENDIF !(compress)
 !>jyg
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3a_uncompress.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3a_uncompress.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3a_uncompress.F90	(revision 5099)
@@ -260,8 +260,8 @@
     ! 2210     enddo
     ! 2220    enddo
-!
+
 !jyg<
   ELSE  !(compress)
-!
+
       sig1(:,nd) = sig(:,nd)
       ptop21(:) = ptop2(:)
@@ -282,5 +282,5 @@
       supmax01(:) = supmax0(:)
       asupmaxmin1(:) = asupmaxmin(:)
-!
+
       sig1(:, 1:nl) = sig(:, 1:nl)
       w01(:, 1:nl) = w0(:, 1:nl)
@@ -318,5 +318,5 @@
       sigt1(:, 1:nl) = sigt(:, 1:nl)
       detrain1(:, 1:nl) = detrain(:, 1:nl)
-!
+
       ma1(:, nlp) = 0.
       vprecip1(:, nlp) = 0.
@@ -326,5 +326,4 @@
       dnwd01(:, nlp) = 0.
 
-!
       phi1    (:, 1:nl, 1:nl) = phi    (:, 1:nl, 1:nl)  !AC!
       phi21   (:, 1:nl, 1:nl) = phi2   (:, 1:nl, 1:nl)  !RomP
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p2_closure.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p2_closure.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p2_closure.F90	(revision 5099)
@@ -494,5 +494,5 @@
     END DO
   END DO
-!
+
 !    prevent convection when ale+cin <= 0
   DO k = 1, nl
@@ -504,10 +504,10 @@
   END DO
 !>jyg
-!
+
   IF (prt_level >= 20) THEN
     print *,'cv3p2_closure: dtmin ', (k, dtmin(igout,k), k=1,nl)
     print *,'cv3p2_closure: dtminmax ', dtminmax(igout)
   ENDIF
-!
+
   ! the interval on which cape is computed starts at pbase :
 
@@ -565,5 +565,4 @@
   IF (prt_level>=20) PRINT *, 'cv3p2_closure apres 700'
 
-  ! 
   ! ------------------------------------------------------------------------
   ! c     Compute Cloud base mass flux given by Cape closure (cbmflim = cbmf of 
@@ -836,9 +835,8 @@
   END DO
   ENDIF ! (ok_convstop)
-!
+
   IF (prt_level >= 10) THEN
    print *,'cv3p2_closure: iflag ',iflag(igout)
   ENDIF
-!
 
   ! c 4. Introduce a correcting factor for coef, in order to obtain an
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p_mixing.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p_mixing.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3p_mixing.F90	(revision 5099)
@@ -113,5 +113,5 @@
             fmax, gammas, qqa1, qqa2, Qcoef1max, Qcoef2max
 !>jyg
-!
+
   END IF
 
@@ -514,12 +514,12 @@
 !                             (1.+lv(il,j)*lv(il,j)*rs(il,j) / &
 !                              ((cpd*(1.-Qent(il,i,j))+Qent(il,i,j)*cpv)*rrv*t(il,j)*t(il,j)))
-!
+
 !       Computation of condensate amount Elij, taking into account the ice fraction frac
 !       Warning : the same saturation humidity rs is used over both liquid water and ice; this
 !                 should be corrected.
-!
+
 !  Heat capacity of mixed draught
     cpm = cpd+Qent(il,i,j)*(cpv-cpd)
-!
+
     IF (cvflag_ice .and. frac(il,j) > 0.) THEN
             elij(il, i, j) = Qent(il, i, j) - rs(il, j)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv_driver.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv_driver.F90	(revision 5099)
@@ -696,5 +696,5 @@
   cvflag_grav = .TRUE.
   cvflag_ice = iflag_ice_thermo >= 1
-  !
+
 ! si icvflag_Tpa=0, alors la fraction de glace dans l'ascendance adiabatique est
   ! fonction de la temperature de l'environnement et la temperature de l'ascendance est 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cva_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cva_driver.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cva_driver.F90	(revision 5099)
@@ -367,5 +367,4 @@
 !        14     No moist convection; atmosphere is very
 !               stable (=> no computation)
-!
 
 ! ft:   Array of temperature tendency (K/s) of dimension ND, defined at same
@@ -857,7 +856,7 @@
 !   If the fraction of convective points is larger than comp_threshold, then compression
 !   is assumed useless.
-!
+
   compress = ncum < len*comp_threshold
-!
+
   IF (.not. compress) THEN
     DO i = 1,len
@@ -865,5 +864,5 @@
     ENDDO
   ENDIF
-!
+
 !>jyg
         if (prt_level >= 9) &
@@ -1096,5 +1095,5 @@
 !!                     wdtrainA, wdtrainM)                                       ! RomP
                      wdtrainA, wdtrainS, wdtrainM)                               !!jygprl
-!
+
       IF (prt_level >= 10) THEN
         Print *, 'cva_driver after cv3_unsat:mp , water, ice, evap, fondue '
@@ -1110,5 +1109,5 @@
         ENDDO
       ENDIF
-!
+
     END IF  !(iflag_con==3)
 
@@ -1152,11 +1151,11 @@
 !!                     ftd, fqd, qnk, qtc, sigt, tau_cld_cv, coefw_cld_cv)
                      ftd, fqd, qta, qtc, sigt, detrain, tau_cld_cv, coefw_cld_cv)         !!jygprl
-!
+
 !         Test conseravtion de l'eau
-!
+
       IF (debut) THEN
         PRINT *, ' cv3_yield -> fqd(1) = ', fqd(igout, 1)
       END IF !(debut) THEN
-!   
+
       IF (prt_level >= 10) THEN
         Print *, 'cva_driver after cv3_yield:ft(1) , ftd(1) ', &
@@ -1165,5 +1164,5 @@
                     fq(igout,1), fqd(igout,1)
       ENDIF
-!   
+
     END IF
 
@@ -1235,5 +1234,5 @@
                            wdtrainA1, wdtrainS1, wdtrainM1,                  & ! RomP
                            qtc1, sigt1, detrain1, epmax_diag1) ! epmax_cape
-!   
+
       IF (prt_level >= 10) THEN
         Print *, 'cva_driver after cv3_uncompress:ft1(1) , ftd1(1) ', &
@@ -1242,5 +1241,5 @@
                     fq1(igout,1), fqd1(igout,1)
       ENDIF
-!   
+
     END IF
 
@@ -1260,6 +1259,6 @@
 
   END IF ! ncum>0
-!
-!
+
+
   DO i = 1,len
     IF (iflag1(i) == 14) THEN
@@ -1269,5 +1268,4 @@
   ENDDO
 
-!
 ! In order take into account the possibility of changing the compression,
 ! reset m, sig and w0 to zero for non-convective points.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvflag.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvflag.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvflag.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       logical cvflag_grav
       logical cvflag_ice
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE cvltr(pdtime, da, phi,phi2,d1a,dam, mpIN,epIN, &
 !!           sigd,sij,clw,elij,epmlmMm,eplaMm,              &   !RL
@@ -31,5 +31,5 @@
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam ! matrices pour simplifier
   REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2    ! l'ecriture des tendances
-!
+
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: mpIN
   REAL,DIMENSION(klon,klev+1),INTENT(IN)    :: paprs  ! pression aux 1/2 couches (bas en haut)
@@ -39,5 +39,5 @@
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: upd   ! saturated updraft mass flux
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: dnd   ! saturated downdraft mass flux
-!
+
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA   ! masses precipitantes de l'asc adiab
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM   ! masses precipitantes des melanges
@@ -63,5 +63,5 @@
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrsat    ! tendance trsp+sat scav
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrUscav  ! tendance du lessivage courant unsat
-!
+
 ! Variables locales
   INTEGER                           :: i,j,k
@@ -112,5 +112,5 @@
   REAL                    :: ccntrENV_coef       ! \beta_m  : fract aerosols de l'env convertis en CCN
   REAL                    :: coefcoli            ! coefficient de collision des gouttes sur les aerosols
-!
+
   LOGICAL,DIMENSION(klon,klev) :: NO_precip
 !  LOGICAL                      :: scavON
@@ -166,5 +166,5 @@
    enddo
   enddo
-!
+
 ! initialisation pour flux de traceurs, td et autre
    trsptrac = 0.
@@ -311,7 +311,7 @@
   ENDDO
 !!!!!
-!
+
 ! rajout du terme lie a l ascendance induite
-!
+
   DO j=2,klev
      DO i=1,klon
@@ -319,7 +319,7 @@
      END DO
   END DO
-!
+
 ! tendance courants insatures  ! sans lessivage ancien schema
-!
+
   DO k=1,klev
      DO j=1,klev
@@ -329,9 +329,9 @@
      END DO
   END DO
-!
+
 ! =========================================
 ! calcul des tendances liees aux courants satures   j <-> z ; k <-> z'
 ! =========================================
-!
+
 !RL
 !  Feeding concentrations
@@ -342,5 +342,5 @@
   END DO
 !RL
-!
+
   DO j=1,klev
      DO i=1,klon
@@ -351,5 +351,5 @@
      END DO
   END DO
-!
+
   DO k=1,klev
      DO j=1,klev
@@ -540,5 +540,5 @@
             (pmflxr(i,j+1)+pmflxs(i,j+1)+Pa(i,j)+Pm(i,j))*&
             (-mp(i,j+1)*qDi(i,j+1,it)))
-!
+
           qPr(i,j,it)=kappa(i,j)*(&
             (-mp(i,j+1)-imp(i,j)/RG*dxpres(i,j))*&
@@ -558,5 +558,5 @@
             (pmflxr(i,j+1)+pmflxs(i,j+1)+Pa(i,j)+Pm(i,j))*&
             (-mp(i,j+1)*(qDi(i,j+1,it)-tr(i,j,it))-mp(i,j)*tr(i,j,it)))
-!
+
           qPr(i,j,it)=kappa(i,j)*(&
             (-mp(i,j)-imp(i,j)/RG*dxpres(i,j))*&
@@ -619,5 +619,5 @@
         uscavtrac= (-mp(i,k)+mp(i,k+1))*(qDi(i,k,it)-tr(i,k,it))&
                    + mp(i,k)*(tr(i,k-1,it)-tr(i,k,it))
-!
+
 !        if(it.eq.3) write(*,'(I2,1X,a,5X,e20.12,82X,a,e20.12)')k,' det incloud',&
 !                    (-mp(i,k)+mp(i,k+1))*(qDi(i,k,it)-tr(i,k,it))*pdtimeRG/dxpres(i,k)+&
@@ -627,5 +627,5 @@
       elseif(mp(i,k)>mp(i,k+1).and.mp(i,k)>1.e-10) then
          uscavtrac= mp(i,k)*(tr(i,k-1,it)-tr(i,k,it))
-!
+
 !         if(it.eq.3) write(*,'(I2,1X,a,5X,e20.12,82X,a,e20.12)')k,' ent incloud',uscavtrac*pdtimeRG/dxpres(i,k), 'mp',mp(i,k)
 !=!------------------------------------------------------------- end ent/det 
@@ -645,5 +645,5 @@
          uscavtrac= (-0.+mp(i,2))*(qDi(i,k,it)-tr(i,k,it)) !&
 !                   + mp(i,2)*(0.-tr(i,k,it))
-!
+
 !       if(it.eq.3) write(*,'(I2,1X,a,e20.12,84X,a,e20.12)')k,' 1 det',&
 !                  (-0.+mp(i,2))*(qDi(i,k,it)-tr(i,k,it))*pdtimeRG/dxpres(i,k)+&
@@ -685,5 +685,5 @@
 !         conservMA=conservMA+dtrcvMA(i,k,it)*   &
 !        (paprs(i,k)-paprs(i,k+1))/RG
-!
+
 !      if(it.eq.3)  write(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)') k,&
 !         'MA td ',dtrcvMA(i,k,it)*dxpres(i,k)/RG,&
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_noscav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_noscav.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_noscav.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE cvltr_noscav(it,pdtime,da, phi, mp,wght_cvfd,paprs,pplay,x,upd,dnd,dx)
   USE dimphy
@@ -48,5 +48,5 @@
 ! calcul des tendances liees au downdraft
 ! =========================================
-!
+
   smallest_mp = tiny(mp(1,1))
 !cdir collapse
@@ -102,7 +102,7 @@
      END DO
   END DO
-!
+
 ! rajout du terme lie a l ascendance induite
-!
+
   DO j=2,klev
      DO i=1,klon
@@ -110,7 +110,7 @@
      END DO
   END DO
-!
+
 ! tendances
-!            
+
   DO k=1,klev
      DO j=1,klev
@@ -120,5 +120,5 @@
      END DO
   END DO
-!
+
 ! =========================================
 ! calcul des tendances liees aux flux satures
@@ -132,5 +132,5 @@
   END DO
 !RL
-!
+
   DO j=1,klev
      DO i=1,klon
@@ -141,8 +141,8 @@
      END DO
   END DO
-!
+
 !!  print *,'it, qfeed(1,it), x(1,1,it) ', it, qfeed(1,it), x(1,1,it)  !jyg
 !!  print *,'wght_cvfd ', (j, wght_cvfd(1,j), j=1,5)                     !jyg
-!
+
   DO k=1,klev
      DO j=1,klev
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_scav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_scav.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_scav.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE cvltr_scav(pdtime, da, phi,phi2,d1a,dam, mpIN,epIN, &
      sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,    &
@@ -10,5 +10,5 @@
      qPa,qMel,qTrdi,dtrcvMA,Mint,                   &
      zmfd1a,zmfphi2,zmfdam)
-  !
+
   USE IOIPSL 
   USE dimphy
@@ -33,5 +33,5 @@
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam ! matrices pour simplifier
   REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2    ! l'ecriture des tendances
-  !
+
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: mpIN
   REAL,DIMENSION(klon,klev+1),INTENT(IN)    :: paprs  ! pression aux 1/2 couches (bas en haut)
@@ -40,5 +40,5 @@
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: upd   ! saturated updraft mass flux
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: dnd   ! saturated downdraft mass flux
-  !
+
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA   ! masses precipitantes de l'asc adiab
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM   ! masses precipitantes des melanges
@@ -59,9 +59,9 @@
   REAL,DIMENSION(klon),INTENT(IN)           :: sigd
   INTEGER,DIMENSION(klon),INTENT(IN)        :: icb,inb
-  !
+
   REAL,DIMENSION(klon,klev),INTENT(IN) :: ccntrAA_3d
   REAL,DIMENSION(klon,klev),INTENT(IN) :: ccntrENV_3d
   REAL,DIMENSION(klon,klev),INTENT(IN) :: coefcoli_3d
-  !
+
   ! Sortie
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrcv     ! tendance totale (bas en haut)
@@ -71,5 +71,5 @@
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrsat    ! tendance trsp+sat scav
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrUscav  ! tendance du lessivage courant unsat
-  !
+
   ! Variables locales
   INTEGER                           :: i,j,k
@@ -116,5 +116,5 @@
 !!!
   REAL,DIMENSION(klon,klev)         :: imp              ! coefficient d'impaction
-  !
+
   LOGICAL,DIMENSION(klon,klev) :: NO_precip
   ! var tmp tests
@@ -142,7 +142,7 @@
 !!  ENDDO
 !>jyg
-  !
+
   ! initialisation pour flux de traceurs, td et autre
-  !
+
   trsptrac = 0.
   scavtrac = 0.
@@ -308,7 +308,7 @@
   ENDDO
 !!!!!
-  !
+
   ! rajout du terme lie a l ascendance induite
-  !
+
   DO j=2,klev
      DO i=1,klon
@@ -316,7 +316,7 @@
      END DO
   END DO
-  !
+
   ! tendance courants insatures  ! sans lessivage ancien schema
-  !
+
   DO k=1,klev
      DO j=1,klev
@@ -326,5 +326,5 @@
      END DO
   END DO
-  !
+
   ! =========================================
   ! calcul des tendances liees aux courants satures   j <-> z ; k <-> z'
@@ -338,5 +338,5 @@
   END DO
   !RL
-  !
+
   DO j=1,klev
      DO i=1,klon
@@ -347,5 +347,5 @@
      END DO
   END DO
-  !
+
   DO k=1,klev
      DO j=1,klev
@@ -540,5 +540,5 @@
                          (pmflxr(i,j+1)+pmflxs(i,j+1)+Pa(i,j)+Pm(i,j))*&
                          (-mp(i,j+1)*qDi(i,j+1,it)))
-                    !
+
                     qPr(i,j,it)=kappa(i,j)*(&
                          (-mp(i,j+1)-imp(i,j)/RG*dxpres(i,j))*&
@@ -558,5 +558,5 @@
                          (pmflxr(i,j+1)+pmflxs(i,j+1)+Pa(i,j)+Pm(i,j))*&
                          (-mp(i,j+1)*(qDi(i,j+1,it)-tr(i,j,it))-mp(i,j)*tr(i,j,it)))
-                    !
+
                     qPr(i,j,it)=kappa(i,j)*(&
                          (-mp(i,j)-imp(i,j)/RG*dxpres(i,j))*&
@@ -622,5 +622,5 @@
               uscavtrac= (-mp(i,k)+mp(i,k+1))*(qDi(i,k,it)-tr(i,k,it))&
                    + mp(i,k)*(tr(i,k-1,it)-tr(i,k,it))
-              !
+
               !        if(it.eq.3) write(*,'(I2,1X,a,5X,e20.12,82X,a,e20.12)')k,' det incloud',&
               !                    (-mp(i,k)+mp(i,k+1))*(qDi(i,k,it)-tr(i,k,it))*pdtimeRG/dxpres(i,k)+&
@@ -630,5 +630,5 @@
            ELSEIF(mp(i,k)>mp(i,k+1).AND.mp(i,k)>1.e-10) THEN
               uscavtrac= mp(i,k)*(tr(i,k-1,it)-tr(i,k,it))
-              !
+
               !         if(it.eq.3) write(*,'(I2,1X,a,5X,e20.12,82X,a,e20.12)')k,' ent incloud',uscavtrac*pdtimeRG/dxpres(i,k), 'mp',mp(i,k)
               !=!------------------------------------------------------------- end ent/det 
@@ -656,5 +656,5 @@
               uscavtrac= (-0.+mp(i,2))*(qDi(i,k,it)-tr(i,k,it)) !&
               !                   + mp(i,2)*(0.-tr(i,k,it))
-              !
+
               !       if(it.eq.3) write(*,'(I2,1X,a,e20.12,84X,a,e20.12)')k,' 1 det',&
               !                  (-0.+mp(i,2))*(qDi(i,k,it)-tr(i,k,it))*pdtimeRG/dxpres(i,k)+&
@@ -696,5 +696,5 @@
   !         conservMA=conservMA+dtrcvMA(i,k,it)*   &
   !        (paprs(i,k)-paprs(i,k+1))/RG
-  !
+
   !      if(it.eq.3)  write(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)') k,&
   !         'MA td ',dtrcvMA(i,k,it)*dxpres(i,k)/RG,&
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_spl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_spl.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltr_spl.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE cvltr_spl(pdtime, da, phi,phi2,d1a,dam, mpIN,epIN, &
            sigd,sij,wght_cvfd,clw,elij,epmlmMm,eplaMm,              &
@@ -33,5 +33,5 @@
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: d1a,dam ! matrices pour simplifier
   REAL,DIMENSION(klon,klev,klev),INTENT(IN) :: phi2    ! l'ecriture des tendances
-!
+
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: mpIN
   REAL,DIMENSION(klon,klev+1),INTENT(IN)    :: paprs  ! pression aux 1/2 couches (bas en haut)
@@ -41,5 +41,5 @@
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: upd   ! saturated updraft mass flux
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: dnd   ! saturated downdraft mass flux
-!
+
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainA   ! masses precipitantes de l'asc adiab
   REAL,DIMENSION(klon,klev),INTENT(IN)      :: wdtrainM   ! masses precipitantes des melanges
@@ -67,5 +67,5 @@
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrsat    ! tendance trsp+sat scav
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT)     :: dtrUscav  ! tendance du lessivage courant unsat
-!
+
 ! Variables locales
   INTEGER                           :: i,j,k
@@ -116,5 +116,5 @@
   REAL                    :: ccntrENV_coef       ! \beta_m  : fract aerosols de l'env convertis en CCN
   REAL                    :: coefcoli            ! coefficient de collision des gouttes sur les aerosols
-!
+
   LOGICAL,DIMENSION(klon,klev) :: NO_precip
 !  LOGICAL                      :: scavON
@@ -144,11 +144,11 @@
 !JE20140724<<
 !JE SPLA adapt:
-!
-!
+
+
 !! coefficient lessivage
 !   ccntrAA_coef     = 0.
 !   ccntrENV_coef    = 0.
 !   coefcoli         = 0.
-!
+
 !!$OMP MASTER
 !  call getin('ccntrAA_coef',ccntrAA_coef)
@@ -166,10 +166,10 @@
 !   enddo
 !  enddo
-!
-!
+
+
 !!! for SPLA
 !!!JEend
 !  print*,'cvltr coef lessivage convectif', ccntrAA_coef,ccntrENV_coef,coefcoli
-!
+
 !JE20140724>>
 
@@ -211,5 +211,4 @@
 !JE end 20140103
 
-!
 ! initialisation pour flux de traceurs, td et autre
    trsptrac = 0.
@@ -310,6 +309,6 @@
 ! precursors. From SPLA code inscav_spl.F 
 !print *,'Using SPLA values for cvltr_spl ccntr and coefcoli params'
-!
-!
+
+
 !IF (it.EQ.2) THEN !--fine aerosol
 !  DO j=1,klev
@@ -328,5 +327,5 @@
 !   ENDDO
 !  ENDDO
-!
+
 !ELSEIF (it.EQ.4) THEN !--Coarse Dust aerosol
 !  DO j=1,klev
@@ -335,5 +334,5 @@
 !    ccntrENV_coef3d(i,j)=0.7
 !    coefcoli3d(i,j)=0.001
-!
+
 !   ENDDO
 !  ENDDO
@@ -442,7 +441,7 @@
   ENDDO
 !!!!!
-!
+
 ! rajout du terme lie a l ascendance induite
-!
+
   DO j=2,klev
      DO i=1,klon
@@ -450,7 +449,7 @@
      END DO
   END DO
-!
+
 ! tendance courants insatures  ! sans lessivage ancien schema
-!
+
   DO k=1,klev
      DO j=1,klev
@@ -460,5 +459,5 @@
      END DO
   END DO
-!
+
 ! =========================================
 ! calcul des tendances liees aux courants satures   j <-> z ; k <-> z'
@@ -472,5 +471,5 @@
   END DO
 !RL
-!
+
   DO j=1,klev
      DO i=1,klon
@@ -481,5 +480,5 @@
      END DO
   END DO
-!
+
   DO k=1,klev
      DO j=1,klev
@@ -674,5 +673,5 @@
             (pmflxr(i,j+1)+pmflxs(i,j+1)+Pa(i,j)+Pm(i,j))*&
             (-mp(i,j+1)*qDi(i,j+1,it)))
-!
+
           qPr(i,j,it)=kappa(i,j)*(&
             (-mp(i,j+1)-imp(i,j)/RG*dxpres(i,j))*&
@@ -692,5 +691,5 @@
             (pmflxr(i,j+1)+pmflxs(i,j+1)+Pa(i,j)+Pm(i,j))*&
             (-mp(i,j+1)*(qDi(i,j+1,it)-tr(i,j,it))-mp(i,j)*tr(i,j,it)))
-!
+
           qPr(i,j,it)=kappa(i,j)*(&
             (-mp(i,j)-imp(i,j)/RG*dxpres(i,j))*&
@@ -756,5 +755,5 @@
         uscavtrac= (-mp(i,k)+mp(i,k+1))*(qDi(i,k,it)-tr(i,k,it))&
                    + mp(i,k)*(tr(i,k-1,it)-tr(i,k,it))
-!
+
 !        if(it.eq.3) write(*,'(I2,1X,a,5X,e20.12,82X,a,e20.12)')k,' det incloud',&
 !                    (-mp(i,k)+mp(i,k+1))*(qDi(i,k,it)-tr(i,k,it))*pdtimeRG/dxpres(i,k)+&
@@ -764,5 +763,5 @@
       elseif(mp(i,k)>mp(i,k+1).and.mp(i,k)>1.e-10) then
          uscavtrac= mp(i,k)*(tr(i,k-1,it)-tr(i,k,it))
-!
+
 !         if(it.eq.3) write(*,'(I2,1X,a,5X,e20.12,82X,a,e20.12)')k,' ent incloud',uscavtrac*pdtimeRG/dxpres(i,k), 'mp',mp(i,k)
 !=!------------------------------------------------------------- end ent/det 
@@ -790,5 +789,5 @@
          uscavtrac= (-0.+mp(i,2))*(qDi(i,k,it)-tr(i,k,it)) !&
 !                   + mp(i,2)*(0.-tr(i,k,it))
-!
+
 !       if(it.eq.3) write(*,'(I2,1X,a,e20.12,84X,a,e20.12)')k,' 1 det',&
 !                  (-0.+mp(i,2))*(qDi(i,k,it)-tr(i,k,it))*pdtimeRG/dxpres(i,k)+&
@@ -830,5 +829,5 @@
 !         conservMA=conservMA+dtrcvMA(i,k,it)*   &
 !        (paprs(i,k)-paprs(i,k+1))/RG
-!
+
 !      if(it.eq.3)  write(*,'(I2,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12,2X,a,e20.12)') k,&
 !         'MA td ',dtrcvMA(i,k,it)*dxpres(i,k)/RG,&
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvltrorig.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvltrorig.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvltrorig.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE cvltrorig(it,pdtime,da, phi, mp,paprs,pplay,x,upd,dnd,dx)
   USE dimphy
@@ -92,7 +92,7 @@
      END DO
   END DO
-!
+
 ! rajout du terme lie a l ascendance induite
-!
+
   DO j=2,klev
      DO i=1,klon
@@ -100,7 +100,7 @@
      END DO
   END DO
-!
+
 ! tendances
-!            
+
   DO k=1,klev
      DO j=1,klev
@@ -110,5 +110,5 @@
      END DO
   END DO
-!
+
 ! =========================================
 ! calcul des tendances liees aux flux satures
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvparam.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvparam.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvparam.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !------------------------------------------------------------
 ! Parameters for convectL:
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cvthermo.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cvthermo.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cvthermo.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 ! Thermodynamical constants for convectL:
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/declare_STDlev.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/declare_STDlev.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/declare_STDlev.h	(revision 5099)
@@ -45,10 +45,10 @@
            5000., 1000./
 !$OMP THREADPRIVATE(rlevSTD8) 
-!
+
       REAL geo500(klon)
 
 ! nout : niveau de output des variables a une pression donnee
       logical oknondef(klon,nlevSTD,nout)
-!
+
 ! les produits uvSTD, vqSTD, .., T2STD sont calcules
 ! a partir des valeurs instantannees toutes les 6 h
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/diag_slp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/diag_slp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/diag_slp.F90	(revision 5099)
@@ -41,5 +41,5 @@
   pab1(:)=pab(:,1)
   CALL pppmer(nlon,1,nlon,pab1,pphis,tasfc,tastd,pmer)
-!
+
   RETURN
   END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dimpft.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dimpft.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dimpft.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       INTEGER nvm_lmdz
 !      PARAMETER (nvm_lmdz=13)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dimphy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dimphy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dimphy.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
   MODULE dimphy
   
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dimsoil.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dimsoil.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dimsoil.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER nsoilmx
       PARAMETER (nsoilmx=11)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1DUTILS.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1DUTILS.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1DUTILS.h	(revision 5099)
@@ -1,11 +1,10 @@
 #include "conf_gcm.F90"
 
-!
 ! $Id$
-!
-!
-!
+
+
+
       SUBROUTINE conf_unicol
-!
+
 #ifdef CPP_IOIPSL
       use IOIPSL
@@ -18,5 +17,5 @@
 !-----------------------------------------------------------------------
 !     Auteurs :   A. Lahellec  .
-!
+
 !   Declarations :
 !   --------------
@@ -27,16 +26,15 @@
 #include "fcg_gcssold.h"
 #include "fcg_racmo.h"
-!
-!
+
+
 !   local:
 !   ------
 
 !      CHARACTER ch1*72,ch2*72,ch3*72,ch4*12
-      
-!
+
 !  -------------------------------------------------------------------
-!
+
 !      .........    Initilisation parametres du lmdz1D      ..........
-!
+
 !---------------------------------------------------------------------
 !   initialisations:
@@ -120,5 +118,5 @@
 !         > 100 ==> forcing_case = .true. or forcing_case2 = .true.
 !             initial profiles from case.nc file 
-!
+
        forcing_type = 0
        CALL getin('forcing_type',forcing_type)
@@ -652,11 +650,11 @@
       write(lunout,*)' +++++++++++++++++++++++++++++++++++++++'
       write(lunout,*)
-!
+
       RETURN
       END
-!
+
 ! $Id: dyn1deta0.F 1279 2010/07/30 A Lahellec$
-!
-!
+
+
       SUBROUTINE dyn1deta0(fichnom,plev,play,phi,phis,presnivs,                 &
      &                          ucov,vcov,temp,q,omega2)
@@ -719,7 +717,6 @@
       print*,'after open startphy ',fichnom,nmq
 
-!
 ! Lecture des parametres de controle:
-!
+
       CALL get_var("controle",tab_cntrl)
        
@@ -744,10 +741,10 @@
 !      pa         = tab_cntrl(18)
 !      preff      = tab_cntrl(19)
-!
+
 !      clon       = tab_cntrl(20)
 !      clat       = tab_cntrl(21)
 !      grossismx  = tab_cntrl(22)
 !      grossismy  = tab_cntrl(23)
-!
+
       IF ( tab_cntrl(24).EQ.1. )  THEN
         fxyhypb  =.true.
@@ -765,6 +762,6 @@
       itau_dyn = tab_cntrl(31)
 !   .................................................................
-!
-!
+
+
 !      PRINT*,'rad,omeg,g,cpp,kappa',rad,omeg,g,cpp,kappa
 !Al1
@@ -773,5 +770,5 @@
 
 !  Lecture des champs
-!
+
       CALL get_field("play",play,found)
       IF (.NOT. found) PRINT*, modname//'Le champ <Play> est absent'
@@ -801,11 +798,11 @@
       CALL close_startphy
       print*,' close startphy',fichnom,play(1,1),play(1,klev),temp(1,klev)
-!
+
       RETURN
       END
-!
+
 ! $Id: dyn1dredem.F 1279 2010/07/29 A Lahellec$
-!
-!
+
+
       SUBROUTINE dyn1dredem(fichnom,plev,play,phi,phis,presnivs,           &
      &                          ucov,vcov,temp,q,omega2)
@@ -854,5 +851,5 @@
       character*20 modname
       character*80 abort_message
-!
+
       INTEGER pass
 
@@ -896,5 +893,5 @@
 !       tab_cntrl(18) = pa
 !       tab_cntrl(19) = preff
-!
+
 !    .....    parametres  pour le zoom      ......   
 
@@ -903,5 +900,5 @@
 !       tab_cntrl(22)  = grossismx
 !       tab_cntrl(23)  = grossismy
-!
+
       IF ( fxyhypb )   THEN
        tab_cntrl(24) = 1.
@@ -923,8 +920,7 @@
        tab_cntrl(30) = FLOAT(day_end)
        tab_cntrl(31) = FLOAT(itau_dyn + itaufin)
-!
+
       DO pass=1,2
       CALL put_var(pass,"controle","Param. de controle Dyn1D",tab_cntrl)
-!
 
 !  Ecriture/extension de la coordonnee temps
@@ -932,5 +928,5 @@
 
 !  Ecriture des champs
-!
+
       CALL put_field(pass,"plev","p interfaces sauf la nulle",plev)
       CALL put_field(pass,"play","",play)
@@ -953,5 +949,4 @@
       ENDDO
 
-!
       RETURN
       END
@@ -999,8 +994,8 @@
  
       USE IOIPSL
-!
+
 ! Stops the simulation cleanly, closing files and printing various
 ! comments
-!
+
 !  Input: modname = name of calling program
 !         message = stuff to print
@@ -1021,5 +1016,5 @@
       write(*,*) 'Reason = ',message
       call getin_dump
-!
+
       if (ierr .eq. 0) then
         write(*,*) 'Everything is cool'
@@ -1030,5 +1025,5 @@
       END
       REAL FUNCTION fq_sat(kelvin, millibar)
-!
+
       IMPLICIT none
 !======================================================================
@@ -1039,37 +1034,37 @@
 ! kelvin---input-R: temperature en Kelvin
 ! millibar--input-R: pression en mb
-!
+
 ! fq_sat----output-R: vapeur d'eau saturante en kg/kg
 !======================================================================
-!
+
       REAL kelvin, millibar
-!
+
       REAL r2es
       PARAMETER (r2es=611.14 *18.0153/28.9644)
-!
+
       REAL r3les, r3ies, r3es
       PARAMETER (R3LES=17.269)
       PARAMETER (R3IES=21.875)
-!
+
       REAL r4les, r4ies, r4es
       PARAMETER (R4LES=35.86)
       PARAMETER (R4IES=7.66)
-!
+
       REAL rtt
       PARAMETER (rtt=273.16)
-!
+
       REAL retv
       PARAMETER (retv=28.9644/18.0153 - 1.0)
-!
+
       REAL zqsat
       REAL temp, pres
 !     ------------------------------------------------------------------
-!
-!
+
+
       temp = kelvin
       pres = millibar * 100.0
 !      write(*,*)'kelvin,millibar=',kelvin,millibar
 !      write(*,*)'temp,pres=',temp,pres
-!
+
       IF (temp .LE. rtt) THEN
          r3es = r3ies
@@ -1079,11 +1074,11 @@
          r4es = r4les
       ENDIF
-!
+
       zqsat=r2es/pres * EXP ( r3es*(temp-rtt) / (temp-r4es) )
       zqsat=MIN(0.5,ZQSAT)
       zqsat=zqsat/(1.-retv  *zqsat)
-!
+
       fq_sat = zqsat
-!
+
       RETURN
       END
@@ -1131,31 +1126,31 @@
 !    le disvert de dyn3d (qui permet d'utiliser grille avec ab,bp imposes)
 !    (MPL 18092012)
-!
+
 !    Auteur :  P. Le Van .
-!
+
       IMPLICIT NONE
  
       include "dimensions.h"
       include "paramet.h"
-!
+
 !=======================================================================
-!
-!
+
+
 !    s = sigma ** kappa   :  coordonnee  verticale
 !    dsig(l)            : epaisseur de la couche l ds la coord.  s
 !    sig(l)             : sigma a l'interface des couches l et l-1
 !    ds(l)              : distance entre les couches l et l-1 en coord.s
-!
+
 !=======================================================================
-!
+
       REAL pa,preff
       REAL ap(llmp1),bp(llmp1),dpres(llm),nivsigs(llm),nivsig(llmp1)
       REAL presnivs(llm)
-!
+
 !   declarations:
 !   -------------
-!
+
       REAL sig(llm+1),dsig(llm)
-!
+
       INTEGER l
       REAL snorm
@@ -1165,5 +1160,5 @@
  
 !-----------------------------------------------------------------------
-!
+
       pi=2.*ASIN(1.)
  
@@ -1186,6 +1181,5 @@
       CLOSE(99)
       alpha=deltaz/(llm*h)
-!
- 
+
        DO 1  l = 1, llm
        dsig(l) = (alpha+(1.-alpha)*exp(-beta*(llm-l)))*                    &
@@ -1203,6 +1197,5 @@
        dsig(l) = sig(l)-sig(l+1)
    2   CONTINUE
-!
- 
+
       ELSE
 !-----------------------------------------------------------------------
@@ -1238,13 +1231,10 @@
         nivsig(l)= FLOAT(l)
       ENDDO
- 
-!
+
 !    ....  Calculs  de ap(l) et de bp(l)  ....
 !    .........................................
-!
-!
+
 !   .....  pa et preff sont lus  sur les fichiers start par lectba  .....
-!
- 
+
       bp(llmp1) =   0.
  
@@ -1256,5 +1246,5 @@
       bp(l) = EXP( 1. -1./( sig(l)*sig(l)) )
       ap(l) = pa * ( sig(l) - bp(l) )
-!
+
       ENDDO
       ap(llmp1) = pa * ( sig(llmp1) - bp(llmp1) )
@@ -1278,12 +1268,12 @@
 !!======================================================================
 !       SUBROUTINE read_tsurf1d(knon,sst_out)
-!
+
 !! This subroutine specifies the surface temperature to be used in 1D simulations
-!
+
 !      USE dimphy, ONLY : klon
-!
+
 !      INTEGER, INTENT(IN)                  :: knon     ! nomber of points on compressed grid
 !      REAL, DIMENSION(klon), INTENT(OUT)   :: sst_out  ! tsurf used to force the single-column model
-!
+
 !       INTEGER :: i
 !! COMMON defined in lmdz1d.F:
@@ -1294,7 +1284,7 @@
 !        sst_out(i) = ts_cur
 !       ENDDO
-!
+
 !      END SUBROUTINE read_tsurf1d
-!
+
 !===============================================================
       subroutine advect_vert(llm,w,dt,q,plev)
@@ -1513,26 +1503,26 @@
       REAL paprs(klon,klevp1)
       REAL pplay(klon,klev)
-!
+
 !      Variables d'etat
       REAL t(klon,klev)
       REAL q(klon,klev)
-!
+
 !   Profiles cible
       REAL t_targ(klon,klev)
       REAL rh_targ(klon,klev)
-!
+
    INTEGER k,i
    REAL zx_qs
 
 ! Declaration des constantes et des fonctions thermodynamiques
-!
+
 include "YOMCST.h"
 include "YOETHF.h"
-!
+
 !  ----------------------------------------
 !  Statement functions
 include "FCTTRE.h"
 !  ----------------------------------------
-!
+
         DO k = 1,klev
          DO i = 1,klon
@@ -1548,6 +1538,6 @@
       print *, 't_targ',t_targ
       print *, 'rh_targ',rh_targ
-!
-!
+
+
       RETURN
       END
@@ -1562,15 +1552,15 @@
       REAL paprs(klon,klevp1)
       REAL pplay(klon,klev)
-!
+
 !      Variables d'etat
       REAL u(klon,klev)
       REAL v(klon,klev)
-!
+
 !   Profiles cible
       REAL u_targ(klon,klev)
       REAL v_targ(klon,klev)
-!
+
    INTEGER k,i
-!
+
         DO k = 1,klev
          DO i = 1,klon
@@ -1581,6 +1571,6 @@
       print *, 'u_targ',u_targ
       print *, 'v_targ',v_targ
-!
-!
+
+
       RETURN
       END
@@ -1597,17 +1587,17 @@
       REAL paprs(klon,klevp1)
       REAL pplay(klon,klev)
-!
+
 !      Variables d'etat
       REAL t(klon,klev)
       REAL q(klon,klev)
-!
+
 ! Tendances
       REAL d_t(klon,klev)
       REAL d_q(klon,klev)
-!
+
 !   Profiles cible
       REAL t_targ(klon,klev)
       REAL rh_targ(klon,klev)
-!
+
 !   Temps de relaxation
       REAL tau
@@ -1615,18 +1605,18 @@
 !!      DATA tau /5400./
       DATA tau /1800./
-!
+
    INTEGER k,i
    REAL zx_qs, rh, tnew, d_rh, rhnew
 
 ! Declaration des constantes et des fonctions thermodynamiques
-!
+
 include "YOMCST.h"
 include "YOETHF.h"
-!
+
 !  ----------------------------------------
 !  Statement functions
 include "FCTTRE.h"
 !  ----------------------------------------
-!
+
         print *,'dtime, tau ',dtime,tau
         print *, 't_targ',t_targ
@@ -1634,5 +1624,5 @@
         print *,'temp ',t
         print *,'hum ',q
-!
+
         DO k = 1,klev
          DO i = 1,klon
@@ -1644,16 +1634,16 @@
             ENDIF
             rh = q(i,k)/zx_qs
-!
+
             d_t(i,k) = d_t(i,k) + 1./tau*(t_targ(i,k)-t(i,k))
             d_rh = 1./tau*(rh_targ(i,k)-rh)
-!
+
             tnew = t(i,k)+d_t(i,k)*dtime
 !jyg<
 !   Formule pour q :
 !                         d_q = (1/tau) [rh_targ*qsat(T_new) - q] 
-!
+
 !  Cette formule remplace d_q = (1/tau) [rh_targ - rh] qsat(T_new)
 !   qui n'etait pas correcte.
-!
+
             IF (tnew.LT.RTT) THEN
                zx_qs = qsats(tnew)/(pplay(i,k))
@@ -1664,12 +1654,12 @@
             d_q(i,k) = d_q(i,k) + (1./tau)*(rh_targ(i,k)*zx_qs - q(i,k))
             rhnew = (q(i,k)+d_q(i,k)*dtime)/zx_qs
-!
+
             print *,' k,d_t,rh,d_rh,rhnew,d_q ',    &
                       k,d_t(i,k),rh,d_rh,rhnew,d_q(i,k)
            ENDIF
-!
+
          ENDDO
         ENDDO
-!
+
       RETURN
       END
@@ -1686,17 +1676,17 @@
       REAL paprs(klon,klevp1)
       REAL pplay(klon,klev)
-!
+
 !      Variables d'etat
       REAL u(klon,klev)
       REAL v(klon,klev)
-!
+
 ! Tendances
       REAL d_u(klon,klev)
       REAL d_v(klon,klev)
-!
+
 !   Profiles cible
       REAL u_targ(klon,klev)
       REAL v_targ(klon,klev)
-!
+
 !   Temps de relaxation
       REAL tau
@@ -1704,8 +1694,7 @@
 !      DATA tau /5400./
        DATA tau /43200./
-!
+
    INTEGER k,i
 
-!
         !print *,'dtime, tau ',dtime,tau
         !print *, 'u_targ',u_targ
@@ -1717,15 +1706,15 @@
 !CR: nudging everywhere
 !           IF (paprs(i,1)-pplay(i,k) .GT. 10000.) THEN
-!
+
             d_u(i,k) = d_u(i,k) + 1./tau*(u_targ(i,k)-u(i,k))
             d_v(i,k) = d_v(i,k) + 1./tau*(v_targ(i,k)-v(i,k))
-!
+
 !           print *,' k,u,d_u,v,d_v ',    &
 !                     k,u(i,k),d_u(i,k),v(i,k),d_v(i,k)
 !           ENDIF
-!
+
          ENDDO
         ENDDO
-!
+
       RETURN
       END
@@ -1739,5 +1728,5 @@
      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas &
      &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                 &
-!
+
      &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas                                        &
      &         ,qv_mod_cas,ql_mod_cas,qi_mod_cas,u_mod_cas,v_mod_cas                                   &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_decl_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_decl_cases.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_decl_cases.h	(revision 5099)
@@ -109,5 +109,5 @@
 !       real dt_gabls4
 !       parameter (dt_gabls4=3600.) ! 1 forcage ttes les heures
-!
+
 !profils initiaux:
 !       real plev_gabls4(nlev_gabls4)
@@ -119,5 +119,5 @@
 !       real u_gabi(nlev_gabls4), v_gabi(nlev_gabls4),ug_gabi(nlev_gabls4), vg_gabi(nlev_gabls4)
 !       real ht_gabi(nlev_gabls4),hq_gabi(nlev_gabls4),poub(nlev_gabls4)
-!       
+
 !forcings
 ! Lignes a detruire ...
@@ -128,5 +128,5 @@
 !       real ug_profg(nlev_gabls4),vg_profg(nlev_gabls4)
 !       real tg_profg
-!        
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_interp_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_interp_cases.h	(revision 5099)
@@ -18,5 +18,5 @@
      &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
      &       ,uw_cas,vw_cas,q1_cas,q2_cas,tkes_cas                                           &
-!
+
      &       ,ts_prof_cas,tskin_prof_cas,ps_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas  &
      &       ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas                              &
@@ -51,5 +51,5 @@
      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas    &
      &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                    &
-!
+
      &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas          &
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas                                                 &
@@ -183,5 +183,5 @@
        print *,'1D_interp: sens,flat',fsens,flat
       ENDIF
-!
+
       IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_nudge_sandu_astex.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_nudge_sandu_astex.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_nudge_sandu_astex.h	(revision 5099)
@@ -1,4 +1,4 @@
       do l = 1, llm
-!
+
 ! au dessus de 700hPa, on relaxe vers profil init
 !      on fait l'hypothese que dans ce cas, il n'y a plus d'eau liq. au dessus 700hpa
@@ -10,5 +10,5 @@
        relax_thl(l)=0.
 !      print *,'nudge: l tau_sandu u u_mod',l,tau_sandu,u(l),u_mod(l)
-!
+
        if (l.ge.llm700) then 
          relax_q(l,1)=(q(l,1)-q_mod(l))/tau_sandu
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_read_forc_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1D_read_forc_cases.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 !----------------------------------------------------------------------
 ! forcing_les = .T. : Impose a constant cooling 
@@ -32,5 +32,5 @@
      &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
      &       ,uw_cas,vw_cas,q1_cas,q2_cas,tkes_cas                                           &
-!
+
      &       ,ts_prof_cas,tskin_prof_cas,ps_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas  &
      &       ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas                              &
@@ -61,5 +61,5 @@
      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas    &
      &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                    &
-!
+
      &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas          &
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas                                                 &
@@ -129,5 +129,5 @@
        flat=-1.*lat_prof_cas
        ENDIF
-!
+
        IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1Dconv.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1Dconv.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/1Dconv.h	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 ! $Id$
-!
+
         subroutine get_uvd(itap,dtime,file_forctl,file_fordat,                  &
      &       ht,hq,hw,hu,hv,hthturb,hqturb,                                     &
      &       Ts,imp_fcg,ts_fcg,Tp_fcg,Turb_fcg)                                 
-!
+
         implicit none
  
@@ -109,5 +109,5 @@
         real Tsbef
         save htbef,hqbef,hwbef,hubef,hvbef,hthturbbef,hqturbbef
-!
+
         real timeaft,timebef
         save timeaft,timebef
@@ -131,5 +131,5 @@
         real hqturb_mes(100) !tendance horizontale d humidite, due aux
                               !flux turbulents
-!
+
 !---------------------------------------------------------------------
 ! variable argument de la subroutine copie
@@ -149,5 +149,5 @@
 !*** on determine le pas du meso_NH correspondant au nouvel itap ***
 !*** pour aller chercher les champs dans rdgrads                 ***
-!
+
         time=time0+itap*dtime
 !c        temps=int(time/dt+1)
@@ -156,8 +156,8 @@
         pas=min(temps,pasmax-1)
              print*,'le pas Meso est:',pas
-!
-!
+
+
 !===================================================================
-!
+
 !*** on remplit les champs before avec les champs after du pas   ***
 !*** precedent en format gcm                                     ***
@@ -190,5 +190,4 @@
      &                  ,hu_mes,hv_mes,hthturb_mes,hqturb_mes                 &
      &                  ,ts_fcg,ts_subr,imp_fcg,Turb_fcg)
-!
 
                if(Tp_fcg) then
@@ -203,5 +202,5 @@
          enddo
         endif  ! Turb_fcg
-!
+
                print*,'ht_mes ',(ht_mes(i),i=1,nblvlm)
                print*,'hq_mes ',(hq_mes(i),i=1,nblvlm)
@@ -286,5 +285,5 @@
          ts_subr = ((timeaft-time)*tsbef + (time-timebef)*tsaft)/dt
        endif ! temps.ge.pasmax
-!
+
         print *,' time,timebef,timeaft',time,timebef,timeaft
         print *,' ht,htbef,htaft,hthturb,hthturbbef,hthturbaft'
@@ -298,10 +297,10 @@
      &             hqturb(j),hqturbbef(j),hqturbaft(j)
         enddo
-!
+
 !-------------------------------------------------------------------
-!
+
          IF (Ts_fcg) Ts = Ts_subr
          return
-!
+
 !-----------------------------------------------------------------------
 ! on sort les champs de "convergence" pour l instant initial 'in'
@@ -312,10 +311,10 @@
      &           imp_fcg,ts_fcg,Tp_fcg,Turb_fcg)
              print*,'le pas itap est:',itap
-!
+
 !===================================================================
-!
+
        write(*,'(a)') 'OPEN '//file_forctl
        open(97,FILE=file_forctl,FORM='FORMATTED')
-!
+
 !------------------
       do i=1,1000
@@ -355,7 +354,7 @@
                   pasprev=in-1
                   time0=dt*pasprev
-!
+
           close(98)
-!
+
       write(*,'(a)') 'OPEN '//file_fordat
       open(99,FILE=file_fordat,FORM='UNFORMATTED',                          &
@@ -371,5 +370,5 @@
           print *, 'get_uvd : rdgrads ->'
           print *, tp_fcg
-!
+
 ! following commented out because we have temperature already in ARM case
 !   (otherwise this is the potential temperature )
@@ -445,11 +444,11 @@
           close(99)
           close(98)
-!
+
 !-------------------------------------------------------------------
-!
-!
+
+
  100      IF (Ts_fcg) Ts = Ts_subr
         return
-!
+
 999     continue
         stop 'erreur lecture, file forcing.ctl'
@@ -565,15 +564,15 @@
       SUBROUTINE mesolupbis(file_forctl)
       implicit none 
-!
+
 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-!
+
 ! Lecture descripteur des donnees MESO-NH (forcing.ctl):
 ! -------------------------------------------------------
-!
+
 !     Cette subroutine lit dans le fichier de controle "essai.ctl"
 !     et affiche le nombre de niveaux du Meso-NH ainsi que les valeurs
 !     des pressions en milieu de couche du Meso-NH (en Pa puis en hPa).
 !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
-!
+
       INTEGER nblvlm !nombre de niveau de pression du mesoNH
       REAL playm(100)  !pression en Pa milieu de chaque couche Meso-NH
@@ -591,14 +590,14 @@
       lu=9
       open(lu,file=file_forctl,form='formatted')
-!
+
       do i=1,1000
       read(lu,1000,end=999) a
       if (a .eq. 'ZDEF') go to 100
       enddo
-!
+
  100  backspace(lu)
       print*,'  DESCRIPTION DES 2 MODELES : '
       print*,' '
-!
+
       read(lu,2000) aaa
  2000  format (a80)
@@ -607,9 +606,8 @@
          read(anblvl,*) nblvlm
 
-!
       print*,'nbre de niveaux de pression Meso-NH :',nblvlm
       print*,' '
       print*,'pression en Pa de chaque couche du meso-NH :'
-!
+
       read(lu,*) (playm(mlz),mlz=1,nblvlm)
 !      Si la pression est en HPa, la multiplier par 100
@@ -620,19 +618,19 @@
       endif
       print*,(playm(mlz),mlz=1,nblvlm)
-!
+
  1000 format (a4)
  1001 format(5x,i2)
-!
+
       print*,' '
       do mlzh=1,nblvlm
       hplaym(mlzh)=playm(mlzh)/100.
       enddo
-!
+
       print*,'pression en hPa de chaque couche du meso-NH: '
       print*,(hplaym(mlzh),mlzh=1,nblvlm)
-!
+
       close (lu)
       return
-!
+
  999  stop 'erreur lecture des niveaux pression des donnees'
       end
@@ -645,12 +643,12 @@
       real hthtur(nl),hqtur(nl)
       real ts
-!
+
       INTEGER k
-!
+
       LOGICAL imp_fcg,ts_fcg,Turb_fcg
-!
+
       icomp = icount
-!
-!
+
+
          do k=1,nl
             icomp=icomp+1
@@ -667,5 +665,5 @@
             read(itape,rec=icomp)hQ(k)
          enddo
-!
+
              if(turb_fcg) then
          do k=1,nl
@@ -679,5 +677,5 @@
              endif
          print *,' apres lecture hthtur, hqtur'
-!
+
           if(imp_fcg) then
 
@@ -692,15 +690,15 @@
 
           endif
-!
+
          do k=1,nl
             icomp=icomp+1
             read(itape,rec=icomp)hw(k)
          enddo
-!
+
               if(ts_fcg) then
          icomp=icomp+1
          read(itape,rec=icomp)ts
               endif
-!
+
       print *,' rdgrads ->'
 
@@ -756,5 +754,5 @@
        endif
       enddo
-!
+
 !c      if (play(klev) .le. playm(nblvlm)) then
 !c         mlz=nblvlm-1
@@ -765,5 +763,5 @@
 !c     *            /(playm(mlz+1)-playm(mlz))
 !c      endif
-!
+
       print*,' '
       print*,'         INTERPOLATION  : '
@@ -779,5 +777,5 @@
       print*,'valeurs du deuxieme coef d"interpolation pour les 9 niveaux:'
       print*,(coef2(k),k=1,klev)
-!
+
       return
       end
@@ -821,14 +819,14 @@
       END
       CHARACTER*(*) FUNCTION SPACES(STR,NSPACE)
-!
+
 ! CERN PROGLIB# M433    SPACES          .VERSION KERNFOR  4.14  860211
 ! ORIG.  6/05/86 M.GOOSSENS/DD
-!
+
 !-    The function value SPACES returns the character string STR with
 !-    leading blanks removed and each occurence of one or more blanks
 !-    replaced by NSPACE blanks inside the string STR
-!
+
       CHARACTER*(*) STR
-!
+
       LENSPA = LEN(SPACES)
       SPACES = ' '
@@ -853,16 +851,16 @@
   999 END
       FUNCTION INDEXC(STR,SSTR)
-!
+
 ! CERN PROGLIB# M433    INDEXC          .VERSION KERNFOR  4.14  860211
 ! ORIG. 26/03/86 M.GOOSSENS/DD
-!
+
 !-    Find the leftmost position where substring SSTR does not match
 !-    string STR scanning forward
-!
+
       CHARACTER*(*) STR,SSTR
-!
+
       LENS   = LEN(STR)
       LENSS  = LEN(SSTR)
-!
+
       DO 10 I=1,LENS-LENSS+1
           IF (STR(I:I+LENSS-1).NE.SSTR) THEN
@@ -872,4 +870,4 @@
    10 CONTINUE
       INDEXC = 0
-!
+
   999 END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/compar1d.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/compar1d.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/compar1d.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: compar1d.h 2010-08-04 17:02:56Z lahellec $
-!
+
       integer :: forcing_type
       integer :: tend_u,tend_v,tend_w,tend_t,tend_q,tend_rayo
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz1d.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz1d.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz1d.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 !#ifdef CPP_1D
 !#include "../dyn3d/mod_const_mpi.F90"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90	(revision 5099)
@@ -352,5 +352,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5099)
@@ -823,5 +823,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: mod_1D_cases_read.F90 2373 2015-10-13 17:28:01Z jyg $
-!
+
 MODULE mod_1D_cases_read2
   USE netcdf, ONLY: nf90_get_var,nf90_noerr,nf90_inq_varid,nf90_inquire_dimension,nf90_strerror,nf90_open,&
@@ -372,5 +372,5 @@
     else
        allocate(time_val(nt_cas))
-       ierr = NF90_GET_VAR(nid,timeid,time_val)
+       ierr = nf90_get_var(nid,timeid,time_val)
        if(ierr/=nf90_noerr) then
           print *,'Pb a la lecture de time cas.nc: '
@@ -582,5 +582,5 @@
      print *,'Dans read_cas2, on va lire ',var3didin(i),name_var(i)
      if(i<=35) then
-        ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime])
+        ierr = nf90_get_var(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime])
         print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i)
         if(ierr/=nf90_noerr) then
@@ -590,5 +590,5 @@
      else
         print *,'Dans read_cas2, on a lu ',ierr,var3didin(i),name_var(i)
-        ierr = NF90_GET_VAR(nid,var3didin(i),resul1, count = [1, 1, ntime])
+        ierr = nf90_get_var(nid,var3didin(i),resul1, count = [1, 1, ntime])
         if(ierr/=nf90_noerr) then
            print *,'Pb a la lecture de cas.nc: ',name_var(i)
@@ -702,5 +702,5 @@
         !-----------------------------------------------------------------------
         if(i<=4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),apbp, count = [1, 1, nlevel + 1])
+           ierr = nf90_get_var(nid,var3didin(i),apbp, count = [1, 1, nlevel + 1])
            print *,'read2_cas(apbp), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -710,5 +710,5 @@
            !-----------------------------------------------------------------------
         else if(i>4.and.i<=45) then   ! Lecture des variables en (time,nlevel,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime])
+           ierr = nf90_get_var(nid,var3didin(i),resul, count = [1, 1, nlevel, ntime])
            print *,'read2_cas(resul), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -718,5 +718,5 @@
            !-----------------------------------------------------------------------
         else if (i>45.and.i<=51) then   ! Lecture des variables en (time,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul2, count = [1, 1, ntime])
+           ierr = nf90_get_var(nid,var3didin(i),resul2, count = [1, 1, ntime])
            print *,'read2_cas(resul2), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -726,5 +726,5 @@
            !-----------------------------------------------------------------------
         else     ! Lecture des constantes (lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
+           ierr = nf90_get_var(nid,var3didin(i),resul3)
            print *,'read2_cas(resul3), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -877,5 +877,5 @@
         !-----------------------------------------------------------------------
         if(i<=4) then     ! Lecture des coord pression en (nlevelp1,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
+           ierr = nf90_get_var(nid,var3didin(i),apbp)
            print *,'read2_cas(apbp), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -885,5 +885,5 @@
            !-----------------------------------------------------------------------
         else if(i>4.and.i<=12) then   ! Lecture des variables en (time,nlevel,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
+           ierr = nf90_get_var(nid,var3didin(i),resul1)
            print *,'read2_cas(resul1), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -894,5 +894,5 @@
            !-----------------------------------------------------------------------
         else if(i>12.and.i<=54) then   ! Lecture des variables en (time,nlevel,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul)
+           ierr = nf90_get_var(nid,var3didin(i),resul)
            print *,'read2_cas(resul), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -903,5 +903,5 @@
            !-----------------------------------------------------------------------
         else if (i>54.and.i<=65) then   ! Lecture des variables en (time,lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
+           ierr = nf90_get_var(nid,var3didin(i),resul2)
            print *,'read2_cas(resul2), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -912,5 +912,5 @@
            !-----------------------------------------------------------------------
         else     ! Lecture des constantes (lat,lon)
-           ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
+           ierr = nf90_get_var(nid,var3didin(i),resul3)
            print *,'read2_cas(resul3), on a lu ',i,name_var(i)
            if(ierr/=nf90_noerr) then
@@ -1042,5 +1042,5 @@
   !---------------------------------------------------------------------------------------
   ! Time interpolation of a 2D field to the timestep corresponding to day
-  !
+
   ! day: current julian day (e.g. 717538.2)
   ! day1: first day of the simulation
@@ -1235,5 +1235,5 @@
      ,lat_cas,sens_cas,ustar_cas                                        &
      ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas                               &
-     !
+
      ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas               &
      ,thv_prof_cas,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas     &
@@ -1251,5 +1251,5 @@
   !---------------------------------------------------------------------------------------
   ! Time interpolation of a 2D field to the timestep corresponding to day
-  !
+
   ! day: current julian day (e.g. 717538.2)
   ! day1: first day of the simulation
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: mod_1D_cases_read.F90 2373 2015-10-13 17:28:01Z jyg $
-!
+
 MODULE mod_1D_cases_read_std
   USE netcdf, ONLY:nf90_noerr,nf90_inq_varid,nf90_inq_dimid,nf90_inquire_dimension,nf90_open,nf90_nowrite,&
@@ -147,5 +147,5 @@
     else
        allocate(time_val(nt_cas))
-       ierr = NF90_GET_VAR(nid,timeid,time_val)
+       ierr = nf90_get_var(nid,timeid,time_val)
        if(ierr/=nf90_noerr) then
           print *,'A Pb a la lecture de time cas.nc: '
@@ -454,5 +454,5 @@
           !-----------------------------------------------------------------------
           if(i<=4) then
-             ierr = NF90_GET_VAR(nid,var3didin(i),apbp)
+             ierr = nf90_get_var(nid,var3didin(i),apbp)
              print *,'read_SCM(apbp), on a lu ',i,name_var(i)
              if(ierr/=nf90_noerr) then
@@ -465,5 +465,5 @@
              !-----------------------------------------------------------------------
           else if(i>4.and.i<=12) then
-             ierr = NF90_GET_VAR(nid,var3didin(i),resul1)
+             ierr = nf90_get_var(nid,var3didin(i),resul1)
              print *,'read_SCM(resul1), on a lu ',i,name_var(i)
              if(ierr/=nf90_noerr) then
@@ -478,5 +478,5 @@
              !-----------------------------------------------------------------------
           else if(i>12.and.i<=61) then
-             ierr = NF90_GET_VAR(nid,var3didin(i),resul)
+             ierr = nf90_get_var(nid,var3didin(i),resul)
              print *,'read_SCM(resul), on a lu ',i,name_var(i)
              if(ierr/=nf90_noerr) then
@@ -490,5 +490,5 @@
              !-----------------------------------------------------------------------
           else if (i>62.and.i<=75) then
-             ierr = NF90_GET_VAR(nid,var3didin(i),resul2)
+             ierr = nf90_get_var(nid,var3didin(i),resul2)
              print *,'read_SCM(resul2), on a lu ',i,name_var(i)
              if(ierr/=nf90_noerr) then
@@ -502,5 +502,5 @@
              !-----------------------------------------------------------------------
           else
-             ierr = NF90_GET_VAR(nid,var3didin(i),resul3)
+             ierr = nf90_get_var(nid,var3didin(i),resul3)
              print *,'read_SCM(resul3), on a lu ',i,name_var(i)
              if(ierr/=nf90_noerr) then
@@ -640,5 +640,5 @@
        ,lat_cas,sens_cas,ustar_cas                                        &
        ,uw_cas,vw_cas,q1_cas,q2_cas,tkes_cas                               &
-       !
+
        ,ts_prof_cas,tskin_prof_cas,ps_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas               &
        ,thv_prof_cas,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas     &
@@ -662,5 +662,5 @@
     !---------------------------------------------------------------------------------------
     ! Time interpolation of a 2D field to the timestep corresponding to day
-    !
+
     ! day: current julian day (e.g. 717538.2)
     ! day1: first day of the simulation
@@ -919,5 +919,5 @@
        ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas &
        ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                 &
-       !
+
        ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas                                        &
        ,qv_mod_cas,ql_mod_cas,qi_mod_cas,u_mod_cas,v_mod_cas                                   &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5099)
@@ -314,5 +314,5 @@
        enddo
           
-         ierr = NF90_GET_VAR(nid,var3didin(1),lat)
+         ierr = nf90_get_var(nid,var3didin(1),lat)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -321,5 +321,5 @@
 !         write(*,*)'lecture lat ok',lat
 
-         ierr = NF90_GET_VAR(nid,var3didin(2),lon)
+         ierr = nf90_get_var(nid,var3didin(2),lon)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -328,5 +328,5 @@
 !         write(*,*)'lecture lon ok',lon
  
-         ierr = NF90_GET_VAR(nid,var3didin(3),alt)
+         ierr = nf90_get_var(nid,var3didin(3),alt)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -335,5 +335,5 @@
 !          write(*,*)'lecture alt ok',alt
  
-         ierr = NF90_GET_VAR(nid,var3didin(4),phis)
+         ierr = nf90_get_var(nid,var3didin(4),phis)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -342,5 +342,5 @@
 !          write(*,*)'lecture phis ok',phis
           
-         ierr = NF90_GET_VAR(nid,var3didin(5),T)
+         ierr = nf90_get_var(nid,var3didin(5),T)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -349,5 +349,5 @@
 !         write(*,*)'lecture T ok'
 
-         ierr = NF90_GET_VAR(nid,var3didin(6),q)
+         ierr = nf90_get_var(nid,var3didin(6),q)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -361,5 +361,5 @@
        enddo
        enddo
-         ierr = NF90_GET_VAR(nid,var3didin(7),u)
+         ierr = nf90_get_var(nid,var3didin(7),u)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -368,5 +368,5 @@
 !         write(*,*)'lecture u ok'
 
-         ierr = NF90_GET_VAR(nid,var3didin(8),v)
+         ierr = nf90_get_var(nid,var3didin(8),v)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -375,5 +375,5 @@
 !         write(*,*)'lecture v ok'
 
-         ierr = NF90_GET_VAR(nid,var3didin(9),omega)
+         ierr = nf90_get_var(nid,var3didin(9),omega)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -388,5 +388,5 @@
        enddo
 
-         ierr = NF90_GET_VAR(nid,var3didin(10),div)
+         ierr = nf90_get_var(nid,var3didin(10),div)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -395,5 +395,5 @@
 !         write(*,*)'lecture div ok'
 
-         ierr = NF90_GET_VAR(nid,var3didin(11),T_adv_h)
+         ierr = nf90_get_var(nid,var3didin(11),T_adv_h)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -409,5 +409,5 @@
 
 
-         ierr = NF90_GET_VAR(nid,var3didin(12),T_adv_v)
+         ierr = nf90_get_var(nid,var3didin(12),T_adv_v)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -422,5 +422,5 @@
        enddo
 
-         ierr = NF90_GET_VAR(nid,var3didin(13),q_adv_h)
+         ierr = nf90_get_var(nid,var3didin(13),q_adv_h)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -436,5 +436,5 @@
 
 
-         ierr = NF90_GET_VAR(nid,var3didin(14),q_adv_v)
+         ierr = nf90_get_var(nid,var3didin(14),q_adv_v)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -450,35 +450,35 @@
 
 
-         ierr = NF90_GET_VAR(nid,var3didin(15),s)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(16),s_adv_h)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(17),s_adv_v)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(18),p_srf_aver)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(19),p_srf_center)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(20),T_srf)
+         ierr = nf90_get_var(nid,var3didin(15),s)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(16),s_adv_h)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(17),s_adv_v)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(18),p_srf_aver)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(19),p_srf_center)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(20),T_srf)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -530,6 +530,6 @@
          endif
 
-         ierr = NF90_GET_VAR(nid,timevar,time)
-         ierr = NF90_GET_VAR(nid,levvar,lev)
+         ierr = nf90_get_var(nid,timevar,time)
+         ierr = nf90_get_var(nid,levvar,lev)
 
        return
@@ -943,5 +943,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
@@ -1462,5 +1462,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
@@ -1554,5 +1554,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
@@ -1696,5 +1696,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
@@ -1809,5 +1809,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day 
 ! day1: first day of the simulation
@@ -1896,5 +1896,5 @@
 !---------------------------------------------------------------------------------------
 ! Time interpolation of a 2D field to the timestep corresponding to day
-!
+
 ! day: current julian day (e.g. 717538.2)
 ! day1: first day of the simulation
@@ -2279,5 +2279,5 @@
 !      call catchaxis(nid,ntime,nlevel,time,z,ierr)
  
-         ierr = NF90_GET_VAR(nid,var3didin(1),zz)
+         ierr = nf90_get_var(nid,var3didin(1),zz)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2286,5 +2286,5 @@
 !          write(*,*)'lecture z ok',zz
 
-         ierr = NF90_GET_VAR(nid,var3didin(2),thl)
+         ierr = nf90_get_var(nid,var3didin(2),thl)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2293,5 +2293,5 @@
 !          write(*,*)'lecture thl ok',thl
 
-         ierr = NF90_GET_VAR(nid,var3didin(3),qt)
+         ierr = nf90_get_var(nid,var3didin(3),qt)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2300,5 +2300,5 @@
 !          write(*,*)'lecture qt ok',qt
  
-         ierr = NF90_GET_VAR(nid,var3didin(4),u)
+         ierr = nf90_get_var(nid,var3didin(4),u)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2307,5 +2307,5 @@
 !          write(*,*)'lecture u ok',u
 
-         ierr = NF90_GET_VAR(nid,var3didin(5),v)
+         ierr = nf90_get_var(nid,var3didin(5),v)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2314,5 +2314,5 @@
 !          write(*,*)'lecture v ok',v
 
-         ierr = NF90_GET_VAR(nid,var3didin(6),tke)
+         ierr = nf90_get_var(nid,var3didin(6),tke)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2321,5 +2321,5 @@
 !          write(*,*)'lecture tke ok',tke
 
-         ierr = NF90_GET_VAR(nid,var3didin(7),ug)
+         ierr = nf90_get_var(nid,var3didin(7),ug)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2328,5 +2328,5 @@
 !          write(*,*)'lecture ug ok',ug
 
-         ierr = NF90_GET_VAR(nid,var3didin(8),vg)
+         ierr = nf90_get_var(nid,var3didin(8),vg)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2335,5 +2335,5 @@
 !          write(*,*)'lecture vg ok',vg
 
-         ierr = NF90_GET_VAR(nid,var3didin(9),wls)
+         ierr = nf90_get_var(nid,var3didin(9),wls)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2342,5 +2342,5 @@
 !          write(*,*)'lecture wls ok',wls
 
-         ierr = NF90_GET_VAR(nid,var3didin(10),dqtdx)
+         ierr = nf90_get_var(nid,var3didin(10),dqtdx)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2349,5 +2349,5 @@
 !          write(*,*)'lecture dqtdx ok',dqtdx
 
-         ierr = NF90_GET_VAR(nid,var3didin(11),dqtdy)
+         ierr = nf90_get_var(nid,var3didin(11),dqtdy)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2356,5 +2356,5 @@
 !          write(*,*)'lecture dqtdy ok',dqtdy
 
-         ierr = NF90_GET_VAR(nid,var3didin(12),dqtdt)
+         ierr = nf90_get_var(nid,var3didin(12),dqtdt)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2363,5 +2363,5 @@
 !          write(*,*)'lecture dqtdt ok',dqtdt
 
-         ierr = NF90_GET_VAR(nid,var3didin(13),thl_rad)
+         ierr = nf90_get_var(nid,var3didin(13),thl_rad)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2549,5 +2549,5 @@
 !      call catchaxis(nid,ntime,nlevel,time,z,ierr)
  
-         ierr = NF90_GET_VAR(nid,var3didin(1),zz)
+         ierr = nf90_get_var(nid,var3didin(1),zz)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2556,5 +2556,5 @@
 !          write(*,*)'lecture zz ok',zz
  
-         ierr = NF90_GET_VAR(nid,var3didin(11),pres)
+         ierr = nf90_get_var(nid,var3didin(11),pres)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2563,5 +2563,5 @@
 !          write(*,*)'lecture pres ok',pres
 
-         ierr = NF90_GET_VAR(nid,var3didin(12),th)
+         ierr = nf90_get_var(nid,var3didin(12),th)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2573,5 +2573,5 @@
            enddo
 
-         ierr = NF90_GET_VAR(nid,var3didin(13),qv)
+         ierr = nf90_get_var(nid,var3didin(13),qv)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2580,5 +2580,5 @@
 !          write(*,*)'lecture qv ok',qv
  
-         ierr = NF90_GET_VAR(nid,var3didin(14),u)
+         ierr = nf90_get_var(nid,var3didin(14),u)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2587,5 +2587,5 @@
 !          write(*,*)'lecture u ok',u
 
-         ierr = NF90_GET_VAR(nid,var3didin(15),v)
+         ierr = nf90_get_var(nid,var3didin(15),v)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2594,5 +2594,5 @@
 !          write(*,*)'lecture v ok',v
 
-         ierr = NF90_GET_VAR(nid,var3didin(16),o3)
+         ierr = nf90_get_var(nid,var3didin(16),o3)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2601,5 +2601,5 @@
 !          write(*,*)'lecture o3 ok',o3
 
-         ierr = NF90_GET_VAR(nid,var3didin(2),shf)
+         ierr = nf90_get_var(nid,var3didin(2),shf)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2608,5 +2608,5 @@
 !          write(*,*)'lecture shf ok',shf
 
-         ierr = NF90_GET_VAR(nid,var3didin(3),lhf)
+         ierr = nf90_get_var(nid,var3didin(3),lhf)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2615,5 +2615,5 @@
 !          write(*,*)'lecture lhf ok',lhf
 
-         ierr = NF90_GET_VAR(nid,var3didin(4),lwup)
+         ierr = nf90_get_var(nid,var3didin(4),lwup)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2622,5 +2622,5 @@
 !          write(*,*)'lecture lwup ok',lwup
 
-         ierr = NF90_GET_VAR(nid,var3didin(5),swup)
+         ierr = nf90_get_var(nid,var3didin(5),swup)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2629,5 +2629,5 @@
 !          write(*,*)'lecture swup ok',swup
 
-         ierr = NF90_GET_VAR(nid,var3didin(6),tg)
+         ierr = nf90_get_var(nid,var3didin(6),tg)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2636,5 +2636,5 @@
 !          write(*,*)'lecture tg ok',tg
 
-         ierr = NF90_GET_VAR(nid,var3didin(7),ustar)
+         ierr = nf90_get_var(nid,var3didin(7),ustar)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2643,5 +2643,5 @@
 !          write(*,*)'lecture ustar ok',ustar
 
-         ierr = NF90_GET_VAR(nid,var3didin(8),psurf)
+         ierr = nf90_get_var(nid,var3didin(8),psurf)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2650,5 +2650,5 @@
 !          write(*,*)'lecture psurf ok',psurf
 
-         ierr = NF90_GET_VAR(nid,var3didin(9),ug)
+         ierr = nf90_get_var(nid,var3didin(9),ug)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2657,5 +2657,5 @@
 !          write(*,*)'lecture ug ok',ug
 
-         ierr = NF90_GET_VAR(nid,var3didin(10),vg)
+         ierr = nf90_get_var(nid,var3didin(10),vg)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2664,5 +2664,5 @@
 !          write(*,*)'lecture vg ok',vg
 
-         ierr = NF90_GET_VAR(nid,var3didin(17),hadvt)
+         ierr = nf90_get_var(nid,var3didin(17),hadvt)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2671,5 +2671,5 @@
 !          write(*,*)'lecture hadvt ok',hadvt
 
-         ierr = NF90_GET_VAR(nid,var3didin(18),hadvq)
+         ierr = nf90_get_var(nid,var3didin(18),hadvq)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2678,5 +2678,5 @@
 !          write(*,*)'lecture hadvq ok',hadvq
 
-         ierr = NF90_GET_VAR(nid,var3didin(19),hadvu)
+         ierr = nf90_get_var(nid,var3didin(19),hadvu)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2685,5 +2685,5 @@
 !          write(*,*)'lecture hadvu ok',hadvu
 
-         ierr = NF90_GET_VAR(nid,var3didin(20),hadvv)
+         ierr = nf90_get_var(nid,var3didin(20),hadvv)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2692,5 +2692,5 @@
 !          write(*,*)'lecture hadvv ok',hadvv
 
-         ierr = NF90_GET_VAR(nid,var3didin(21),w)
+         ierr = nf90_get_var(nid,var3didin(21),w)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2699,5 +2699,5 @@
 !          write(*,*)'lecture w ok',w
 
-         ierr = NF90_GET_VAR(nid,var3didin(22),omega)
+         ierr = nf90_get_var(nid,var3didin(22),omega)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
@@ -2844,89 +2844,89 @@
 !      call catchaxis(nid,ntime,nlevel,time,z,ierr)
  
-         ierr = NF90_GET_VAR(nid,var3didin(1),zz_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(2),depth_sn)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(3),ug_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(4),vg_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(5),pf_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(6),th_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(7),t_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(8),qv_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(9),u_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(10),v_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(11),hadvt_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(12),hadvq_i)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(14),tsnow)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
- 
-         ierr = NF90_GET_VAR(nid,var3didin(15),snow_dens)
-         if(ierr/=nf90_noerr) then
-            write(*,*) nf90_strerror(ierr)
-            stop "getvarup"
-         endif
-
-         ierr = NF90_GET_VAR(nid,var3didin(16),tg)
+         ierr = nf90_get_var(nid,var3didin(1),zz_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(2),depth_sn)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(3),ug_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(4),vg_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(5),pf_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(6),th_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(7),t_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(8),qv_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(9),u_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(10),v_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(11),hadvt_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(12),hadvq_i)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(14),tsnow)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+ 
+         ierr = nf90_get_var(nid,var3didin(15),snow_dens)
+         if(ierr/=nf90_noerr) then
+            write(*,*) nf90_strerror(ierr)
+            stop "getvarup"
+         endif
+
+         ierr = nf90_get_var(nid,var3didin(16),tg)
          if(ierr/=nf90_noerr) then
             write(*,*) nf90_strerror(ierr)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_interp_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_interp_cases.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_interp_cases.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: 1D_interp_cases.h 3537 2019-06-19 08:29:16Z fhourdin $
-!
+
 !---------------------------------------------------------------------
 ! Forcing_LES case: constant dq_dyn
@@ -552,5 +552,5 @@
 
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-!
+
 !      d_t_adv(l) = 0.0
 !      d_q_adv(l,1) = 0.0
@@ -634,5 +634,5 @@
 
        alpha = rd*temp(l)*(1.+(rv/rd-1.)*q(l,1))/play(l)
-!
+
 !      d_t_adv(l) = 0.0
 !      d_q_adv(l,1) = 0.0
@@ -813,5 +813,5 @@
        flat=lat_prof_cas
       ENDIF
-!
+
       IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
@@ -841,5 +841,5 @@
      &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
      &       ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas                                           &
-!
+
      &       ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas  &
      &       ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas                              &
@@ -864,5 +864,5 @@
      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas    &
      &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                    &
-!
+
      &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas          &
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas                         &
@@ -1024,5 +1024,5 @@
        print *,'1D_interp: sens,flat',fsens,flat
       ENDIF
-!
+
       IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_read_forc_cases.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_read_forc_cases.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1D_read_forc_cases.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: 1D_read_forc_cases.h 3537 2019-06-19 08:29:16Z fhourdin $
-!
+
 !----------------------------------------------------------------------
 ! forcing_les = .T. : Impose a constant cooling 
@@ -394,5 +394,5 @@
 ! vertical interpolation using TOGA interpolation routine:
 !      write(*,*)'avant interp vert', t_proftwp
-!
+
 !     CALL interp_dice_time(daytime,day1,annee_ref
 !    i             ,year_ini_dice,day_ju_ini_dice,nt_dice,dt_dice
@@ -508,5 +508,5 @@
 ! vertical interpolation using TOGA interpolation routine:
 !      write(*,*)'avant interp vert', t_proftwp
-!
+
 !     CALL interp_dice_time(daytime,day1,annee_ref
 !    i             ,year_ini_dice,day_ju_ini_dice,nt_dice,dt_dice
@@ -542,8 +542,6 @@
        ug(l)=ug_mod(l)
        vg(l)=vg_mod(l)
-       
-!
+
 !	tg=tsurf
-!       
 
        print *,'***** tsurf=',tsurf
@@ -605,5 +603,5 @@
 ! For this case, profiles are given for two vertical resolution
 ! 19 or 40 levels
-!
+
 ! Comment from: http://www.knmi.nl/samenw/eurocs/ARM/profiles.html
 ! Note that the initial profiles contain no liquid water! 
@@ -932,5 +930,5 @@
      &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
      &       ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas                                           &
-!
+
      &       ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas  &
      &       ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas                              &
@@ -955,5 +953,5 @@
      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas    &
      &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                    &
-!
+
      &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas          &
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas                         &
@@ -1002,5 +1000,5 @@
        flat=-1.*lat_prof_cas
        ENDIF
-!
+
        IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
@@ -1031,5 +1029,5 @@
      &       ,dq_cas,hq_cas,vq_cas,dth_cas,hth_cas,vth_cas,lat_cas,sens_cas,ustar_cas       &
      &       ,uw_cas,vw_cas,q1_cas,q2_cas,tke_cas                                           &
-!
+
      &       ,ts_prof_cas,plev_prof_cas,t_prof_cas,theta_prof_cas,thv_prof_cas  &
      &       ,thl_prof_cas,qv_prof_cas,ql_prof_cas,qi_prof_cas                              &
@@ -1054,5 +1052,5 @@
      &         ,dt_prof_cas,ht_prof_cas,vt_prof_cas,dtrad_prof_cas,dq_prof_cas,hq_prof_cas,vq_prof_cas    &
      &         ,dth_prof_cas,hth_prof_cas,vth_prof_cas                                                    &
-!
+
      &         ,t_mod_cas,theta_mod_cas,thv_mod_cas,thl_mod_cas,qv_mod_cas,ql_mod_cas,qi_mod_cas          &
      &         ,u_mod_cas,v_mod_cas,ug_mod_cas,vg_mod_cas,w_mod_cas,omega_mod_cas                         &
@@ -1102,5 +1100,5 @@
        flat=-1.*lat_prof_cas
        ENDIF
-!
+
        IF (ok_prescr_ust) THEN
        ust=ustar_prof_cas
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_lmdz1d.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_lmdz1d.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_lmdz1d.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id: lmdz1d.F90 3540 2019-06-25 14:50:13Z fairhead $
-!
 
       SUBROUTINE old_lmdz1d
@@ -164,7 +163,7 @@
 ! DECLARATIONS FOR EACH CASE
 !=====================================================================
-!
+
       INCLUDE "old_1D_decl_cases.h"
-!
+
 !---------------------------------------------------------------------
 !  Declarations related to nudging
@@ -179,5 +178,5 @@
      real :: u_targ(llm)
      real :: v_targ(llm)
-!
+
 !---------------------------------------------------------------------
 !  Declarations related to vertical discretization:
@@ -258,10 +257,10 @@
       integer jcode
       INTEGER read_climoz 
-!
+
       integer :: it_end ! iteration number of the last call
 !Al1
       integer ecrit_slab_oc !1=ecrit,-1=lit,0=no file
       data ecrit_slab_oc/-1/
-!
+
 !     if flag_inhib_forcing = 0, tendencies of forcing are added
 !                           <> 0, tendencies of forcing are not added
@@ -365,5 +364,5 @@
 !             use geostrophic wind ug=10m/s vg=0m/s. Duration of the case 53100s 
 !             Radiation to be switched off
-!
+
       if (forcing_type <=0) THEN
        forcing_les = .true.
@@ -459,5 +458,5 @@
         if (forcing_toga.or.forcing_sandu.or.forcing_astex .or. forcing_dice)                 &
       type_ts_forcing = 1
-!
+
 ! Initialization of the logical switch for nudging
      jcode = iflag_nudge
@@ -513,5 +512,5 @@
       endif
 !-----------------------------------------------------------------------
-!
+
 !c Date :
 !      La date est supposee donnee sous la forme [annee, numero du jour dans 
@@ -631,5 +630,4 @@
       d_q_nudge(:,:) = 0.
 
-!
 !   No ozone climatology need be read in this pre-initialization
 !          (phys_state_var_init is called again in physiq)
@@ -666,5 +664,4 @@
       rho(1)=psurf/(rd*tsurf*(1.+(rv/rd-1.)*qsurf)) 
 
-!
 !! mpl et jyg le 22/08/2012 : 
 !!  pour que les cas a flux de surface imposes marchent
@@ -718,5 +715,4 @@
       ENDIF
 
-!
 !=====================================================================
 ! EVENTUALLY, READ FORCING DATA :
@@ -743,5 +739,5 @@
 
 !  Rq: conf_phys.F90 lit tous les flags de physiq.def; conf_phys appele depuis physiq.F
-!
+
 ! day_step, iphysiq lus dans gcm.def ci-dessus
 ! timestep: calcule ci-dessous from rday et day_step
@@ -757,8 +753,8 @@
       timestep =rday/day_step
       dtime_frcg = timestep
-!
+
       zcufi=airefi
       zcvfi=airefi
-!
+
       rlat_rad(1)=xlat*rpi/180.
       rlon_rad(1)=xlon*rpi/180.
@@ -899,5 +895,5 @@
         sig1=0.
         w01=0.
-!
+
         wake_deltaq = 0.
         wake_deltat = 0.
@@ -932,5 +928,5 @@
 !------------------------------------------------------------------------
 ! Make file containing restart for the physics (startphy.nc)
-!
+
 ! NB: List of the variables to be written by phyredem (via put_field):
 ! rlon,rlat,zmasq,pctsrf(:,is_ter),pctsrf(:,is_lic),pctsrf(:,is_oce)
@@ -943,5 +939,5 @@
 ! wake_deltat,wake_deltaq,wake_s,awake_s,wake_dens,awake_dens,cv_gen,wake_cstar,
 ! wake_fip,wake_delta_pbl_tke(:,1:klev,nsrf)
-!
+
 ! NB2: The content of the startphy.nc file depends on some flags defined in
 ! the ".def" files. However, since conf_phys is not called in lmdz1d.F90, these flags have 
@@ -1028,5 +1024,5 @@
          open(97,file='div_slab.dat',STATUS='OLD')
        endif
-!
+
 !---------------------------------------------------------------------
 !    Initialize target profile for RHT nudging if needed
@@ -1038,5 +1034,5 @@
         call nudge_UV_init(plev,play,u,v,u_targ,v_targ)
       endif
-!
+
 !=====================================================================
 #ifdef OUTPUT_PHYS_SCM
@@ -1196,15 +1192,15 @@
        cfdt = cos(0.5*fcoriolis*timestep)
 !       print *,'fcoriolis,sfdt,cfdt,timestep',fcoriolis,sfdt,cfdt,timestep
-!
+
         du_age(1:mxcalc)= -2.*sfdt/timestep*                                &
             (sfdt*(u(1:mxcalc)-ug(1:mxcalc)) -                          &
              cfdt*(v(1:mxcalc)-vg(1:mxcalc))  )
 !!     : fcoriolis*(v(1:mxcalc)-vg(1:mxcalc))
-!
+
        dv_age(1:mxcalc)= -2.*sfdt/timestep*                                 &
             (cfdt*(u(1:mxcalc)-ug(1:mxcalc)) +                           &
              sfdt*(v(1:mxcalc)-vg(1:mxcalc))  )
 !!     : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!
 !  Nudging
@@ -1222,5 +1218,5 @@
                     d_u_nudge,d_v_nudge)
       endif
-!
+
        if (forcing_fire) THEN
 
@@ -1251,5 +1247,5 @@
 !         call  writefield_phy('u_tend' ,u,llm)
 !         call  writefield_phy('u_g' ,ug,llm)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !! Increment state variables
@@ -1301,5 +1297,5 @@
 
         teta=temp*(pzero/play)**rkappa
-!
+
 !---------------------------------------------------------------------
 !   Nudge soil temperature if requested
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90	(revision 5099)
@@ -98,5 +98,5 @@
 ! comments
 !=======================================================================
-!
+
 !  Input: modname = name of calling program
 !         message = stuff to print
@@ -113,5 +113,5 @@
       write(*,*) 'Reason = ',message
       call getin_dump
-!
+
       if (ierr == 0) then
         write(*,*) 'Everything is cool'
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/scm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/scm.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/scm.F90	(revision 5099)
@@ -128,7 +128,7 @@
 ! DECLARATIONS FOR EACH CASE
 !=====================================================================
-!
+
       INCLUDE "1D_decl_cases.h"
-!
+
 !---------------------------------------------------------------------
 !  Declarations related to nudging
@@ -143,5 +143,5 @@
      real :: u_targ(llm)
      real :: v_targ(llm)
-!
+
 !---------------------------------------------------------------------
 !  Declarations related to vertical discretization:
@@ -223,10 +223,10 @@
       integer jcode
       INTEGER read_climoz 
-!
+
       integer :: it_end ! iteration number of the last call
 !Al1,plev,play,phi,phis,presnivs,
       integer ecrit_slab_oc !1=ecrit,-1=lit,0=no file
       data ecrit_slab_oc/-1/
-!
+
 !     if flag_inhib_forcing = 0, tendencies of forcing are added
 !                           <> 0, tendencies of forcing are not added
@@ -287,5 +287,5 @@
 
       print*,'NATURE DE LA SURFACE ',nat_surf
-!
+
 ! Initialization of the logical switch for nudging
 
@@ -344,5 +344,5 @@
       endif
 !-----------------------------------------------------------------------
-!
+
 !c Date :
 !      La date est supposee donnee sous la forme [annee, numero du jour dans 
@@ -409,5 +409,4 @@
       d_q_nudge(:,:) = 0.
 
-!
 !   No ozone climatology need be read in this pre-initialization
 !          (phys_state_var_init is called again in physiq)
@@ -436,5 +435,4 @@
       rho(1)=psurf/(rd*tsurf*(1.+(rv/rd-1.)*qsurf)) 
 
-!
 !! mpl et jyg le 22/08/2012 : 
 !!  pour que les cas a flux de surface imposes marchent
@@ -484,5 +482,4 @@
       ENDIF
 
-!
 !=====================================================================
 ! EVENTUALLY, READ FORCING DATA :
@@ -503,5 +500,5 @@
 
 !  Rq: conf_phys.F90 lit tous les flags de physiq.def; conf_phys appele depuis physiq.F
-!
+
 ! day_step, iphysiq lus dans gcm.def ci-dessus
 ! timestep: calcule ci-dessous from rday et day_step
@@ -519,8 +516,8 @@
       timestep =rday/day_step
       dtime_frcg = timestep
-!
+
       zcufi=airefi
       zcvfi=airefi
-!
+
       rlat_rad(1)=xlat*rpi/180.
       rlon_rad(1)=xlon*rpi/180.
@@ -655,5 +652,5 @@
         sig1=0.
         w01=0.
-!
+
         wake_deltaq = 0.
         wake_deltat = 0.
@@ -689,5 +686,5 @@
 !------------------------------------------------------------------------
 ! Make file containing restart for the physics (startphy.nc)
-!
+
 ! NB: List of the variables to be written by phyredem (via put_field):
 ! rlon,rlat,zmasq,pctsrf(:,is_ter),pctsrf(:,is_lic),pctsrf(:,is_oce)
@@ -700,5 +697,5 @@
 ! wake_deltat,wake_deltaq,wake_s,awake_s,wake_dens,awake_dens,cv_gen,wake_cstar,
 ! wake_fip,wake_delta_pbl_tke(:,1:klev,nsrf)
-!
+
 ! NB2: The content of the startphy.nc file depends on some flags defined in
 ! the ".def" files. However, since conf_phys is not called in lmdz1d.F90, these flags have 
@@ -785,5 +782,5 @@
          open(97,file='div_slab.dat',STATUS='OLD')
        endif
-!
+
 !=====================================================================
 #ifdef OUTPUT_PHYS_SCM
@@ -927,5 +924,5 @@
              cfdt*(v(1:mxcalc)-vg(1:mxcalc))  )
 !!     : fcoriolis*(v(1:mxcalc)-vg(1:mxcalc))
-!
+
        d_v_age(1:mxcalc)= -2.*sfdt/timestep*                                 &
             (cfdt*(u(1:mxcalc)-ug(1:mxcalc)) +                           &
@@ -933,5 +930,5 @@
 !!     : -fcoriolis*(u(1:mxcalc)-ug(1:mxcalc))
       ENDIF
-!
+
 !---------------------------------------------------------------------
 !  Nudging
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ecumev6_flux.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ecumev6_flux.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ecumev6_flux.F90	(revision 5099)
@@ -80,8 +80,8 @@
 !!!
 !-------------------------------------------------------------------------------
-!
+
 !       0.   DECLARATIONS
 !            ------------
-!
+
 USE dimphy
 USE indice_sol_mod
@@ -93,18 +93,18 @@
 !USE MODD_SURF_ATM,         ONLY : XVCHRNK, XVZ0CM
 !USE MODD_REPROD_OPER,      ONLY : CCHARNOCK
-!
+
 !USE MODE_THERMOS
 !USE MODI_WIND_THRESHOLD
 !USE MODI_SURFACE_RI
-!
+
 !USE YOMHOOK,   ONLY : LHOOK,   DR_HOOK
 !USE PARKIND1,  ONLY : JPRB
-!
+
 !USE MODI_ABOR1_SFX
-!
+
 IMPLICIT NONE
-!
+
 !       0.1. Declarations of arguments
-!
+
 REAL, DIMENSION(klon), INTENT(IN)    :: PVMOD      ! module of wind at atm level (m/s)
 REAL, DIMENSION(klon), INTENT(IN)    :: PTA        ! air temperature at atm level (K)
@@ -126,7 +126,7 @@
 LOGICAL,            INTENT(IN)    :: OPERTFLUX
 REAL, DIMENSION(klon), INTENT(IN)    :: PRAIN     ! precipitation rate (kg/s/m2)
-!
+
 !INTEGER,            INTENT(IN)    :: KZ0
-!
+
 REAL, DIMENSION(klon), INTENT(INOUT) :: PSST       ! Sea Surface Temperature (K)
 REAL, DIMENSION(klon), INTENT(INOUT) :: PZ0SEA     ! roughness length over sea
@@ -148,5 +148,5 @@
 
 !       0.2. Declarations of local variables
-!
+
 ! specif SB
 INTEGER, DIMENSION(SIZE(PTA))     :: JCV        ! convergence index
@@ -155,5 +155,5 @@
 REAL, DIMENSION(SIZE(PTA))        :: PEXNA      ! Exner function at atm level
 REAL, DIMENSION(SIZE(PTA))       :: PEXNS      ! Exner function at atm level
-!
+
 REAL, DIMENSION(SIZE(PTA))        :: ZTAU       ! momentum flux (N/m2)
 REAL, DIMENSION(SIZE(PTA))        :: ZHF        ! sensible heat flux (W/m2)
@@ -249,5 +249,5 @@
 
 !REAL(KIND=JPRB) :: ZHOOK_HANDLE
-!
+
 !-------------------------------------------------------------------------------
 !----------------------- Modif Olive calcul de PRHOA ---------------------------
@@ -280,24 +280,24 @@
 
 !IF (LHOOK) CALL DR_HOOK('ECUMEV6_FLUX',0,ZHOOK_HANDLE)
-!
+
 ZDUSR0   = 1.E-06
 ZDTSR0   = 1.E-06
 ZDQSR0   = 1.E-09
-!
+
 NITERMAX = 5
 NITERSUP = 5
 OPCVFLX  = .TRUE.
-!
+
 NITERFL = NITERMAX
 IF (OPCVFLX) NITERFL = NITERMAX+NITERSUP
-!
+
 ZCOEFU = (/ 1.00E-03, 3.66E-02, -1.92E-03, 2.32E-04, -7.02E-06,  6.40E-08 /)
 ZCOEFT = (/ 5.36E-03, 2.90E-02, -1.24E-03, 4.50E-04, -2.06E-05,       0.0 /)
 ZCOEFQ = (/ 1.00E-03, 3.59E-02, -2.87E-04,      0.0,       0.0,       0.0 /)
-!
+
 ZUTU = 40.0
 ZUTT = 14.4
 ZUTQ = 10.0
-!
+
 ZCDIRU = ZCOEFU(1) + 2.0*ZCOEFU(2)*ZUTU + 3.0*ZCOEFU(3)*ZUTU**2   &
                    + 4.0*ZCOEFU(4)*ZUTU**3 + 5.0*ZCOEFU(5)*ZUTU**4
@@ -305,5 +305,5 @@
                    + 4.0*ZCOEFT(4)*ZUTT**3
 ZCDIRQ = ZCOEFQ(1) + 2.0*ZCOEFQ(2)*ZUTQ
-!
+
 ZORDOU = ZCOEFU(0) + ZCOEFU(1)*ZUTU + ZCOEFU(2)*ZUTU**2 + ZCOEFU(3)*ZUTU**3   &
                    + ZCOEFU(4)*ZUTU**4 + ZCOEFU(5)*ZUTU**5
@@ -311,12 +311,12 @@
                    + ZCOEFT(4)*ZUTT**4
 ZORDOQ = ZCOEFQ(0) + ZCOEFQ(1)*ZUTQ + ZCOEFQ(2)*ZUTQ**2
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !       1.   AUXILIARY CONSTANTS & ARRAY INITIALISATION BY UNDEFINED VALUES.
 !       --------------------------------------------------------------------
-!
+
 ZDIRCOSZW(:) = 1.0
-!
+
 ZETV    = XRV/XRD-1.0   !~0.61 (cf Liu et al. 1979)
 ZRDSRV  = XRD/XRV       !~0.622
@@ -326,7 +326,7 @@
 ZBTA    = 16.0
 ZGMA    = 7.0           !initially =4.7, modified to 7.0 following G. Caniaux
-!
+
 ZP00    = 1013.25E+02
-!
+
 PCD  = XUNDEF
 PCH  = XUNDEF
@@ -339,5 +339,5 @@
 ZHF  = XUNDEF
 ZEF  = XUNDEF
-!
+
 PSFTH  = XUNDEF
 PSFTQ  = XUNDEF
@@ -345,14 +345,14 @@
 PRESA  = XUNDEF
 PRI    = XUNDEF
-!
+
 ZTAUR   = 0.0
 ZRF     = 0.0
 ZEFWEBB = 0.0
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !       2.   INITIALISATIONS BEFORE ITERATIVE LOOP.
 !       -------------------------------------------
-!
+
 !ZVMOD(:) = WIND_THRESHOLD(PVMOD(:),PUREF(:))    !set a minimum value to wind
 ZVMOD = MAX(PVMOD , 0.1 * MIN(10.,PUREF) )    !set a minimum value to wind
@@ -360,11 +360,10 @@
 write(*,*) "ZVMOD ",SIZE(ZVMOD)
 
-!
 !       2.0. Radiative fluxes - For warm layer & cool skin
-!
+
 !       2.0b. Warm Layer correction
-!
+
 !       2.1. Specific humidity at saturation
-!
+
 WHERE(PSSS(:)>0.0.AND.PSSS(:)/=XUNDEF)
   PQSATA = QSAT_SEAWATER2 (PSST(:),PPS(:),PSSS(:))    !at sea surface
@@ -377,8 +376,8 @@
 !### OLIVIER POUR PRESSION SATURANTE #####
 !-------------------------------------------------------------------------------
-!
+
 ZFOES  = 1 !PSAT(PT(:))
 ZFOES  = 0.98*ZFOES
-!
+
 ZWORK1    = ZFOES/PPS
 ZWORK2    = XRD/XRV
@@ -398,17 +397,13 @@
 write(*,*) "PQSATA : ",PQSATA
 
-
-!
 !*       2.    COMPUTE SATURATION HUMIDITY
 !              ---------------------------
-!
+
 !PQSAT  = ZWORK2*ZWORK1 / (1.+(ZWORK2-1.)*ZWORK1)
 !ZQSATA = ZWORK2A*ZWORK1A / (1.+(ZWORK2A-1.)*ZWORK1A)
 ZQSATA = QSAT_SEAWATER (PTA(:),PPA(:))            !at sea surface
 
-
-!
 !       2.2. Gradients at the air-sea interface
-!
+
 ZDU(:) = ZVMOD(:)               !one assumes u is measured / sea surface current
 ZDT(:) = PTA(:)/PEXNA(:)-PSST(:)/PEXNS(:)
@@ -418,7 +413,7 @@
 write(*,*) "PQSAT",PQSAT(:)
 write(*,*) "ZDQ",ZDQ(:)
-!
+
 !       2.3. Latent heat of vaporisation
-!
+
 ZLVA(:) = XLVTT+(XCPV-XCL)*(PTA (:)-XTT)                !of pure water at atm level
 ZLVS(:) = XLVTT+(XCPV-XCL)*(PSST(:)-XTT)                !of pure water at sea surface
@@ -433,19 +428,19 @@
   ZLVS(:) = ZLVS(:)*(1.0-1.00472E-3*PSSS(:))            !of seawater at sea surface
 ENDWHERE
-!
+
 !       2.4. Specific heat of moist air (Businger 1982)
-!
+
 !ZCPA(:) = XCPD*(1.0+(XCPV/XCPD-1.0)*PQA(:))
 ZCPA(:) = XCPD
-!
+
 !       2.4b Kinematic viscosity of dry air (Andreas 1989, CRREL Rep. 89-11)
-!
+
 ZVISA(:) = 1.326E-05*(1.0+6.542E-03*(PTA(:)-XTT)+8.301E-06*(PTA(:)-XTT)**2   &
            -4.84E-09*(PTA(:)-XTT)**3)
-!
+
 !       2.4c Coefficients for warm layer and/or cool skin correction
-!
+
 !       2.5. Initial guess
-!
+
 ZDDU(:) = ZDU(:)
 ZDDT(:) = ZDT(:)
@@ -459,5 +454,4 @@
 write(*,*) "ZDDT ",ZDDT
 
-!
 JCV (:) = -1
 ZUSR(:) = 0.04*ZDDU(:)
@@ -468,15 +462,15 @@
 ZDELTAQ10N(:) = ZDDQ(:)
 JITER(:) = 99
-!
+
 ! In the following, we suppose that Richardson number PRI < XRIMAX
 ! If not true, Monin-Obukhov theory can't (and therefore shouldn't) be applied !
 !-------------------------------------------------------------------------------
-!
+
 !       3.   ITERATIVE LOOP TO COMPUTE U*, T*, Q*.
 !       ------------------------------------------
-!
+
 DO JJ=1,NITERFL
   DO JLON=1,SIZE(PTA)
-!
+
   IF (JCV(JLON) == -1) THEN
     ZUSR0(JLON)=ZUSR(JLON)
@@ -492,7 +486,7 @@
     ZDTSTO(JLON) = ZDELTAT10N(JLON)
     ZDQSTO(JLON) = ZDELTAQ10N(JLON)
-!
+
 !       3.1. Neutral parameter for wind speed (ECUME_V6 formulation)
-!
+
     IF (ZDELTAU10N(JLON) <= ZUTU) THEN
       ZPARUN(JLON) = ZCOEFU(0) + ZCOEFU(1)*ZDELTAU10N(JLON)      &
@@ -505,7 +499,7 @@
     ENDIF
     PCDN(JLON) = (ZPARUN(JLON)/ZDELTAU10N(JLON))**2
-!
+
 !       3.2. Neutral parameter for temperature (ECUME_V6 formulation)
-!
+
     IF (ZDELTAU10N(JLON) <= ZUTT) THEN
       ZPARTN(JLON) = ZCOEFT(0) + ZCOEFT(1)*ZDELTAU10N(JLON)      &
@@ -516,7 +510,7 @@
       ZPARTN(JLON) = ZCDIRT*(ZDELTAU10N(JLON)-ZUTT) + ZORDOT
     ENDIF
-!
+
 !       3.3. Neutral parameter for humidity (ECUME_V6 formulation)
-!
+
     IF (ZDELTAU10N(JLON) <= ZUTQ) THEN
       ZPARQN(JLON) = ZCOEFQ(0) + ZCOEFQ(1)*ZDELTAU10N(JLON)      &
@@ -525,17 +519,17 @@
       ZPARQN(JLON) = ZCDIRQ*(ZDELTAU10N(JLON)-ZUTQ) + ZORDOQ
     ENDIF
-!
+
 !       3.4. Scaling parameters U*, T*, Q*
-!
+
     ZUSR(JLON) = ZPARUN(JLON)
     ZTSR(JLON) = ZPARTN(JLON)*ZDELTAT10N(JLON)/ZDELTAU10N(JLON)
     ZQSR(JLON) = ZPARQN(JLON)*ZDELTAQ10N(JLON)/ZDELTAU10N(JLON)
-!
+
 !       3.4b Gustiness factor (Deardorff 1970)
-!
+
 !       3.4c Cool skin correction
-!
+
 !       3.5. Obukhovs stability param. z/l following Liu et al. (JAS, 1979)
-!
+
 ! For U
     ZLMOU = PUREF(JLON)*XG*XKARMAN*(ZTSR(JLON)/PTA(JLON)   &
@@ -545,8 +539,8 @@
     ZLMOU = MAX(MIN(ZLMOU,ZLMOMAX),ZLMOMIN)
     ZLMOT = MAX(MIN(ZLMOT,ZLMOMAX),ZLMOMIN)
-!
+
 !       3.6. Stability function psi (see Liu et al, 1979 ; Dyer and Hicks, 1970)
 !            Modified to include convective form following Fairall (unpublished)
-!
+
 ! For U
     IF (ZLMOU == 0.0) THEN
@@ -581,7 +575,7 @@
     ENDIF
     ZPSIT(JLON) = ZPSI_T
-!
+
 !       3.7. Update air-sea gradients
-!
+
     ZDDU(JLON) = ZDU(JLON)
     ZDDT(JLON) = ZDT(JLON)
@@ -601,7 +595,7 @@
     ZDELTAQ10N(JLON) = SIGN(MAX(ABS(ZDELTAQ10N(JLON)),10.0*ZDQSR0),   &
                             ZDELTAQ10N(JLON))
-!
+
 !       3.8. Test convergence for U*, T*, Q*
-!
+
     IF (ABS(ZUSR(JLON)-ZUSR0(JLON)) < ZDUSR0 .AND.   &
         ABS(ZTSR(JLON)-ZTSR0(JLON)) < ZDTSR0 .AND.   &
@@ -612,18 +606,18 @@
     JITER(JLON) = JJ
   ENDIF
-!
+
   ENDDO
 ENDDO
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !       4.   COMPUTATION OF TURBULENT FLUXES AND EXCHANGE COEFFICIENTS.
 !       ---------------------------------------------------------------
-!
+
 DO JLON=1,SIZE(PTA)
-!
+
 !       4.1. Surface turbulent fluxes
 !            (ATM CONV.: ZTAU<<0 ; ZHF,ZEF<0 if atm looses heat)
-!
+
   ZTAU(JLON) = -PRHOA(JLON)*ZUSR(JLON)**2
   ZHF(JLON)  = -PRHOA(JLON)*ZCPA(JLON)*ZUSR(JLON)*ZTSR(JLON)
@@ -634,7 +628,6 @@
   write(*,*) "LAT = ",ZEF(JLON)
 
-!
 !       4.2. Exchange coefficients PCD, PCH, PCE
-!
+
   PCD(JLON) = (ZUSR(JLON)/ZDDU(JLON))**2
   PCH(JLON) = (ZUSR(JLON)*ZTSR(JLON))/(ZDDU(JLON)*ZDDT(JLON))
@@ -645,7 +638,6 @@
   write(*,*) "ZQSR = ",ZQSR(JLON)
 
-!
 !       4.3. Stochastic perturbation of turbulent fluxes
-!
+
 !  IF( OPERTFLUX )THEN
 !    ZTAU(JLON) = ZTAU(JLON)* ( 1. + PPERTFLUX(JLON) / 2. )
@@ -653,28 +645,28 @@
 !    ZEF (JLON) = ZEF(JLON)*  ( 1. + PPERTFLUX(JLON) / 2. )
 !  ENDIF
-!
+
 ENDDO
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !       5.   COMPUTATION OF FLUX CORRECTIONS DUE TO RAINFALL.
 !            (ATM conv: ZRF<0 if atm. looses heat, ZTAUR<<0)
 !       -----------------------------------------------------
-!
+
 IF (OPRECIP) THEN
   DO JLON=1,SIZE(PTA)
-!
+
 !       5.1. Momentum flux due to rainfall (ZTAUR, N/m2)
-!
+
 ! See pp3752 in FBR96.
     ZTAUR(JLON) = -0.85*PRAIN(JLON)*PVMOD(JLON)
-!
+
 !       5.2. Sensible heat flux due to rainfall (ZRF, W/m2)
-!
+
 ! See Eq.12 in GoF95 with ZCPWA as specific heat of water at atm level (J/kg/K),
 ! ZDQSDT from Clausius-Clapeyron relation, ZDWAT as water vapor diffusivity 
 ! (Eq.13-3 of Pruppacher and Klett, 1978), ZDTMP as heat diffusivity, and ZBULB
 ! as wet-bulb factor (Eq.11 in GoF95).
-!
+
     ZTAC   = PTA(JLON)-XTT
     ZCPWA  = 4217.51 -3.65566*ZTAC +0.1381*ZTAC**2       &
@@ -688,13 +680,13 @@
     ZRF(JLON) = PRAIN(JLON)*ZCPWA*ZBULB*((PSST(JLON)-PTA(JLON))   &
                 +(PQSATA(JLON)-PQA(JLON))*(ZLVA(JLON)*ZDWAT)/(ZCPA(JLON)*ZDTMP))
-!
+
   ENDDO
 ENDIF
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !       6.   COMPUTATION OF WEBB CORRECTION TO LATENT HEAT FLUX (ZEFWEBB, W/m2).
 !       ------------------------------------------------------------------------
-!
+
 ! See Eq.21 and Eq.22 in FBR96.
 IF (OPWEBB) THEN
@@ -705,37 +697,37 @@
   ENDDO
 ENDIF
-!
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
 !       7.   FINAL STEP : TOTAL SURFACE FLUXES AND DERIVED DIAGNOSTICS. 
 !       ---------------------------------------------------------------
-!
+
 !       7.1. Richardson number
-!
+
 ! CALL SURFACE_RI(PSST,PQSAT,PEXNS,PEXNA,PTA,PQA,   &
 !                PZREF,PUREF,ZDIRCOSZW,PVMOD,PRI)
-!
+
 !       7.2. Friction velocity which contains correction due to rain
-!
+
 ZUSTAR2(:) = -(ZTAU(:)+ZTAUR(:))/PRHOA(:)       !>>0 as ZTAU<<0 & ZTAUR<=0
-!
+
 IF (OPRECIP) THEN
   PCD(:) = ZUSTAR2(:)/ZDDU(:)**2
 ENDIF
-!
+
 PUSTAR(:) = SQRT(ZUSTAR2(:))                    !>>0
-!
+
 !       7.3. Aerodynamical conductance and resistance
-!
+
 ZAC  (:) = PCH(:)*ZDDU(:)
 PRESA(:) = 1.0/ZAC(:)
-!
+
 !       7.4. Total surface fluxes
-!
+
 PSFTH(:) =  ZHF(:)+ZRF(:)
 PSFTQ(:) = (ZEF(:)+ZEFWEBB(:))/ZLVS(:)
-!
+
 !       7.5. Charnock number
-!
+
 IF (CCHARNOCK == 'OLD') THEN
   ZCHARN(:) = XVCHRNK
@@ -743,7 +735,7 @@
   ZCHARN(:) = MIN(0.018,MAX(0.011,0.011+(0.007/8.0)*(ZDDU(:)-10.0)))
 ENDIF
-!
+
 !       7.6. Roughness lengths Z0 and Z0H over sea
-!
+
 !IF (KZ0 == 0) THEN      ! ARPEGE formulation
 !  PZ0SEA (:) = (ZCHARN(:)/XG)*ZUSTAR2(:) + XVZ0CM*PCD(:)/PCDN(:)
@@ -770,8 +762,8 @@
        PCE,&
        PCH]
-!
-!
+
+
 !IF (LHOOK) CALL DR_HOOK('ECUMEV6_FLUX',1,ZHOOK_HANDLE)
-!
+
 !-------------------------------------------------------------------------------
    END SUBROUTINE ECUMEV6_FLUX
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ener_conserv.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ener_conserv.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ener_conserv.F90	(revision 5099)
@@ -46,5 +46,5 @@
 REAL, DIMENSION(klon,klev), INTENT(IN)      :: masse,exner
 REAL, DIMENSION(klon,klev+1), INTENT(IN)    :: dtke
-!
+
 REAL, DIMENSION(klon,klev), INTENT(OUT)     :: d_t_ec
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/fcg_gcssold.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/fcg_gcssold.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/fcg_gcssold.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: fcg_gcssold.h 2010-08-10 17:02:56Z lahellec $
-!
+
       logical :: imp_fcg_gcssold,ts_fcg_gcssold,Tp_fcg_gcssold
       logical :: Tp_ini_gcssold
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/fcg_racmo.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/fcg_racmo.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/fcg_racmo.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: fcg_racmo.h 2011-02-16 17:02:56Z cheruy $
-!
+
       real   :: a_guide 
       logical :: ok_invertp 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/flott_gwd_rando_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/flott_gwd_rando_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/flott_gwd_rando_m.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 module FLOTT_GWD_rando_m
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/flux_arp.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/flux_arp.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/flux_arp.h	(revision 5099)
@@ -1,6 +1,6 @@
-!
+
 ! $Id: flux_arp.h 2010-08-04 17:02:56Z lahellec $
 ! Modif EV, 10/2020
-!
+
       logical :: ok_flux_surf
       logical :: ok_prescr_ust !for prescribed ustar
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/fonte_neige_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/fonte_neige_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/fonte_neige_mod.F90	(revision 5099)
@@ -1,10 +1,10 @@
-!
+
 ! $Header$
-!
+
 MODULE fonte_neige_mod
-!
+
 ! This module will treat the process of snow, melting, accumulating, calving, in 
 ! case of simplified soil model.
-!
+
 !****************************************************************************************
   USE dimphy, ONLY : klon
@@ -52,7 +52,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE fonte_neige_init(restart_runoff)
 
@@ -60,5 +60,5 @@
 ! The variable run_off_lic_0 is initialized to the field read from
 ! restart file. The other variables are initialized to zero.
-!
+
 !****************************************************************************************
 ! Input argument
@@ -73,5 +73,5 @@
 !****************************************************************************************
 ! Allocate run-off at landice and initilize with field read from restart
-!
+
 !****************************************************************************************
 
@@ -85,5 +85,5 @@
 !****************************************************************************************
 ! Allocate other variables and initilize to zero
-!
+
 !****************************************************************************************
     ALLOCATE(run_off_ter(klon), stat = error)
@@ -131,5 +131,5 @@
 !****************************************************************************************
 ! Read tau_calv
-!
+
 !****************************************************************************************
     CALL conf_interface(tau_calv)
@@ -150,5 +150,5 @@
     USE isotopes_verif_mod
 #endif
-!
+
 !****************************************************************************************
 ! Input argument
@@ -164,5 +164,5 @@
 !****************************************************************************************
 ! Allocate run-off at landice and initilize with field read from restart
-!
+
 !****************************************************************************************
 
@@ -185,5 +185,5 @@
 !****************************************************************************************
 ! Allocate other variables and initilize to zero
-!
+
 !****************************************************************************************
 
@@ -226,7 +226,6 @@
 #endif
 
-!
-!****************************************************************************************
-!
+!****************************************************************************************
+
   SUBROUTINE fonte_neige( knon, nisurf, knindex, dtime, &
        tsurf, precip_rain, precip_snow, &
@@ -258,5 +257,5 @@
 !   precip_rain  precipitations liquides
 !   precip_snow  precipitations solides
-!
+
 ! input/output:
 !   snow         champs hauteur de neige
@@ -264,5 +263,5 @@
 !   tsurf_new    temperature au sol
 !   evap
-!
+
   INCLUDE "YOETHF.h"
   INCLUDE "YOMCST.h"
@@ -329,5 +328,5 @@
 ! Start calculation
 ! - Initialization
-!
+
 !****************************************************************************************
     coeff_rel = dtime/(tau_calv * rday)
@@ -338,5 +337,5 @@
 ! - Increment snow due to precipitation and evaporation
 ! - Calculate the water balance due to precipitation and evaporation (bil_eau_s)
-!
+
 !****************************************************************************************
     WHERE (precip_snow > 0.) 
@@ -374,5 +373,5 @@
 ! - Calculate calving and decrement snow, if there are to much snow
 ! - Update temperature at surface
-!
+
 !****************************************************************************************
 
@@ -451,5 +450,5 @@
 ! Save ffonte, fqfonte and fqcalving in global arrays for each 
 ! sub-surface separately
-!
+
 !****************************************************************************************
     DO i = 1, knon
@@ -466,7 +465,7 @@
 
   END SUBROUTINE fonte_neige
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE fonte_neige_final(restart_runoff &
 #ifdef ISO      
@@ -474,7 +473,7 @@
 #endif   
                           )
-!
+
 ! This subroutine returns run_off_lic_0 for later writing to restart file.
-!
+
 #ifdef ISO
     USE infotrac_phy, ONLY: niso
@@ -484,5 +483,5 @@
 #endif
 #endif
-!
+
 !****************************************************************************************
     REAL, DIMENSION(klon), INTENT(OUT) :: restart_runoff
@@ -540,7 +539,7 @@
 
   END SUBROUTINE fonte_neige_final
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE fonte_neige_get_vars(pctsrf, fqcalving_out, &
               fqfonte_out, ffonte_out, run_off_lic_out &
@@ -553,5 +552,5 @@
 ! Cumulate ffonte, fqfonte and fqcalving respectively for
 ! all type of surfaces according to their fraction.
-!
+
 ! This routine is called from physiq.F before histwrite.
 !****************************************************************************************
@@ -608,17 +607,17 @@
 
   END SUBROUTINE fonte_neige_get_vars
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 !#ifdef ISO
 !  subroutine fonte_neige_export_xtrun_off_lic_0(knon,xtrun_off_lic_0_diag)
 !    use infotrac_phy, ONLY: niso
-!
+
 !    ! inputs
 !    INTEGER, INTENT(IN)                      :: knon
 !    real, INTENT(IN), DIMENSION(niso,klon)   :: xtrun_off_lic_0_diag
-!
+
 !    xtrun_off_lic_0(:,:)=xtrun_off_lic_0_diag(:,:)
-!
+
 !  end subroutine fonte_neige_export_xtrun_off_lic_0
 !#endif 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/freinage.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/freinage.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/freinage.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
   SUBROUTINE freinage(knon, uu, vv,  &
        tt,veget,lai, height,ypaprs,ypplay,drag_pro,d_u,d_v)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/geo2atm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/geo2atm.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/geo2atm.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/geo2atm.F90,v 1.1 2008-12-05 17:56:40 lsce Exp $
-!
+
 SUBROUTINE geo2atm(im, jm, px, py, pz, plon, plat, pu, pv, pr)
   USE dimphy
@@ -14,10 +14,10 @@
 ! Change wind coordinates from cartesian geocentric to local spherical
 ! NB! Fonctionne probablement uniquement en MPI seul (sans OpenMP)
-!
+
 ! Geocentric :
   ! axe x is eastward : crosses (0N,90E) point.
   ! axe y  crosses (0N,180E) point.
   ! axe z is 'up' : crosses north pole.
-!
+
 ! NB! Aux poles, fonctionne probablement uniquement en MPI seul (sans OpenMP)
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/global_mean.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/global_mean.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/global_mean.F90	(revision 5099)
@@ -1,8 +1,8 @@
   subroutine global_mean(field,airephy,laire,mfield)
-!
+
 ! I.Musat: 05.2011
 ! calcul moyenne globale d'un champ pondere par l'aire de la maille
 ! (laire=.TRUE.) ou somme globale du champ (laire=.FALSE.)
-!
+
   USE dimphy
   USE mod_phys_lmdz_para, only: is_sequential
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/gr_fi_ecrit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/gr_fi_ecrit.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/gr_fi_ecrit.F90	(revision 5099)
@@ -1,15 +1,15 @@
 SUBROUTINE gr_fi_ecrit(nfield,nlon,iim,jjmp1,fi,ecrit)
   IMPLICIT none
-  !
+
   ! Tranformer une variable de la grille physique a
   ! la grille d'ecriture
-  !
+
   ! WARNING: This only works on the full global grid
   !          (ie for GCM in serial mode)
   INTEGER nfield,nlon,iim,jjmp1, jjm
   REAL fi(nlon,nfield), ecrit(iim*jjmp1,nfield)
-  !
+
   INTEGER i, n, ig
-  !
+
   jjm = jjmp1 - 1
   DO n = 1, nfield
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 MODULE grid_noro_m
-!
+
 !*******************************************************************************
 
@@ -16,7 +16,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE grid_noro(xd,yd,zd,x,y,zphi,zmea,zstd,zsig,zgam,zthe,zpic,zval,mask)
-!
+
 !-------------------------------------------------------------------------------
 ! Author: F. Lott (see also Z.X. Li, A. Harzallah et L. Fairhead)
@@ -35,5 +35,5 @@
 !    gridpoint area. In most circumstances, this weight is the ratio between the
 !    surfaces of the USN gridpoint area and the model gridpoint area. 
-!
+
 !           (c)
 !        ----d-----
@@ -297,12 +297,12 @@
 
 END SUBROUTINE grid_noro
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE grid_noro0(xd,yd,zd,x,y,zphi,mask)
-!
+
 !===============================================================================
 ! Purpose: Extracted from grid_noro to provide geopotential height for dynamics
@@ -424,17 +424,17 @@
 
 END SUBROUTINE grid_noro0
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE read_noro(x,y,fname,zphi,zmea,zstd,zsig,zgam,zthe,zpic,zval,mask)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Read parameters usually determined with grid_noro from a file.
 !===============================================================================
-  USE netcdf, ONLY: NF90_OPEN,  nf90_inq_dimid, NF90_INQUIRE_DIMENSION,        &
-        NF90_NOERR, NF90_CLOSE, NF90_INQ_VARID, NF90_GET_VAR, NF90_STRERROR,   &
+  USE netcdf, ONLY: NF90_OPEN,  nf90_inq_dimid, nf90_inquire_dimension,        &
+        nf90_noerr, NF90_CLOSE, NF90_INQ_VARID, nf90_get_var, NF90_STRERROR,   &
         NF90_NOWRITE
   IMPLICIT NONE 
@@ -499,5 +499,5 @@
   REAL,             INTENT(INOUT) :: fld(:,:)
   CALL ncerr(NF90_INQ_VARID(fid,var,vid),var)
-  CALL ncerr(NF90_GET_VAR(fid,vid,fld(1:imar,:)),var)
+  CALL ncerr(nf90_get_var(fid,vid,fld(1:imar,:)),var)
   fld(imar+1,:)=fld(1,:)
 END SUBROUTINE get_fld
@@ -510,7 +510,7 @@
   INTEGER :: n
   CALL ncerr(nf90_inq_dimid(fid,dimd,did))
-  CALL ncerr(NF90_INQUIRE_DIMENSION(fid,did,len=n)); ALLOCATE(tmp(n))
+  CALL ncerr(nf90_inquire_dimension(fid,did,len=n)); ALLOCATE(tmp(n))
   CALL ncerr(NF90_INQ_VARID(fid,dimd,did))
-  CALL ncerr(NF90_GET_VAR(fid,did,tmp))
+  CALL ncerr(nf90_get_var(fid,did,tmp))
   IF(MAXVAL(tmp)>xpi) tmp=tmp*d2r
   IF(n/=SIZE(dimv).OR.ANY(ABS(tmp-dimv)>1E-6)) THEN
@@ -525,5 +525,5 @@
   CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: var
   CHARACTER(LEN=256) :: mess
-  IF(ncres/=NF90_NOERR) THEN
+  IF(ncres/=nf90_noerr) THEN
     mess='Problem with file "'//TRIM(fname)//'"'
     IF(PRESENT(var)) mess=TRIM(mess)//' and variable "'//TRIM(var)//'"'
@@ -534,12 +534,12 @@
 
 END SUBROUTINE read_noro
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE MVA9(x)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -571,5 +571,5 @@
 
 END SUBROUTINE MVA9
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ice_sursat_mod.F90	(revision 5099)
@@ -4,17 +4,17 @@
 
 !--flight inventories
-!
+
 REAL, SAVE, ALLOCATABLE :: flight_m(:,:)    !--flown distance m s-1 per cell
 !$OMP THREADPRIVATE(flight_m)
 REAL, SAVE, ALLOCATABLE :: flight_h2o(:,:)  !--emitted kg H2O s-1 per cell
 !$OMP THREADPRIVATE(flight_h2o)
-!
+
 !--Fixed Parameters
-!
+
 !--safety parameters for ERF function
 REAL, PARAMETER :: erf_lim = 5., eps = 1.e-10
-!
+
 !--Tuning parameters (and their default values)
-!
+
 !--chi gère la répartition statistique de la longueur des frontières
 !  entre les zones nuages et ISSR/ciel clair sous-saturé. Gamme de valeur :
@@ -25,16 +25,16 @@
 !  le nuage n'est en contact qu'avec de l'ISSR, quelle que soit la taille 
 !  de l'ISSR dans la maille.)
-!
+
 !--l_turb est la longueur de mélange pour la turbulence. 
 !  dans les tests, ça n'a jamais été modifié pour l'instant. 
-!
+
 !--tun_N est le paramètre qui contrôle l'importance relative de N_2 par rapport à N_1. 
 !  La valeur est comprise entre 1 et 2 (tun_N = 1 => N_1 = N_2)
-!
+
 !--tun_ratqs : paramètre qui modifie ratqs en fonction de la valeur de
 !  alpha_cld selon la formule ratqs_new = ratqs_old / ( 1 + tun_ratqs *
 !  alpha_cld ). Dans le rapport il est appelé beta. Il varie entre 0 et 5
 !  (tun_ratqs = 0 => pas de modification de ratqs).
-!
+
 !--gamma0 and Tgamma: define RHcrit limit above which heterogeneous freezing occurs as a function of T
 !--Karcher and Lohmann (2002)
@@ -42,10 +42,10 @@
 !--Ren and MacKenzie (2005) reused by Kärcher
 !--gamma = 2.349 - t / 259.0
-!
+
 !--N_cld: number of clouds in cell (needs to be parametrized at some point)
-!
+
 !--contrail cross section: typical value found in Freudenthaler et al, GRL, 22, 3501-3504, 1995
 !--in m2, 1000x200 = 200 000 m2 after 15 min
-!
+
 REAL, SAVE :: chi=1.1, l_turb=50.0, tun_N=1.3, tun_ratqs=3.0
 REAL, SAVE :: gamma0=2.349, Tgamma=259.0, N_cld=100, contrail_cross_section=200000.0
@@ -55,5 +55,5 @@
 
 !*******************************************************************
-!
+
 SUBROUTINE ice_sursat_init()
 
@@ -85,5 +85,5 @@
 
 !*******************************************************************
-!
+
 SUBROUTINE airplane(debut,pphis,pplay,paprs,t_seri)
 
@@ -126,12 +126,11 @@
   REAL :: zrho, zdz(klon,klev), zfrac
 
-  !
   IF (debut) THEN
   !--------------------------------------------------------------------------------
   !       ... Open the file and read airplane emissions
   !--------------------------------------------------------------------------------
-  !
+
   IF (is_mpi_root .AND. is_omp_root) THEN
-      !
+
       iret = nf90_open('aircraft_phy.nc', 0, ncida)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to open aircraft_phy.nc file',1)
@@ -149,15 +148,15 @@
       iret = nf90_inquire_dimension(ncida, varid,len= nleva)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get lev dimlen aircraft_phy.nc file',1)
-      !
+
       IF ( klona /= klon_glo ) THEN
         WRITE(lunout,*) 'klona & klon_glo =', klona, klon_glo
         CALL abort_physic(modname,'problem klon in aircraft_phy.nc file',1)
       ENDIF
-      !
+
       IF ( ntimea /= 12 ) THEN
         WRITE(lunout,*) 'ntimea=', ntimea
         CALL abort_physic(modname,'problem ntime<>12 in aircraft_phy.nc file',1)
       ENDIF
-      !
+
       ALLOCATE(zmida(nleva), STAT=error)
       IF (error /= 0) CALL abort_physic(modname,'problem to allocate zmida',1)
@@ -166,34 +165,34 @@
       ALLOCATE(ph2o_airpl_glo(klona,nleva,ntimea), STAT=error)
       IF (error /= 0) CALL abort_physic(modname,'problem to allocate ph2o_airpl_glo',1)
-      !
+
       iret = nf90_inq_varid(ncida, 'lev', varid)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get lev dimid aircraft_phy.nc file',1)
       iret = nf90_get_var(ncida, varid, zmida)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to read zmida file',1)
-      !
+
       iret = nf90_inq_varid(ncida, 'emi_co2_aircraft', varid)  !--CO2 as a proxy for m flown -
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get emi_distance dimid aircraft_phy.nc file',1)
       iret = nf90_get_var(ncida, varid, pkm_airpl_glo)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to read pkm_airpl file',1)
-      !
+
       iret = nf90_inq_varid(ncida, 'emi_h2o_aircraft', varid)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to get emi_h2o_aircraft dimid aircraft_phy.nc file',1)
       iret = nf90_get_var(ncida, varid, ph2o_airpl_glo)
       IF (iret /= nf90_noerr) CALL abort_physic(modname,'problem to read ph2o_airpl file',1)
-      ! 
+
      ENDIF    !--is_mpi_root and is_omp_root
-     !
+
      CALL bcast(nleva)
      CALL bcast(ntimea)
-     ! 
+
      IF (.NOT.ALLOCATED(zmida)) ALLOCATE(zmida(nleva), STAT=error)
      IF (.NOT.ALLOCATED(zinta)) ALLOCATE(zinta(nleva+1), STAT=error)
-     !
+
      ALLOCATE(pkm_airpl(klon,nleva,ntimea))
      ALLOCATE(ph2o_airpl(klon,nleva,ntimea))
-     !
+
      ALLOCATE(flight_m(klon,klev))
      ALLOCATE(flight_h2o(klon,klev))
-     !
+
      CALL bcast(zmida)
      zinta(1)=0.0                                   !--surface
@@ -203,8 +202,8 @@
      zinta(nleva+1)=zinta(nleva)+(zmida(nleva)-zmida(nleva-1))*1000.0 !--extrapolation for last interface
      !print *,'zinta=', zinta
-     !
+
      CALL scatter(pkm_airpl_glo,pkm_airpl)
      CALL scatter(ph2o_airpl_glo,ph2o_airpl)
-     !
+
 !$OMP MASTER
      IF (is_mpi_root .AND. is_omp_root) THEN
@@ -215,11 +214,11 @@
 
   ENDIF !--debut
-!
+
 !--compute altitude of model level interfaces
-!
+
   DO i = 1, klon
     zalt(i,1)=pphis(i)/RG         !--in m
   ENDDO
-!
+
   DO k=1, klev
     DO i = 1, klon
@@ -229,10 +228,10 @@
     ENDDO
   ENDDO
-!
+
 !--vertical reprojection 
-!
+
   flight_m(:,:)=0.0 
   flight_h2o(:,:)=0.0 
-!
+
   DO k=1, klev
     DO kori=1, nleva 
@@ -247,5 +246,5 @@
     ENDDO
   ENDDO
-!
+
   DO k=1, klev
     DO i=1, klon
@@ -257,5 +256,5 @@
     ENDDO
   ENDDO
-!
+
 END SUBROUTINE airplane
 
@@ -263,5 +262,5 @@
 ! simple routine to initialise flight_m and test a flight corridor
 !--Olivier Boucher - 2021 
-!
+
 SUBROUTINE flight_init()
   USE dimphy
@@ -272,8 +271,8 @@
   ALLOCATE(flight_m(klon,klev))
   ALLOCATE(flight_h2o(klon,klev))
-  !
+
   flight_m(:,:) = 0.0    !--initialisation
   flight_h2o(:,:) = 0.0  !--initialisation
-  !
+
   DO i=1, klon
    IF (latitude_deg(i)>=42.0.AND.latitude_deg(i)<=48.0) THEN
@@ -289,11 +288,11 @@
 !--Determines the respective fractions of unsaturated clear sky, ice supersaturated clear sky and cloudy sky
 !--Diagnoses regions prone for non-persistent and persistent contrail formation
-!
+
 !--Audran Borella - 2021 
-!
+
 SUBROUTINE ice_sursat(pplay, dpaprs, dtime, i, k, t, q, gamma_ss, &
                       qsat, t_actuel, rneb_seri, ratqs, rneb, qincld,   &
                       rnebss, qss, Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
-  !
+
   USE dimphy
   USE print_control_mod,    ONLY: prt_level, lunout
@@ -304,5 +303,5 @@
   USE indice_sol_mod,       ONLY: is_ave 
   USE geometry_mod,         ONLY: cell_area
-  !
+
   IMPLICIT NONE
   INCLUDE "YOMCST.h"
@@ -311,8 +310,7 @@
   INCLUDE "clesphys.h"
 
-  !
   ! Input
   ! Beware: this routine works on a gridpoint!
-  !
+
   REAL,     INTENT(IN)    :: pplay     ! layer pressure (Pa)
   REAL,     INTENT(IN)    :: dpaprs    ! layer delta pressure (Pa)
@@ -323,13 +321,13 @@
   REAL,     INTENT(IN)    :: rneb_seri ! fraction nuageuse en memoire
   INTEGER,  INTENT(IN)    :: i, k
-  !
+
   !  Input/output
-  !
+
   REAL,     INTENT(INOUT) :: q         ! vapeur de la maille (=zq)
   REAL,     INTENT(INOUT) :: ratqs     ! determine la largeur de distribution de vapeur
   REAL,     INTENT(INOUT) :: Tcontr, qcontr, qcontr2, fcontrN, fcontrP
-  !
+
   !  Output
-  !
+
   REAL,     INTENT(OUT)   :: gamma_ss  !
   REAL,     INTENT(OUT)   :: rneb      !  cloud fraction
@@ -337,7 +335,7 @@
   REAL,     INTENT(OUT)   :: rnebss    !  ISSR fraction
   REAL,     INTENT(OUT)   :: qss       !  in-ISSR total water
-  !
+
   ! Local
-  !
+
   REAL PI
   PARAMETER (PI=4.*ATAN(1.))
@@ -354,5 +352,5 @@
   REAL V_env, V_cld, V_ss, V_clr
   REAL zcor
-  !
+
   !--more local variables for diagnostics
   !--imported from YOMCST.h 
@@ -378,8 +376,8 @@
      V_cell = zdz * cell_area(i)      !--cell volume m3
      M_cell = zrhodz * cell_area(i)   !--cell dry air mass kg
-     !
+
      ! Recuperation de la memoire sur la couverture nuageuse
      rneb = rneb_seri
-     !
+
      ! Ajout des émissions de H2O dues à l'aviation
      ! q is the specific humidity (kg/kg humid air) hence the complicated equation to update q
@@ -388,14 +386,14 @@
      ! The equation is derived by writing m_humid_air = m_dry_air + m_H2O = m_dry_air / (1-q) 
      ! flight_h2O is in kg H2O / s / cell
-     !
+
      IF (ok_plane_h2o) THEN 
        q = ( M_cell*q + flight_h2o(i,k)*dtime*(1.-q) ) / (M_cell + flight_h2o(i,k)*dtime*(1.-q) ) 
      ENDIF
-     !
+
      !--Estimating gamma 
      gamma_ss = MAX(1.0, gamma0 - t_actuel/Tgamma)
      !gamma_prec = MAX(1.0, gamma0 - t_ancien(i,k)/Tgamma)      !--formulation initiale d Audran
      gamma_prec = MAX(1.0, gamma0 - t/Tgamma)                   !--autre formulation possible basée sur le T du pas de temps
-     !
+
      ! Initialisation de qvc : q_sat du pas de temps precedent
      !qvc = R2ES*FOEEW(t_ancien(i,k),1.)/pplay      !--formulation initiale d Audran
@@ -404,8 +402,8 @@
      zcor = 1./(1.-RETV*qvc)
      qvc = qvc*zcor
-     !
+
      ! Modification de ratqs selon formule proposee : ksi_new = ksi_old/(1+beta*alpha_cld)
      ratqs = ratqs / (tun_ratqs*rneb_seri + 1.)
-     !
+
      ! Calcul de N
      pdf_k = -sqrt(log(1.+ratqs**2.))
@@ -421,5 +419,5 @@
         pdf_N = max(0.,rneb/pdf_e1)
      ENDIF
-     !
+
      ! On calcule ensuite N1 et N2. Il y a deux cas : N > 1 et N <= 1
      ! Cas 1 : N > 1. N'arrive en theorie jamais, c'est une barriere
@@ -634,5 +632,5 @@
      ! Physique 2 : Turbulence
      IF (rneb>eps.AND.rneb<1.-eps) THEN ! rneb != 0 and != 1
-       !
+
        tke = pbl_tke(i,k,is_ave)
        ! A MODIFIER formule a revoir
@@ -744,5 +742,5 @@
      !!fcontrN(i,k)=1.0
      !!fcontrP(i,k)=0.5
-     !
+
      !--slope of dilution line in exhaust
      !--kg H2O/kg fuel * J kg air-1 K-1 * Pa / (kg H2O / kg air * J kg fuel-1) 
@@ -751,5 +749,5 @@
      !Tcontr(i,k) = 226.69+9.43*log(Gcontr-0.053)+0.72*(log(Gcontr-0.053))**2 !--K
      IF (Gcontr > 0.1) THEN
-     !
+
        Tcontr = 226.69+9.43*log(Gcontr-0.053)+0.72*(log(Gcontr-0.053))**2 !--K
        !print *,'Tcontr=',iter,i,k,eps_w,pplay,Gcontr,Tcontr(i,k)
@@ -775,7 +773,7 @@
        !qcontr=MAX(1.E-10,qcontr)
        !qcontr2 = eps_w*qcontr / (pplay+eps_w*qcontr)
-       !
+
        IF (t < Tcontr) THEN !--contrail formation is possible
-       !
+
        !--compute fractions of persistent (P) and non-persistent(N) contrail potential regions
        !!IF (qcontr(i,k).GE.qsat) THEN
@@ -784,5 +782,5 @@
          !!fcontrN(i,k) = 0.0
          fcontrN = 0.0
-         !
+
          !--integral of P(q) from qsat to qcontr in ISSR 
          pdf_a = log(qsat/q)/(pdf_k*sqrt(2.))
@@ -793,5 +791,5 @@
             pdf_e1 = erf(pdf_e1)
          ENDIF
-         !
+
          !!pdf_a = log(MIN(qcontr(i,k),qvc)/q)/(pdf_k*sqrt(2.))
          pdf_a = log(MIN(qcontr2,qvc)/q)/(pdf_k*sqrt(2.))
@@ -802,8 +800,8 @@
             pdf_e2 = erf(pdf_e2)
          ENDIF
-         !
+
          !!fcontrP(i,k) = MAX(0., 0.5*(pdf_e1-pdf_e2))
          fcontrP = MAX(0., 0.5*(pdf_e1-pdf_e2))
-         !
+
          pdf_a = log(qsat/q)/(pdf_k*sqrt(2.))
          pdf_e1 = pdf_a+pdf_b
@@ -813,5 +811,5 @@
             pdf_e1 = erf(pdf_e1)
          ENDIF
-         !
+
          !!pdf_a = log(MIN(qcontr(i,k),qvc)/q)/(pdf_k*sqrt(2.))
          pdf_a = log(MIN(qcontr2,qvc)/q)/(pdf_k*sqrt(2.))
@@ -822,8 +820,8 @@
             pdf_e2 = erf(pdf_e2)
          ENDIF
-         !
+
          !!fcontrP(i,k) = MAX(0., 0.5*(pdf_e1-pdf_e2))
          fcontrP = MAX(0., 0.5*(pdf_e1-pdf_e2))
-         !
+
          pdf_a = log(MAX(qsat,qvc)/q)/(pdf_k*sqrt(2.))
          pdf_e1 = pdf_a+pdf_b
@@ -833,5 +831,5 @@
             pdf_e1 = erf(pdf_e1)
          ENDIF
-         !
+
          !!pdf_a = log(MIN(qcontr(i,k),MIN(gamma_prec*qvc,gamma_ss*qsat))/q)/(pdf_k*sqrt(2.))
          pdf_a = log(MIN(qcontr2,MIN(gamma_prec*qvc,gamma_ss*qsat))/q)/(pdf_k*sqrt(2.))
@@ -842,8 +840,8 @@
             pdf_e2 = erf(pdf_e2)
          ENDIF
-         !
+
          !!fcontrP(i,k) = fcontrP(i,k) + MAX(0., 0.5*(1-pdf_N1)*(pdf_e1-pdf_e2))
          fcontrP = fcontrP + MAX(0., 0.5*(1-pdf_N1)*(pdf_e1-pdf_e2))
-         !
+
          pdf_a = log(gamma_prec*qvc/q)/(pdf_k*sqrt(2.))
          pdf_e1 = pdf_a+pdf_b
@@ -853,5 +851,5 @@
             pdf_e1 = erf(pdf_e1)
          ENDIF
-         !
+
          !!pdf_a = log(MIN(qcontr(i,k),gamma_ss*qsat)/q)/(pdf_k*sqrt(2.))
          pdf_a = log(MIN(qcontr2,gamma_ss*qsat)/q)/(pdf_k*sqrt(2.))
@@ -862,14 +860,14 @@
             pdf_e2 = erf(pdf_e2)
          ENDIF
-         !
+
          !!fcontrP(i,k) = fcontrP(i,k) + MAX(0., 0.5*(1-pdf_N2)*(pdf_e1-pdf_e2))
          fcontrP = fcontrP + MAX(0., 0.5*(1-pdf_N2)*(pdf_e1-pdf_e2))
-         !
+
        ELSE  !--qcontr LT qsat
-         !
+
          !--all of ISSR is prone for contrail formation
          !!fcontrP(i,k) = rnebss
          fcontrP = rnebss
-         !
+
          !--integral of zq from qcontr to qsat in unsaturated clear-sky region
          !!pdf_a = log(qcontr(i,k)/q)/(pdf_k*sqrt(2.))
@@ -881,5 +879,5 @@
             pdf_e1 = erf(pdf_e1)
          ENDIF
-         !
+
          pdf_a = log(qsat/q)/(pdf_k*sqrt(2.))
          pdf_e2 = pdf_a+pdf_b
@@ -889,19 +887,19 @@
             pdf_e2 = erf(pdf_e2)
          ENDIF
-         !
+
          !!fcontrN(i,k) = 0.5*(pdf_e1-pdf_e2)
          fcontrN = 0.5*(pdf_e1-pdf_e2)
          !!fcontrN=2.0
-         !
+
        ENDIF
-       !
+
        ENDIF !-- t < Tcontr
-     !
+
      ENDIF !-- Gcontr > 0.1
 
   RETURN
 END SUBROUTINE ice_sursat
-!
+
 !*******************************************************************
-!
+
 END MODULE ice_sursat_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/icefrac_lsc_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/icefrac_lsc_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/icefrac_lsc_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 MODULE icefrac_lsc_mod
 
@@ -10,8 +10,8 @@
 
 SUBROUTINE icefrac_lsc(np,temp, sig, icefrac)
-  !
+
   ! Compute the ice fraction 1-xliq (see e.g.
   ! Doutriaux-Boucher & Quaas 2004, section 2.2.)
-  !
+
   ! (JBM 3/14 8/14 5/16)
   
@@ -55,4 +55,4 @@
 
 !*******************************************************************
-!
+
 END MODULE icefrac_lsc_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/infotrac_phy.F90	(revision 5099)
@@ -1,4 +1,4 @@
 !$Id: infotrac.F90 4301 2022-10-20 11:57:21Z dcugnet $
-!
+
 MODULE infotrac_phy
 
@@ -59,5 +59,5 @@
   !  * For water, "nqo" is equal to the more general field "isotopes(ip)%nphas".
   !  * "niso", "nzone", "ntiso", "nphas" are defined for other isotopic tracers families, if any.
-  !
+
   !=== DERIVED TYPE EMBEDDING MOST OF THE TRACERS-RELATED QUANTITIES (LENGTH: nqtot)
   !    Each entry is accessible using "%" sign.
@@ -85,5 +85,5 @@
   !  | iso_iPhas   | Isotope  phase index in isotopes(iso_iGroup)%phas(:) | phase_num   | 1:nphas                |
   !  +-------------+------------------------------------------------------+-------------+------------------------+
-  !
+
   !=== DERIVED TYPE EMBEDDING MOST OF THE ISOTOPES-RELATED QUANTITIES (LENGTH: nbIso, NUMBER OF ISOTOPES FAMILIES)
   !    Each entry is accessible using "%" sign.
@@ -135,8 +135,8 @@
     IMPLICIT NONE
     !==============================================================================================================================
-    !
+
     !   Auteur:  P. Le Van /L. Fairhead/F.Hourdin
     !   -------
-    !
+
     !   Modifications:
     !   --------------
@@ -144,9 +144,9 @@
     !   02/02: M-A Filiberti Lecture de traceur.def
     !   01/22: D. Cugnet     Nouveaux tracer.def et tracer_*.def + encapsulation (types trac_type et isot_type)
-    !
+
     !   Objet:
     !   ------
     !   GCM LMD nouvelle grille
-    !
+
     !==============================================================================================================================
     !   ... modification de l'integration de q ( 26/04/94 ) ....
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ini_csts.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ini_csts.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ini_csts.F90	(revision 5099)
@@ -6,5 +6,5 @@
       SUBROUTINE INI_CSTS 
 !     ##################
-!
+
 !!****  *INI_CSTS * - routine to initialize the module MODD_CST
 !!
@@ -13,6 +13,6 @@
 !       The purpose of this routine is to initialize  the physical constants
 !     stored in  module MODD_CST.
-!      
-!
+
+
 !!**  METHOD
 !!    ------
@@ -50,27 +50,26 @@
 !!
 !-------------------------------------------------------------------------------
-!
+
 !*       0.    DECLARATIONS
 !              ------------
-!
+
 USE MODD_CSTS
-!
-!
+
+
 !USE YOMHOOK   ,ONLY : LHOOK,   DR_HOOK
 !USE PARKIND1  ,ONLY : JPRB
-!
+
 !USE MODI_INI_CTURBS
-!
+
 !USE MODI_INI_OCEAN_CSTS
-!
+
 !USE MODI_INI_SURF_CSTS
-!
+
 IMPLICIT NONE
-!  
+
 !-------------------------------------------------------------------------------
-!
+
 !*       1.     FUNDAMENTAL CONSTANTS
 !               ---------------------
-!
 
 !REAL(KIND=JPRB) :: ZHOOK_HANDLE
@@ -90,10 +89,10 @@
 XPLANCK     = 6.6260755E-34
 XAVOGADRO   = 6.0221367E+23
-!
+
 !-------------------------------------------------------------------------------
-!
+
 !*       2.     ASTRONOMICAL CONSTANTS
 !               ----------------------
-!
+
 XDAY   = 86400.
 XSIYEA = 365.25*XDAY*2.*XPI/ 6.283076
@@ -101,35 +100,35 @@
 XOMEGA = 2.*XPI/XSIDAY
 NDAYSEC = 24*3600 ! Number of seconds in a day
-!
+
 !-------------------------------------------------------------------------------!
-!
-!
+
+
 !*       3.     TERRESTRIAL GEOIDE CONSTANTS
 !               ----------------------------
-!
+
 XRADIUS = 6371229.
 XG      = 9.80665
-!
+
 !-------------------------------------------------------------------------------
-!
+
 !*       4.     REFERENCE PRESSURE
 !               -------------------
-!
+
 XP00 = 1.E5
 XTH00 = 300.
 !-------------------------------------------------------------------------------
-!
+
 !*       5.     RADIATION CONSTANTS
 !               -------------------
-!
+
 !JUAN OVERFLOW XSTEFAN = 2.* XPI**5 * XBOLTZ**4 / (15.* XLIGHTSPEED**2 * XPLANCK**3)
 XSTEFAN = ( 2.* XPI**5 / 15. ) * ( (XBOLTZ / XPLANCK)* XBOLTZ ) * (XBOLTZ/(XLIGHTSPEED*XPLANCK))**2 
 XI0     = 1370.
-!
+
 !-------------------------------------------------------------------------------
-!
+
 !*       6.     THERMODYNAMIC CONSTANTS
 !               -----------------------
-!
+
 XMD    = 28.9644E-3
 XMV    = 18.0153E-3
@@ -157,25 +156,25 @@
 XBETAI = (XLSTT/XRV) + (XGAMI * XTT)
 XALPI  = LOG(XESTT) + (XBETAI /XTT) + (XGAMI *LOG(XTT))
-!
+
 !-------------------------------------------------------------------------------
-!
+
 !*       7.     TURBULENCE CONSTANTS
 !               --------------------
-!
+
 ! CALL INI_CTURBS
 !-------------------------------------------------------------------------------
-!
+
 !*       8.     OCEAN CONSTANTS
 !               ---------------
-!
+
 ! CALL INI_OCEAN_CSTS
-!
+
 !*       9.     SURFACE CONSTANTS
 !               -----------------
-!
+
 ! CALL INI_SURF_CSTS
 !IF (LHOOK) CALL DR_HOOK('INI_CSTS',1,ZHOOK_HANDLE)
-!
+
 !-------------------------------------------------------------------------------
-!
+
 END SUBROUTINE INI_CSTS 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ini_histREGDYN.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ini_histREGDYN.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ini_histREGDYN.h	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Header$
-!
 
       IF (ok_regdyn) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ini_histday_seri.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ini_histday_seri.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ini_histday_seri.h	(revision 5099)
@@ -1,16 +1,16 @@
-!
+
 ! $Id$
-!
+
 !ym Ne fonctionnera pas en mode parallele
       IF (is_sequential) THEN
       
       IF (type_run.EQ."AMIP") THEN
-!
+
        zstophy = pdtphys
        zout = ecrit_day
-!
+
          idayref = day_ref
          CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
-!
+
          CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,longitude_deg,zx_lon)
          DO i = 1, nbp_lon
@@ -22,10 +22,10 @@
          ENDDO
          CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,latitude_deg,zx_lat)
-!
+
          imin_debut=1 
          nbpti=1
          jmin_debut=1 
          nbptj=1
-!
+
          CALL histbeg("histday_seri.nc",  &
                        nbp_lon,zx_lon(:,1),nbp_lat,zx_lat(1,:), &
@@ -33,27 +33,27 @@
                        itau_phy, zjulian, dtime, &
                        nhori, nid_day_seri)
-!
+
          CALL histvert(nid_day_seri, "presnivs",  &
                       "Vertical levels","mb", &
                        klev, presnivs/100., nvert)
-!
+
          CALL histdef(nid_day_seri, "bilTOA",  &
                       "Net radiation at model top", "W/m2", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32,  &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "bils",  &
                       "Net downward energy flux at surface","W/m2", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32,  &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "ecin",  &
                       "Total kinetic energy (per unit area)","J/m2", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
 !IM 151004 BEG
          IF(1.EQ.0) THEN
-!
+
          CALL histdef(nid_day_seri, "momang",  &
                      "Total relative angular momentum (per unit area)", &
@@ -61,17 +61,17 @@
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "frictor",  &
                      "Friction torque (per unit area)", "N/m", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "mountor",  &
                      "Mountain torque (per unit area)", "N/m", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
          ENDIF !(1.EQ.0) THEN
-!
+
          CALL histdef(nid_day_seri, "momang",  &
                      "Axial angular momentum (per unit area)", &
@@ -79,22 +79,22 @@
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "torsfc",  &
               "Total surface torque (including mountain torque)", "N/m", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
 !IM 151004 END        
-!
+
          CALL histdef(nid_day_seri, "tamv",  &
                       "Temperature (mass-weighted vert. ave)", "K", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "psol",  &
                       "Surface pressure", "Pa", &
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32,  &
                       "ave(X)", zstophy,zout)
-!
+
          CALL histdef(nid_day_seri, "evap",  &
                       "Evaporation and sublimation (per unit area)",  &
@@ -102,5 +102,5 @@
                       nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32,  &
                       "ave(X)", zstophy,zout)
-!
+
 !          call histdef(nid_day_seri, 
 !    .         "SnowFrac", 
@@ -108,5 +108,5 @@
 !    .         nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32,
 !    .         "ave(X)", zstophy,zout)
-!
+
 !        CALL histdef(nid_day_seri, "snow_depth", 
 !IM 080904  .                "Snow Depth (water equivalent)", "m",
@@ -115,5 +115,5 @@
 !    .                nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, 
 !    .               "ave(X)", zstophy,zout)
-!
+
            call histdef(nid_day_seri,  &
                "tsol_"//clnsurf(is_oce),  &
@@ -121,9 +121,9 @@
                nbp_lon,nbp_lat,nhori, 1,1,1, -99, 32, &
                "ave(X)", zstophy,zout)
-!
+
 !=================================================================
-!
+
          CALL histend(nid_day_seri)
-!
+
 !=================================================================
       ENDIF ! fin de test sur type_run.EQ.AMIP
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/init_be.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/init_be.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/init_be.F90	(revision 5099)
@@ -13,6 +13,6 @@
 !         pour 19 niveaux verticaux
 !        (d'apres le diagramme de Lal and Peters, 1967)
-!
-!
+
+
 ! written by : O. Coindreau (CEA/LDG) 05/2005
 ! last modified by : A. Jamelot (LMD/CEA)  04/03/2009 
@@ -22,12 +22,11 @@
   INCLUDE "YOECUMF.h" 
 
-!
 ! Input Arguments
-!
+
   REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf !Pourcentage de sol (f(nature du sol))
   REAL,DIMENSION(klon,klev), INTENT(IN) :: pplay  ! Pressions en milieu de couches
-!
+
 ! Output Arguments
-!
+
   REAL,DIMENSION(klon),INTENT(OUT)      :: masktr ! Masque de l'echange avec la surface (possible => 1 )
   REAL,INTENT(OUT)                      :: tautr  ! Constante de decroissance radioactive
@@ -35,7 +34,7 @@
   REAL,INTENT(OUT)                      :: scavtr ! Coefficient de lessivage
   REAL,DIMENSION(klon,klev),INTENT(OUT) :: srcbe  ! source volumique de 7Be      
-!
+
 ! Local Variables
-!
+
 !!!  INTEGER              :: iref      ! numero d'un point oceanique donnant la grille de pression de reference
   REAL,DIMENSION(klon) :: rlatgeo   ! latitudes geomagnetiques de la grille
@@ -103,10 +102,10 @@
      END DO
   END DO
-!
+
 ! Pour les autres niveaux:
 ! 1-passer des coordonnees geographiques a la latitude geomagnetique
 ! 2-prescrire la source de Be (en 10exp5 at/g/s) dans ce repere
 ! 3-mettre la source de Be ds la bonne unite (en at/kgA/s)
-!
+
   glt =  78.5*rpi/180.
   glg = -69.0*rpi/180.
@@ -285,5 +284,5 @@
         DO i = 1,klon
 !!!jyg le 13/03/2013
-!
+
 ! k est le niveau dans la grille locale
 ! Determination du niveau kref dans la grille de refernce
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/initphysto.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/initphysto.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/initphysto.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE initphysto(infile,tstep,t_ops,t_wrt,fileid)
   
@@ -14,8 +14,7 @@
   IMPLICIT NONE
 
-!
 !   Routine d'initialisation des ecritures des fichiers histoires LMDZ
 !   au format IOIPSL
-!
+
 !   Appels succesifs des routines: histbeg
 !                                  histhori
@@ -23,7 +22,7 @@
 !                                  histdef
 !                                  histend
-!
+
 !   Entree:
-!
+
 !      infile: nom du fichier histoire a creer
 !      day0,anne0: date de reference
@@ -31,10 +30,10 @@
 !      t_ops: frequence de l'operation pour IOIPSL
 !      t_wrt: frequence d'ecriture sur le fichier
-!
+
 !   Sortie:
 !      fileid: ID du fichier netcdf cree
-!
+
 !   L. Fairhead, LMD, 03/99
-!
+
 ! =====================================================================
 
@@ -61,9 +60,8 @@
 
 !  Initialisations
-!
+
   ok_sync= .TRUE.
-!
+
 !  Appel a histbeg: creation du fichier netcdf et initialisations diverses
-!         
 
   zan = annee_ref
@@ -77,5 +75,5 @@
 !$OMP MASTER	
 !  Appel a histvert pour la grille verticale
-!
+
   DO l=1,nbp_lev
      nivsigs(l)=REAL(l)
@@ -85,7 +83,7 @@
        'sigma_level', &
        nbp_lev, nivsigs, zvertiid)
-!
+
 !  Appels a histdef pour la definition des variables a sauvegarder
-!
+
   CALL histdef(fileid, "phis", "Surface geop. height", "-", &
        nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/initrrnpb.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/initrrnpb.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/initrrnpb.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE  initrrnpb(ftsol,pctsrf,masktr,fshtr,hsoltr,tautr,vdeptr,scavtr)
   USE dimphy
@@ -40,5 +40,4 @@
   CHARACTER (LEN=80) :: abort_message
 
-!
 ! Radon it = id_rn
 !----------------
@@ -68,5 +67,4 @@
   END IF ! id_rn /= 0
 
-!
 ! 210Pb it = id_pb
 !----------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARdSV.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARdSV.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARdSV.F90	(revision 5099)
@@ -97,5 +97,3 @@
       INTEGER ::  iso1  !rajout hjp for ini - check if ivg,iso is possible
 
-!
-
 END MODULE VARdSV
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARphy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARphy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARphy.F90	(revision 5099)
@@ -8,11 +8,11 @@
 ! Etienne, 08112020: merging YOMCST_SISVAT,  PHY_SV and VARphy
 ! but redundancies remain
-!
+
 !  ATTENTION!!!!: ce fichier include est compatible format fixe/format libre
 !                 veillez à n'utiliser que des ! pour les commentaires
 !                 et à bien positionner les & des lignes de continuation
 !                 (les placer en colonne 6 et en colonne 73)
-!
-!
+
+
 ! A1.0 Fundamental constants
 !----------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARxSV.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARxSV.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARxSV.F90	(revision 5099)
@@ -201,5 +201,5 @@
       INTEGER,DIMENSION(nb_wri),SAVE ::   lwriSV  ! OUTPUT point vec Index          
 !$OMP THREADPRIVATE(lwriSV)
-!                                                                              
+
       INTEGER, DIMENSION(:),ALLOCATABLE,SAVE ::   ii__SV  ! WORK   point   i Coordinate     
 !$OMP THREADPRIVATE(ii__SV)
@@ -329,6 +329,5 @@
 ! +--SISVAT OUTPUT       Variables                                            
 ! +  -----------------------------                                            
-                                                                               
-!                                                                              
+
       ALLOCATE(ii__SV(klonv))  ! WORK   point   i Coordinate     
       ALLOCATE(jj__SV(klonv))  ! WORK   point   j Coordinate     
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARySV.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARySV.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/VARySV.F90	(revision 5099)
@@ -86,5 +86,4 @@
       ALLOCATE(alb6sv(klonv,6))! 6-band  Albedo      
 
-      !
       ALLOCATE(albssv(klonv))  ! Soil               Albedo [-]   
       ALLOCATE(SoSosv(klonv))  !? Surface Absorbed Solar Radiat.  
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/inlandsis.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/inlandsis.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/inlandsis.F	(revision 5099)
@@ -1031,5 +1031,5 @@
 ! Surface Emissivity (Etienne: simplified calculation for landice)
 ! =============================================================
-!
+
        DO ikl=1,knonv
             LSnMsk     =     min( 1,isnoSV(ikl))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_ts2.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_ts2.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_ts2.F	(revision 5099)
@@ -126,5 +126,5 @@
 
 !        write(*,*)'T check'
-!     
+
 !        DO  ig = 1,knonv  
 !            DO  jk = 1,isnoSV(ig) !nsno       
@@ -132,5 +132,5 @@
 !                TsisSV(ig,jk) = TsisSV(ig,isnoSV(ig))
 !              ENDIF  
-!
+
 !              IF (TsisSV(ig,jk) <= 1.) THEN          !hj check
 !                TsisSV(ig,jk) = 273.15
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_tso.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_tso.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_tso.F	(revision 5099)
@@ -467,5 +467,5 @@
 
         if(ist__s==1) then ! to reduce computer time                                                  
-                                          !
+
         DO it_srf=1,nt_srf                                     !
               dt_ver       = dt_ver     +dt_srf                !
@@ -481,5 +481,5 @@
             DO ikl=1,knonv
               ist    = max(0,isotSV(ikl)-100*isnoSV(ikl))      ! 0 if    H2O
-                                                               !
+
               Psi(ikl) =                                       !
      .                psidSV(ist)                              ! DR97, Eqn 3.34
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_zsn.F
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_zsn.F	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_zsn.F	(revision 5099)
@@ -162,14 +162,14 @@
      .                      isnoSV(ikl)-isn +1 ))       !          Snow Pack
      .                * min(unun,                                !
-!
+
 !                       1st additional Condition to accept OKthin
      .                  max(zero,                                ! combination
      .                      sign(unun,G1snSV(ikl,      isn  )    ! G1 with same
      .                               *G1snSV(ikl,max(1,isn-1)))) !  sign => OK
-!
+
 !                       2nd additional Condition to accept OKthin
      .                + max(zero,                                ! G1>0
      .                      sign(unun,G1snSV(ikl,      isn   ))) !  =>OK
-!
+
 !                       3rd additional Condition to accept OKthin
      .                + max(zero,                                ! dz too small
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/surf_inlandsis_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/surf_inlandsis_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/surf_inlandsis_mod.F90	(revision 5099)
@@ -593,5 +593,4 @@
          END DO
 
-        !
         ! +  +++  READ FORCINGS:  END  +++
         ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -751,5 +750,5 @@
         ! to LMDZ. In LMDZ it is done in soil.F, which is not used in the case
         ! of SISVAT, therefore it's needed here.
-        !
+
         USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root
         USE mod_phys_lmdz_para
@@ -862,6 +861,5 @@
         !C |                                                                        |
         !C +------------------------------------------------------------------------+
-        !
-        !
+
 
         !C +--Global Variables
@@ -933,5 +931,5 @@
         !c #kd   END DO
         !c #kd END IF
-        !
+
         !      IF (nsol.ne.4)                                              THEN
         !        DO isl= 0,-nsol,-1
@@ -941,8 +939,8 @@
         !     .                  +  misl_2  * 0.003) * 10**(nisl_2)) * 4.
         !C +...    dz_dSV(0)  =         Hapex-Sahel Calibration:       4 mm
-        !
+
         !c +SH     dz_dSV(isl)=(((1-misl_2) * 0.001
         !c +SH.                  +  misl_2  * 0.003) * 10**(nisl_2)) * 1.
-        !
+
         !c #05     dz_dSV(isl)=(((1-misl_2) * 0.001
         !c #05.                  +  misl_2  * 0.008) * 10**(nisl_2)) * 0.5
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/interfoce_lim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/interfoce_lim.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/interfoce_lim.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 SUBROUTINE interfoce_lim(itime, dtime, jour, &
      knon, knindex, &
@@ -16,7 +16,7 @@
 ! Cette routine sert d'interface entre le modele atmospherique et un fichier
 ! de conditions aux limites
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps courant
@@ -28,10 +28,8 @@
 !   klon         taille de la grille
 !   debut        logical: 1er appel a la physique (initialisation)
-!
+
 ! output:
 !   lmt_sst_p      SST lues dans le fichier de CL
 !   pctsrf_new-p   sous-maille fractionnelle
-!
-
 
 ! Parametres d'entree
@@ -83,5 +81,5 @@
   REAL, DIMENSION(klon_glo)                 :: sst_lu
   REAL, DIMENSION(klon_glo)                 :: nat_lu
-!
+
 ! Fin declaration
 !****************************************************************************************
@@ -89,5 +87,5 @@
 !****************************************************************************************
 ! Start calculation
-!
+
 !****************************************************************************************
   IF (debut .AND. .NOT. ALLOCATED(sst_lu_p)) THEN
@@ -105,5 +103,5 @@
 !****************************************************************************************
 ! Ouverture et lecture du fichier pour le master process si c'est le bon moment
-!
+
 !****************************************************************************************
 ! Tester d'abord si c'est le moment de lire le fichier
@@ -128,7 +126,7 @@
 
         IF (newlmt) THEN
-           !
+
            ! Fraction "ocean" 
-           !
+
            ierr = nf90_inq_varid(nid, 'FOCE', nvarid)
            IF (ierr /= nf90_noerr) THEN
@@ -141,7 +139,7 @@
               CALL abort_physic(modname,abort_message,1)
            ENDIF
-           !
+
            ! Fraction "glace de mer" 
-           !
+
            ierr = nf90_inq_varid(nid, 'FSIC', nvarid)
            IF (ierr /= nf90_noerr) THEN
@@ -154,7 +152,7 @@
               CALL abort_physic(modname,abort_message,1)
            ENDIF
-           !
+
            ! Fraction "terre" 
-           !
+
            ierr = nf90_inq_varid(nid, 'FTER', nvarid)
            IF (ierr /= nf90_noerr) THEN
@@ -167,7 +165,7 @@
               CALL abort_physic(modname,abort_message,1)
            ENDIF
-           !
+
            ! Fraction "glacier terre" 
-           !
+
            ierr = nf90_inq_varid(nid, 'FLIC', nvarid)
            IF (ierr /= nf90_noerr) THEN
@@ -180,7 +178,7 @@
               CALL abort_physic(modname,abort_message,1)
            ENDIF
-           !
+
         ELSE  ! on en est toujours a rnatur
-           ! 
+
            ierr = nf90_inq_varid(nid, 'NAT', nvarid)
            IF (ierr /= nf90_noerr) THEN
@@ -193,8 +191,8 @@
               CALL abort_physic(modname,abort_message,1)
            ENDIF
-!
+
 ! Remplissage des fractions de surface
 ! nat = 0, 1, 2, 3 pour ocean, terre, glacier, seaice
-! 
+
            pct_tmp = 0.0
            DO ii = 1, klon_glo
@@ -202,7 +200,6 @@
            ENDDO
 
-!
 !  On se retrouve avec ocean en 1 et terre en 2 alors qu'on veut le contraire
-!
+
            pctsrf_new = pct_tmp
            pctsrf_new (:,2)= pct_tmp (:,1)
@@ -210,7 +207,7 @@
            pct_tmp = pctsrf_new 
         ENDIF ! fin test sur newlmt
-!
+
 ! Lecture SST
-!
+
         ierr = nf90_inq_varid(nid, 'SST', nvarid)
         IF (ierr /= nf90_noerr) THEN
@@ -226,5 +223,5 @@
 !****************************************************************************************
 ! Fin de lecture, fermeture de fichier
-!
+
 !****************************************************************************************
         ierr = nf90_close(nid)
@@ -237,5 +234,5 @@
 !****************************************************************************************
 ! Distribue les variables sur tous les processus
-!
+
 !****************************************************************************************
      CALL Scatter(sst_lu,sst_lu_p)
@@ -248,5 +245,5 @@
 !****************************************************************************************
 ! Recopie des variables dans les champs de sortie
-!
+
 !****************************************************************************************
   lmt_sst_p = 999999999.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iophy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iophy.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iophy.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE iophy
 
@@ -338,5 +338,5 @@
       ENDIF
      ENDIF
-!
+
      IF ( tabij(i)<=nbp_lon) THEN
       plat_bounds(i,1)=rlat_glo(tabij(i))
@@ -345,8 +345,8 @@
      ENDIF
      plat_bounds(i,2)=rlat_glo(tabij(i)+nbp_lon)
-!
+
 !    print*,'CFMIP_iophy point i lon lon_bds',i,plon_bounds(i,1),rlon_glo(tabij(i)),plon_bounds(i,2) 
 !    print*,'CFMIP_iophy point i lat lat_bds',i,plat_bounds(i,1),rlat_glo(tabij(i)),plat_bounds(i,2) 
-!
+
     ENDDO
     if (is_sequential) then
@@ -396,8 +396,8 @@
       plat_bounds(i,2)=zx_lat(ipt(i),nbp_lat)-0.001
      ENDIF
-!
+
 !    print*,'CFMIP_iophy point i lon lon_bds',i,plon_bounds(i,1),rlon(tabij(i)),plon_bounds(i,2) 
 !    print*,'CFMIP_iophy point i lat lat_bds',i,plat_bounds(i,1),rlat(tabij(i)),plat_bounds(i,2) 
-!
+
     ENDDO
 
@@ -679,5 +679,5 @@
       IF  ( var%flag(iff)<=lev_files(iff) ) dryaod_diag=.TRUE.
     ENDIF
-    !
+
     DO naero = 1, naero_tot-1 
       IF (var%name=='dryod550_'//name_aero_tau(naero)) THEN
@@ -861,5 +861,5 @@
      CALL histwrite(nid,name,itau,fieldok,npstn,index2d)
      IF (prt_level >= 10) write(lunout,*)'Finished sending ',name,' to IOIPSL'
-!
+
     ENDIF
     DEALLOCATE(index2d)
@@ -1316,5 +1316,5 @@
 !                        ENDIF
 !    ENDIF
-!                        
+
               ELSE 
                         nlev=size(field,2)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iophys.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iophys.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iophys.F90	(revision 5099)
@@ -21,9 +21,9 @@
 !  La periode d'ecriture est donnee par 
 !  "ecritphy " regle dans le fichier de controle de run :  run.def
-!
+
 !    writediagfi peut etre appele de n'importe quelle subroutine
 !    de la physique, plusieurs fois. L'initialisation et la creation du
 !    fichier se fait au tout premier appel.
-!
+
 ! WARNING : les variables dynamique (u,v,t,q,ps)
 !  sauvees par writediagfi avec une
@@ -32,7 +32,7 @@
 ! IL est  RECOMMANDE d'ajouter les tendance physique a ces variables
 ! avant l'ecriture dans diagfi (cf. physiq.F)
-!  
+
 ! Modifs: Aug.2010 Ehouarn: enforce outputs to be real*4
-!
+
 !  parametres (input) :
 !  ----------
@@ -42,5 +42,5 @@
 !      unite : unite de la variable (chaine de caracteres)
 !      px : variable a sortir (real 0, 1, 2, ou 3d)
-!
+
 !=================================================================
 
@@ -82,5 +82,4 @@
 
 ! This subroutine returns the sea surface temperature already read from limit.nc
-!
 
 ! Arguments on input:
@@ -123,14 +122,14 @@
       include "YOMCST.h"
 !=======================================================================
-!
+
 !   Auteur:  L. Fairhead  ,  P. Le Van, Y. Wanherdrick, F. Forget
 !   -------
-!
+
 !   Objet:
 !   ------
-!
+
 !   'Initialize' the diagfi.nc file: write down dimensions as well
 !   as time-independent fields (e.g: geopotential, mesh area, ...)
-!
+
 !=======================================================================
 !-----------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iostart.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iostart.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iostart.F90	(revision 5099)
@@ -38,5 +38,5 @@
     IF (is_mpi_root .AND. is_omp_root) THEN
       ierr = NF90_OPEN (filename, NF90_NOWRITE,nid_start)
-      IF (ierr/=NF90_NOERR) THEN
+      IF (ierr/=nf90_noerr) THEN
         write(6,*)' Pb d''ouverture du fichier '//filename
         write(6,*)' ierr = ', ierr
@@ -71,5 +71,5 @@
     IF (is_mpi_root .AND. is_omp_root) THEN
       ierr=NF90_INQ_VARID(nid_start,Field_name,varid)
-      IF (ierr==NF90_NOERR) THEN
+      IF (ierr==nf90_noerr) THEN
         Inquire_field=.TRUE.
       ELSE
@@ -148,5 +148,5 @@
       ierr=NF90_INQ_VARID(nid_start,Field_name,varid)
       
-      IF (ierr==NF90_NOERR) THEN
+      IF (ierr==nf90_noerr) THEN
         CALL body(field_glo_tmp)
         tmp_found=.TRUE.
@@ -182,6 +182,6 @@
      SUBROUTINE body(field_glo)
        REAL :: field_glo(klon_glo*field_size)
-         ierr=NF90_GET_VAR(nid_start,varid,field_glo)
-         IF (ierr/=NF90_NOERR) THEN
+         ierr=nf90_get_var(nid_start,varid,field_glo)
+         IF (ierr/=nf90_noerr) THEN
            ! La variable exist dans le fichier mais la lecture a echouee. 
            PRINT*, 'phyetat0: Lecture echouee pour <'//field_name//'>'
@@ -190,6 +190,6 @@
               ! Essaye de lire le variable sur surface uniqument, comme fait avant
               field_glo(:)=0.
-              ierr=NF90_GET_VAR(nid_start,varid,field_glo(1:klon_glo))
-              IF (ierr/=NF90_NOERR) THEN
+              ierr=nf90_get_var(nid_start,varid,field_glo(1:klon_glo))
+              IF (ierr/=nf90_noerr) THEN
                  PRINT*, 'phyetat0: Lecture echouee aussi en 2D pour <'//field_name//'>'
                  call abort_physic("", "", 1)
@@ -269,7 +269,7 @@
       ierr=NF90_INQ_VARID(nid_start,var_name,varid)
       
-      IF (ierr==NF90_NOERR) THEN
-        ierr=NF90_GET_VAR(nid_start,varid,var)
-        IF (ierr/=NF90_NOERR) THEN
+      IF (ierr==nf90_noerr) THEN
+        ierr=nf90_get_var(nid_start,varid,var)
+        IF (ierr/=nf90_noerr) THEN
           PRINT*, 'phyetat0: Lecture echouee pour <'//var_name//'>'
           call abort_physic("", "", 1)
@@ -314,5 +314,5 @@
       ierr = NF90_CREATE(filename, IOR(NF90_CLOBBER,NF90_64BIT_OFFSET), &
                           nid_restart)
-      IF (ierr/=NF90_NOERR) THEN
+      IF (ierr/=nf90_noerr) THEN
         write(lunout,*)'open_restartphy: problem creating file '//trim(filename)
         write(lunout,*)trim(nf90_strerror(ierr))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd.h	(revision 5099)
@@ -1,11 +1,11 @@
 !=======================================================================
-!
+
 !   Auteur:  F. Hourdin
 !   -------
-!
+
 !   Objet:
 !   ------
 !   Light interface for netcdf outputs. can be used outside LMDZ
-!
+
 !=======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90	(revision 5099)
@@ -3,12 +3,12 @@
 
 !=======================================================================
-!
+
 !   Auteur:  F. Hourdin
 !   -------
-!
+
 !   Objet:
 !   ------
 !   Light interface for netcdf outputs. can be used outside LMDZ
-!
+
 !=======================================================================
 !-----------------------------------------------------------------------
@@ -19,5 +19,5 @@
 !      unite : unite de la variable (chaine de caracteres)
 !      px : variable a sortir
-!
+
 !=================================================================
  
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_fin.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_fin.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_fin.F90	(revision 5099)
@@ -5,12 +5,12 @@
 
   !=======================================================================
-  !
+
   !   Auteur:  F. Hourdin
   !   -------
-  !
+
   !   Objet:
   !   ------
   !   Light interface for netcdf outputs. can be used outside LMDZ
-  !
+
   !=======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ini.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ini.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ini.F90	(revision 5099)
@@ -5,12 +5,12 @@
 
 !=======================================================================
-!
+
 !   Auteur:  F. Hourdin
 !   -------
-!
+
 !   Objet:
 !   ------
 !   Light interface for netcdf outputs. can be used outside LMDZ
-!
+
 !=======================================================================
 !-----------------------------------------------------------------------
@@ -104,5 +104,5 @@
 
       ierr=nf90_enddef(nid)
-!
+
 !  Contol parameters for this run
 ! ---- longitude -----------
@@ -123,5 +123,5 @@
       ierr=nf90_enddef(nid)
       ierr=nf90_put_var(nid,nvarid,rlat)
-!
+
 ! ---- vertical ------------
       ierr=nf90_redef(nid)
@@ -138,5 +138,4 @@
       ierr=nf90_put_var(nid,nvarid,coordv)
 
-!
 ! ---- time ----------------
       ierr=nf90_redef(nid)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/isccp_cloud_types.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/isccp_cloud_types.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/isccp_cloud_types.F90	(revision 5099)
@@ -783,7 +783,7 @@
 
       !----------------------------------------------------------------------
-      !
+
       !             DO CLEAR SKY RADIANCE CALCULATION FIRST
-      !
+
       !compute water vapor continuum emissivity
       !this treatment follows Schwarkzopf and Ramasamy
@@ -898,8 +898,6 @@
     ! endif
 
-
-      !
       !           END OF CLEAR SKY CALCULATION
-      !
+
       !----------------------------------------------------------------
 
@@ -1038,9 +1036,9 @@
       !clouds which have partial emissivity and need the
       !adjustment performed in this section
-      !
+
       !If it turns out that the cloud brightness temperature
       !is greater than 260K, then the liquid cloud conversion
       !factor of 2.56 is used.
-      !
+
       !Note that this is discussed on pages 85-87 of
       !the ISCCP D level documentation (Rossow et al. 1996)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/limit_read_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/limit_read_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/limit_read_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 ! $Id$
-!
+
 MODULE limit_read_mod
-!
+
 ! This module reads the fichier "limit.nc" containing fields for surface forcing.
-!
+
 ! Module subroutines :
 !  limit_read_frac    : call limit_read_tot and return the fractions
@@ -11,5 +11,5 @@
 !  limit_read_sst     : return sea ice temperature   
 !  limit_read_tot     : read limit.nc and store the fields in local modules variables
-!
+
   IMPLICIT NONE
 
@@ -51,5 +51,5 @@
   
   SUBROUTINE limit_read_frac(itime, dtime, jour, pctsrf_new, is_modified)
-!
+
 ! This subroutine is called from "change_srf_frac" for case of 
 ! ocean=force or from ocean_slab_frac for ocean=slab.
@@ -86,9 +86,9 @@
        knon, knindex, &
        rugos_out, alb_out)
-!
+
 ! This subroutine is called from surf_land_bucket. 
 ! The flag "ok_veget" must can not be true. If coupled run, "ocean=couple"
 ! then this routine will call limit_read_tot.
-!
+
     USE dimphy
     USE surface_data
@@ -128,7 +128,7 @@
 
   SUBROUTINE limit_read_sst(knon, knindex, sst_out)
-!
+
 ! This subroutine returns the sea surface temperature already read from limit.nc.
-!
+
     USE dimphy, ONLY : klon
 
@@ -151,7 +151,7 @@
 
   SUBROUTINE limit_read_tot(itime, dtime, jour, is_modified)
-!
+
 ! Read everything needed from limit.nc
-!
+
 ! 0) Initialize
 ! 1) Open the file limit.nc, if it is time
@@ -214,5 +214,5 @@
 !****************************************************************************************
 ! 0) Initialization
-!
+
 !****************************************************************************************
     IF (first_call) THEN
@@ -235,5 +235,5 @@
        IF (is_mpi_root) THEN ! Only master processus
           ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,&
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,&
                'Pb d''ouverture du fichier de conditions aux limites',1)
 
@@ -241,5 +241,5 @@
           ierr=NF90_INQ_VARID(nid, 'TEMPS', nvarid)
           ierr=NF90_GET_ATT(nid, nvarid, 'calendar', calendar)
-          IF(ierr==NF90_NOERR.AND.calendar/=calend.AND.prt_level>=1) THEN
+          IF(ierr==nf90_noerr.AND.calendar/=calend.AND.prt_level>=1) THEN
              WRITE(lunout,*)'BEWARE: gcm and limit.nc calendars differ: '
              WRITE(lunout,*)'  '//TRIM(calend)//' for gcm'
@@ -253,5 +253,5 @@
             ierr=NF90_INQUIRE(nid, UnlimitedDimID=ndimid)
           ENDIF
-          ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn)
+          ierr=nf90_inquire_dimension(nid, ndimid, len=nn)
           WRITE(abort_message,'(a,2(i0,a))')'limit.nc records number (',nn,') does no'//&
             't match year length (',year_len,')'
@@ -264,5 +264,5 @@
             ierr=nf90_inq_dimid(nid, 'points_physiques', ndimid)
           ENDIF
-          ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn)
+          ierr=nf90_inquire_dimension(nid, ndimid, len=nn)
           WRITE(abort_message,'(a,2(i0,a))')'limit.nc horizontal number of cells (',nn, &
             ') does not match LMDZ klon_glo (',klon_glo,')'
@@ -270,5 +270,5 @@
 
           ierr = NF90_CLOSE(nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Pb when closing file', 1)
        END IF ! is_mpi_root
 !$OMP END MASTER
@@ -280,5 +280,5 @@
 !    The file is read only by the master thread of the master mpi process(is_mpi_root)
 !    Check by the way if the number of records is correct.
-!
+
 !****************************************************************************************
 
@@ -333,5 +333,5 @@
 
           ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,&
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,&
                'Pb d''ouverture du fichier de conditions aux limites',1)
 
@@ -345,40 +345,40 @@
 !****************************************************************************************
 ! 2) Read fraction if not type_ocean=couple
-!
+
 !****************************************************************************************
 
           IF ( type_ocean /= 'couple') THEN
-!
+
 ! Ocean fraction
              ierr = NF90_INQ_VARID(nid, 'FOCE', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname, 'Le champ <FOCE> est absent',1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname, 'Le champ <FOCE> est absent',1)
              
-             ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_oce),start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FOCE>' ,1)
-!
+             ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_oce),start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FOCE>' ,1)
+
 ! Sea-ice fraction
              ierr = NF90_INQ_VARID(nid, 'FSIC', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FSIC> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_sic),start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FSIC>' ,1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <FSIC> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_sic),start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FSIC>' ,1)
 
 
 ! Read land and continentals fraction only if asked for
              IF (read_continents .OR. itime == 1) THEN
-!
+
 ! Land fraction
                 ierr = NF90_INQ_VARID(nid, 'FTER', nvarid)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FTER> est absent',1)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <FTER> est absent',1)
                 
-                ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_ter),start,epais)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FTER>',1)
-!
+                ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_ter),start,epais)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FTER>',1)
+
 ! Continentale ice fraction
                 ierr = NF90_INQ_VARID(nid, 'FLIC', nvarid)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FLIC> est absent',1)
-
-                ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_lic),start,epais)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FLIC>',1)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <FLIC> est absent',1)
+
+                ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_lic),start,epais)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FLIC>',1)
              END IF
 
@@ -387,13 +387,13 @@
 !****************************************************************************************
 ! 3) Read sea-surface temperature, if not coupled ocean
-!
+
 !****************************************************************************************
           IF ( type_ocean /= 'couple') THEN
 
              ierr = NF90_INQ_VARID(nid, 'SST', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <SST> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,sst_glo,start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <SST>',1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <SST> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,sst_glo,start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <SST>',1)
           
           END IF
@@ -401,22 +401,22 @@
 !****************************************************************************************
 ! 4) Read albedo and rugosity for land surface, only in case of no vegetation model
-!
+
 !****************************************************************************************
 
           IF (.NOT. ok_veget) THEN
-!
+
 ! Read albedo
              ierr = NF90_INQ_VARID(nid, 'ALB', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <ALB> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,alb_glo,start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <ALB>',1)
-!
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <ALB> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,alb_glo,start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <ALB>',1)
+
 ! Read rugosity
              ierr = NF90_INQ_VARID(nid, 'RUG', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <RUG> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,rug_glo,start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <RUG>',1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <RUG> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,rug_glo,start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <RUG>',1)
 
           END IF
@@ -424,8 +424,8 @@
 !****************************************************************************************
 ! 5) Close file and distribuate variables to all processus
-!
+
 !****************************************************************************************
           ierr = NF90_CLOSE(nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Pb when closing file', 1)
        ENDIF ! is_mpi_root
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/limit_slab.F90	(revision 5099)
@@ -62,5 +62,5 @@
         
         ierr = NF90_OPEN ('limit_slab.nc', NF90_NOWRITE, nid)
-        IF (ierr /= NF90_NOERR) THEN
+        IF (ierr /= nf90_noerr) THEN
             PRINT *,'LIMIT_SLAB file not found'
             read_bils=.FALSE.
@@ -77,7 +77,7 @@
 !****************************************************************************************
 ! 2) Read bils and SST/ ice volume tendency
-!
+
 !****************************************************************************************
-!
+
 ! Read bils_glo
         bils_glo(:,:)=0.
@@ -85,16 +85,16 @@
         ! try first "BILS_OCE01"
         ierr = NF90_INQ_VARID(nid, 'BILS_OCE01', nvarid)
-        IF (ierr /= NF90_NOERR) THEN
+        IF (ierr /= nf90_noerr) THEN
             ! Else BILS_OCE
             ierr = NF90_INQ_VARID(nid, 'BILS_OCE', nvarid)
-            IF (ierr /= NF90_NOERR) THEN
+            IF (ierr /= nf90_noerr) THEN
               read_bils=.FALSE.
             ELSE
-              ierr = NF90_GET_VAR(nid,nvarid,bils_glo(:,1),start,epais)
-              IF (ierr /= NF90_NOERR) read_bils=.FALSE.
+              ierr = nf90_get_var(nid,nvarid,bils_glo(:,1),start,epais)
+              IF (ierr /= nf90_noerr) read_bils=.FALSE.
             ENDIF
         ELSE
-            ierr = NF90_GET_VAR(nid,nvarid,bils_glo(:,1),start,epais)
-            IF (ierr /= NF90_NOERR) read_bils=.FALSE.
+            ierr = nf90_get_var(nid,nvarid,bils_glo(:,1),start,epais)
+            IF (ierr /= nf90_noerr) read_bils=.FALSE.
         END IF
         ! Try next layers if more than 1
@@ -103,8 +103,8 @@
             WRITE(str2,'(i2.2)') i
             ierr = NF90_INQ_VARID(nid,'BILS_OCE'//str2, nvarid)
-            IF (ierr==NF90_NOERR) THEN
-              ierr = NF90_GET_VAR(nid,nvarid,bils_glo(:,i),start,epais)
+            IF (ierr==nf90_noerr) THEN
+              ierr = nf90_get_var(nid,nvarid,bils_glo(:,i),start,epais)
             ENDIF
-            IF (ierr /= NF90_NOERR) THEN
+            IF (ierr /= nf90_noerr) THEN
               print *,'WARNING : BILS_OCE not found for layer 2'
             ENDIF
@@ -114,37 +114,37 @@
 ! Read sst_glo for this day
         ierr = NF90_INQ_VARID(nid, 'SST', nvarid)
-        IF (ierr /= NF90_NOERR)  THEN
+        IF (ierr /= nf90_noerr)  THEN
             read_sst=.FALSE.
         ELSE
-            ierr = NF90_GET_VAR(nid,nvarid,sst_l_glo,start,epais)
-            IF (ierr /= NF90_NOERR) read_sst=.FALSE.
+            ierr = nf90_get_var(nid,nvarid,sst_l_glo,start,epais)
+            IF (ierr /= nf90_noerr) read_sst=.FALSE.
 ! Read sst_glo for one day ahead
             start(2) = jour + 1
             IF (start(2) > 360) start(2)=1
-            ierr = NF90_GET_VAR(nid,nvarid,sst_lp1_glo,start,epais)
-            IF (ierr /= NF90_NOERR) read_sst=.FALSE.
+            ierr = nf90_get_var(nid,nvarid,sst_lp1_glo,start,epais)
+            IF (ierr /= nf90_noerr) read_sst=.FALSE.
         END IF
 
 ! Read siv_glo for this day
         ierr = NF90_INQ_VARID(nid, 'SICV', nvarid)
-        IF (ierr /= NF90_NOERR)  THEN
+        IF (ierr /= nf90_noerr)  THEN
             read_siv=.FALSE.
         ELSE
             start(2) = jour
-            ierr = NF90_GET_VAR(nid,nvarid,siv_l_glo,start,epais)
-            IF (ierr /= NF90_NOERR) read_siv=.FALSE.
+            ierr = nf90_get_var(nid,nvarid,siv_l_glo,start,epais)
+            IF (ierr /= nf90_noerr) read_siv=.FALSE.
 ! Read siv_glo for one day ahead
             start(2) = jour + 1
             IF (start(2) > 360) start(2)=1
-            ierr = NF90_GET_VAR(nid,nvarid,siv_lp1_glo,start,epais)
-            IF (ierr /= NF90_NOERR) read_siv=.FALSE.
+            ierr = nf90_get_var(nid,nvarid,siv_lp1_glo,start,epais)
+            IF (ierr /= nf90_noerr) read_siv=.FALSE.
         END IF
 
 !****************************************************************************************
 ! 5) Close file and distribute variables to all processus
-!
+
 !****************************************************************************************
         ierr = NF90_CLOSE(nid)
-        IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
+        IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Pb when closing file', 1)
         END IF ! Read File 
         IF (read_sst) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_exchange_coeff.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_exchange_coeff.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_exchange_coeff.F90	(revision 5099)
@@ -12,5 +12,5 @@
 ! Routine that computes turbulent Km / Kh coefficients with a
 ! 1.5 order closure scheme (TKE) with or without stationarity assumption
-!
+
 ! This parameterization has been constructed in the framework of a
 ! collective and collaborative workshop, 
@@ -18,5 +18,5 @@
 ! K. Arjdal, L. Raillard, C. Dehondt, P. Tiengou, A. Spiga, F. Cheruy, T Dubos, 
 ! M. Coulon-Decorzens, S. Fromang, G. Riviere, A. Sima, F. Hourdin, E. Vignon
-!
+
 ! Main assumptions of the model :
 ! (1) horizontal homogeneity (Dx=Dy=0.)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_sublim_sedim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_sublim_sedim.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_sublim_sedim.F90	(revision 5099)
@@ -219,5 +219,5 @@
               ! dqb/dt_sub=-c_sub(1-qv/qsi)*qb
               ! c_sub=coef_sub_bs*6*rhoair/(rhobs*pi*r_bs**2)/(Aprime+Bprime)
-              ! 
+
               ! Note the strong coupling between specific contents of water vapor and blowing snow during sublimation
               ! equations dqv/dt_sub and dqb/dt_sub must be solved jointly to prevent irrealistic increase of water vapor
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloud_optics_prop.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloud_optics_prop.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloud_optics_prop.F90	(revision 5099)
@@ -43,5 +43,5 @@
   !          M. Coulon-Decorzens: replayisation of the routine + cleaning
   !                               and commentaries
-  !
+
   ! Aim: compute condensate optical properties,
   !      cloud optical depth and emissivity
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth.F90	(revision 5099)
@@ -1226,15 +1226,4 @@
 !     end
 END SUBROUTINE cloudth_vert_v3
-!
-
-
-
-
-
-
-
-
-
-
 
        SUBROUTINE cloudth_v6(ngrid,klev,ind2,  &
@@ -1842,13 +1831,13 @@
 
 !        ELSE ! mpc_bl_points>0
-!
+
 !            ! Treat boundary layer mixed phase clouds
-!            
+
 !            ! thermals
 !            !=========
-!
+
 !           ! ice phase
 !           !...........
-!
+
 !            qiceth=0.
 !            deltazlev_mpc=dz(ind1,:)
@@ -1866,8 +1855,8 @@
 !                iflag_topthermals = 0
 !            ENDIF
-!
+
 !            CALL ICE_MPC_BL_CLOUDS(ind1,ind2,klev,Ni,Ei,C_cap,d_top,iflag_topthermals,temp_mpc,pres_mpc,zqta(ind1,:), &
 !                                   qsith(ind1,:),qlth(ind1,:),deltazlev_mpc,wiceth(ind1,:),fraca_mpc,qith(ind1,:))
-!
+
 !            ! qmax calculation
 !            sigma2s=(sigma2s_factor*((MAX((sthl-senvl),0.)**2)**0.5)/((fraca(ind1,ind2)+0.02)**sigma2s_power))+0.002*zqta(ind1,ind2)
@@ -1885,20 +1874,20 @@
 !            IntI3_CF=(sqrt2*sigma2s*(exp_xth1-exp_xth2))/(4*sqrtpi*deltasth)
 !            qmax=MAX(IntJ+IntI1+IntI2+IntI3,0.)
-!
-!
+
+
 !            ! Liquid phase
 !            !................
 !            ! We account for the effect of ice crystals in thermals on sthl
 !            ! and on the width of the distribution
-!
+
 !            sthlc=sthl*1./(1.+C_mpc*qith(ind1,ind2))  &
 !                + (1.-1./(1.+C_mpc*qith(ind1,ind2))) * athl*(qsith(ind1,ind2)-qslth(ind1))  
-!
+
 !            sigma2sc=(sigma2s_factor*((MAX((sthlc-senvl),0.)**2)**0.5) &
 !                 /((fraca(ind1,ind2)+0.02)**sigma2s_power)) &
 !                 +0.002*zqta(ind1,ind2)
 !            deltasthc=athl*vert_alpha_th*sigma2sc
-!     
-!            
+
+
 !            xth1=-(sthlc+deltasthc)/(sqrt(2.)*sigma2sc)
 !            xth2=-(sthlc-deltasthc)/(sqrt(2.)*sigma2sc)           
@@ -1913,14 +1902,14 @@
 !            IntI3_CF=(sqrt2*sigma2sc*(exp_xth1-exp_xth2))/(4*sqrtpi*deltasthc)
 !            qliqth=IntJ+IntI1+IntI2+IntI3
-!            
+
 !            qlth(ind1,ind2)=MAX(0.,qliqth)
-!
+
 !            ! Condensed water
-!            
+
 !            qcth(ind1,ind2)=qlth(ind1,ind2)+qith(ind1,ind2)
-!
-!
+
+
 !            ! consistency with subgrid distribution
-!           
+
 !             IF ((qcth(ind1,ind2) .GT. qmax) .AND. (qcth(ind1,ind2) .GT. 0)) THEN
 !                 fraci=qith(ind1,ind2)/qcth(ind1,ind2)
@@ -1929,5 +1918,5 @@
 !                 qlth(ind1,ind2)=(1.-fraci)*qmax
 !             ENDIF
-!
+
 !            ! Cloud Fraction
 !            !...............
@@ -1937,5 +1926,5 @@
 !            ! sbase and qbase calculation (note that sbase is wrt liq so negative)
 !            ! look for an approximate solution with iteration
-!            
+
 !            ttarget=qcth(ind1,ind2)
 !            mini= athl*(qsith(ind1,ind2)-qslth(ind1))
@@ -1957,10 +1946,10 @@
 !            ENDDO
 !            qbase=MAX(0., sbase/athl+qslth(ind1))
-!
+
 !            ! surface cloud fraction in thermals
 !            cth(ind1,ind2)=0.5*(1.-erf((sbase-sthl)/sqrt(2.)/sigma2s))
 !            cth(ind1,ind2)=MIN(MAX(cth(ind1,ind2),0.),1.)
-!
-!
+
+
 !            !volume cloud fraction in thermals
 !            !to be checked
@@ -1969,8 +1958,8 @@
 !            exp_xth1 = exp(-1.*xth1**2)
 !            exp_xth2 = exp(-1.*xth2**2)
-!
+
 !            IntJ=0.5*sthl*(1-erf(xth2))+(sigma2s/sqrt2pi)*exp_xth2
 !            IntJ_CF=0.5*(1.-1.*erf(xth2))
-!     
+
 !            IF (deltasth .LT. 1.e-10) THEN
 !              cth_vol(ind1,ind2)=IntJ_CF
@@ -1984,12 +1973,12 @@
 !            ENDIF
 !              cth_vol(ind1,ind2)=MIN(MAX(0.,cth_vol(ind1,ind2)),1.)
-!
-!
-!
+
+
+
 !            ! Environment
 !            !=============
 !            ! In the environment/downdrafts, only liquid clouds
 !            ! See Shupe et al. 2008, JAS
-!
+
 !            ! standard deviation of the distribution in the environment
 !            sth=sthl
@@ -1999,10 +1988,10 @@
 !            ! for mixed phase clouds, there is no contribution from large scale ratqs to the distribution
 !            ! in the environement
-!
+
 !            sigma1s_ratqs=1E-10
 !            IF (cloudth_ratqsmin>0.) THEN
 !                sigma1s_ratqs = cloudth_ratqsmin*po(ind1)
 !            ENDIF
-!
+
 !            sigma1s = sigma1s_fraca + sigma1s_ratqs
 !            IF (iflag_ratqs.eq.11) then
@@ -2017,12 +2006,12 @@
 !            exp_xenv1 = exp(-1.*xenv1**2)
 !            exp_xenv2 = exp(-1.*xenv2**2)
-!
+
 !            !surface CF
 !            cenv(ind1,ind2)=0.5*(1.-1.*erf(xenv1))
-!
+
 !            !volume CF and condensed water
 !            IntJ=0.5*senvl*(1-erf(xenv2))+(sigma1s/sqrt2pi)*exp_xenv2
 !            IntJ_CF=0.5*(1.-1.*erf(xenv2))
-!
+
 !            IF (deltasenv .LT. 1.e-10) THEN
 !              qcenv(ind1,ind2)=IntJ
@@ -2037,10 +2026,10 @@
 !              cenv_vol(ind1,ind2)=IntJ_CF+IntI1_CF+IntI3_CF
 !            ENDIF
-!
+
 !            qcenv(ind1,ind2)=MAX(qcenv(ind1,ind2),0.)
 !            cenv_vol(ind1,ind2)=MIN(MAX(cenv_vol(ind1,ind2),0.),1.)
-!
-!
-!            
+
+
+
 !            ! Thermals + environment
 !            ! ======================= 
@@ -2056,5 +2045,5 @@
 !                icefrac(ind1,ind2)=0.
 !            ENDIF
-!
+
 !            IF (cenv(ind1,ind2).LT.1.e-10.or.cth(ind1,ind2).LT.1.e-10) THEN
 !                ctot(ind1,ind2)=0.
@@ -2068,5 +2057,5 @@
 !                            +(1.-1.*fraca(ind1,ind2))*(qcenv(ind1,ind2)/cenv(ind1,ind2)),0.)
 !            ENDIF 
-!
+
 !        ENDIF ! mpc_bl_points
 
@@ -2078,5 +2067,5 @@
 ! parameterization of ice for boundary
 ! layer mixed-phase clouds assuming a stationary system
-!
+
 ! Note that vapor deposition on ice crystals and riming of liquid droplets
 ! depend on the ice number concentration Ni
@@ -2089,30 +2078,30 @@
 ! By default we take 2.0L-1=2.0e3m-3, median value from measured vertical profiles near Svalbard
 ! in Mioche et al. 2017
-!
-!
+
+
 ! References:
 !------------
 ! This parameterization is thoroughly described in Vignon et al. 
-!
+
 ! More specifically
 ! for the Water vapor deposition process:
-!
+
 ! Rotstayn, L. D., 1997: A physically based scheme for the treat-
 ! ment of stratiform cloudfs and precipitation in large-scale
 ! models. I: Description and evaluation of the microphysical
 ! processes. Quart. J. Roy. Meteor. Soc., 123, 1227–1282.
-!
+
 !  Morrison, H., and A. Gettelman, 2008: A new two-moment bulk
 !  stratiform cloud microphysics scheme in the NCAR Com-
 !  munity Atmosphere Model (CAM3). Part I: Description and
 !  numerical tests. J. Climate, 21, 3642–3659
-!
+
 ! for the Riming process:
-!
+
 ! Rutledge, S. A., and P. V. Hobbs, 1983: The mesoscale and micro-
 ! scale structure and organization of clouds and precipitation in
 ! midlatitude cyclones. VII: A model for the ‘‘seeder-feeder’’
 ! process in warm-frontal rainbands. J. Atmos. Sci., 40, 1185–1206
-!
+
 ! Thompson, G., R. M. Rasmussen, and K. Manning, 004: Explicit
 ! forecasts of winter precipitation using an improved bulk
@@ -2120,15 +2109,15 @@
 ! forecasts of winter precipitation using an improved bulk
 ! microphysics scheme. Part I: Description and sensitivity analysis. Mon. Wea. Rev., 132, 519–542
-!
+
 ! For the formation of clouds by thermals:
-!
+
 ! Rio, C., & Hourdin, F. (2008). A thermal plume model for the convective boundary layer : Representation of cumulus clouds. Journal of
 ! the Atmospheric Sciences, 65, 407–425.
-!
+
 ! Jam, A., Hourdin, F., Rio, C., & Couvreux, F. (2013). Resolved versus parametrized boundary-layer plumes. Part III: Derivation of a
 ! statistical scheme for cumulus clouds. Boundary-layer Meteorology, 147, 421–441. https://doi.org/10.1007/s10546-012-9789-3
-!
-!
-!
+
+
+
 ! Contact: Etienne Vignon, etienne.vignon@lmd.ipsl.fr
 !=============================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp.F90	(revision 5099)
@@ -31,9 +31,9 @@
 !--------------------------------------------------------------------------------
 ! Aim: Large Scale Clouds and Precipitation (LSCP)
-!
+
 ! This code is a new version of the fisrtilp.F90 routine, which is itself a 
 ! merge of 'first' (superrsaturation physics, P. LeVan K. Laval)
 ! and 'ilp' (il pleut, L. Li)
-!
+
 ! Compared to the original fisrtilp code, lscp
 ! -> assumes thermcep = .TRUE. all the time (fisrtilp inconsistent when .FALSE.)
@@ -47,5 +47,5 @@
 !--------------------------------------------------------------------------------
 ! References: 
-!
+
 ! - Bony, S., & Emanuel, K. A. 2001, JAS, doi: 10.1175/1520-0469(2001)058<3158:APOTCA>2.0.CO;2
 ! - Hourdin et al. 2013, Clim Dyn, doi:10.1007/s00382-012-1343-y
@@ -56,5 +56,5 @@
 ! -------------------------------------------------------------------------------
 ! Code structure:
-!
+
 ! P0>     Thermalization of the precipitation coming from the overlying layer
 ! P1>     Evaporation of the precipitation (falling from the k+1 level)
@@ -69,8 +69,8 @@
 !------------------------------------------------------------------------------
 ! Some preliminary comments (JBM) :
-!
+
 ! The cloud water that the radiation scheme sees is not the same that the cloud
 ! water used in the physics and the dynamics 
-! 
+
 ! During the autoconversion to precipitation (P3 step), radocond (cloud water used
 ! by the radiation scheme) is calculated as an average of the water that remains
@@ -78,13 +78,13 @@
 ! of the time step. The latter is used in the rest of the physics and advected
 ! by the dynamics. 
-!
+
 ! In summary:
-!
+
 ! Radiation:
 ! xflwc(newmicro)+xfiwc(newmicro) =
 !   radocond=lwcon(nc)+iwcon(nc)
-!
+
 ! Notetheless, be aware of:
-!
+
 ! radocond .NE. ocond(nc)
 ! i.e.:
@@ -93,5 +93,4 @@
 ! (which is not trivial)
 !++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!
 
 ! USE de modules contenant des fonctions.
@@ -710,5 +709,5 @@
     ! P2> Cloud formation
     !---------------------------------------------------------------------
-    !
+
     ! Unlike fisrtilp, we always assume a 'fractional cloud' approach 
     ! i.e. clouds occupy only a fraction of the mesh (the subgrid distribution
@@ -1445,5 +1444,5 @@
 
     !--save some variables for ice supersaturation
-    !
+
     DO i = 1, klon
         ! for memory 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_old.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_old.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_old.F90	(revision 5099)
@@ -1,5 +1,5 @@
 ! $Id$
-!
-!
+
+
 MODULE lmdz_lscp_old
 CONTAINS
@@ -13,6 +13,4 @@
      cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv)
 
-
-  !
   USE icefrac_lsc_mod ! compute ice fraction (JBM 3/14)
   USE lmdz_cloudth, only : cloudth, cloudth_v3, cloudth_v6
@@ -58,7 +56,7 @@
   include "YOETHF.h"
   include "FCTTRE.h"
-  !
+
   ! Principaux inputs:
-  !
+
   REAL, INTENT(IN)                              :: dtime  ! intervalle du temps (s)
   INTEGER, INTENT(IN)                           :: klon, klev
@@ -70,17 +68,17 @@
   INTEGER,                         INTENT(IN)   :: iflag_cld_th
   INTEGER,                         INTENT(IN)   :: iflag_ice_thermo
-  !
+
   ! Inputs lies aux thermiques
-  ! 
+
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: ztv
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: zqta, fraca 
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: zpspsk, ztla
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)   :: zthl
-  !
+
   !  Input/output
   REAL, DIMENSION(klon,klev),      INTENT(INOUT):: ratqs  ! determine la largeur de distribution de vapeur
-  !
+
   ! Principaux outputs:
-  !
+
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: d_t  ! incrementation de la temperature (K)
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: d_q  ! incrementation de la vapeur d'eau
@@ -98,12 +96,12 @@
   !AA
   ! Coeffients de fraction lessivee : pour OFF-LINE
-  !
+
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)  :: pfrac_nucl
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)  :: pfrac_1nucl
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)  :: pfrac_impa
-  !
+
   ! Fraction d'aerosols lessivee par impaction et par nucleation
   ! POur ON-LINE
-  !
+
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: frac_impa
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: frac_nucl
@@ -112,7 +110,6 @@
   !AA
   ! --------------------------------------------------------------------------------
-  !
+
   ! Options du programme:
-  !
 
   REAL :: smallestreal
@@ -124,7 +121,7 @@
   REAL, PARAMETER :: ztfondue=278.15
   ! --------------------------------------------------------------------------------
-  !
+
   ! Variables locales:
-  !
+
   INTEGER :: i, k, n, kk
   REAL :: qsl, qsi
@@ -165,26 +162,26 @@
 ! Variable pour conservation enegie des precipitations
   REAL, DIMENSION(klon) :: zmqc
-  !
+
   LOGICAL, SAVE :: appel1er=.TRUE.
   !$OMP THREADPRIVATE(appel1er)
-  !
+
 ! iflag_oldbug_fisrtilp=0 enleve le BUG par JYG : tglace_min -> tglace_max
 ! iflag_oldbug_fisrtilp=1 ajoute le BUG
   !---------------------------------------------------------------
-  !
+
   ! Fonctions en ligne:
-  !
+
   REAL ::  fallvs,fallvc, zzz ! Vitesse de chute pour cristaux de glace
                      ! (Heymsfield & Donner, 1990)
   fallvc (zzz) = 3.29/2.0 * ((zzz)**0.16) * ffallv_con
   fallvs (zzz) = 3.29/2.0 * ((zzz)**0.16) * ffallv_lsc
-  !
+
   !---------------------------------------------------------------
   !AA Variables traceurs:
   !AA  Provisoire !!! Parametres alpha du lessivage
   !AA  A priori on a 4 scavenging # possibles
-  !
+
   ! Variables intermediaires
-  !
+
   REAL :: zalpha_tr, zfrac_lessi
   REAL, DIMENSION(klon) :: zprec_cond
@@ -198,6 +195,4 @@
   REAL :: zm_solid
 
-
-  !
   !ym
 !CR: pour iflag_ice_thermo=2, on active que la convection
@@ -230,5 +225,5 @@
      ENDIF
      appel1er = .FALSE.
-     !
+
      !cdir collapse
      DO k = 1, klev
@@ -242,5 +237,5 @@
 
   ENDIF          !  test sur appel1er
-  !
+
   !MAf Initialisation a 0 de zoliq
   !      DO i = 1, klon
@@ -249,5 +244,5 @@
   ! Determiner les nuages froids par leur temperature
   !  nexpo regle la raideur de la transition eau liquide / eau glace.
-  !
+
 !CR: on est oblige de definir des valeurs fisrt car les valeurs de newmicro ne sont pas les memes par defaut
   IF (iflag_t_glace==0) THEN
@@ -269,7 +264,7 @@
 !>AJ
   !cc      nexpo = 1
-  !
+
   ! Initialiser les sorties:
-  !
+
   !cdir collapse
   DO k = 1, klev+1
@@ -299,7 +294,7 @@
      zoliq(i)=0.
      !     ENDDO
-     !
+
      ! Initialiser le flux de precipitation a zero
-     !
+
      !     DO i = 1, klon
      zrfl(i) = 0.0
@@ -317,6 +312,6 @@
      zneb(i) = seuil_neb
   ENDDO
-  !
-  !
+
+
   !AA Pour plus de securite 
 
@@ -325,12 +320,12 @@
 
   !AA==================================================================
-  !
+
   ncoreczq=0
   ! BOUCLE VERTICALE (DU HAUT VERS LE BAS)
-  !
+
   DO k = klev, 1, -1
-     !
+
      !AA===============================================================
-     !
+
      ! Initialisation temperature et vapeur
      DO i = 1, klon
@@ -338,5 +333,5 @@
         zq(i)=q(i,k)
      ENDDO
-     !
+
      ! ----------------------------------------------------------------
      ! P0> Thermalisation des precipitations venant de la couche du dessus
@@ -351,5 +346,5 @@
      !   -  zt: temperature de la cocuhe
      !   - zmqc: masse de precip qui doit etre thermalisee
-     !
+
      IF(k<=klev-1) THEN
         DO i = 1, klon
@@ -379,5 +374,5 @@
         ENDDO
      ENDIF ! end IF(k.LE.klev-1)
-     !
+
      ! ----------------------------------------------------------------
      ! P1> Calcul de l'evaporation de la precipitation
@@ -390,5 +385,5 @@
      !   - zq, zt: humidite et temperature de la cocuhe
      !   - zmqc: masse de precip qui doit etre thermalisee
-     !
+
      IF (iflag_evap_prec>=1) THEN
         DO i = 1, klon
@@ -475,5 +470,5 @@
            ENDIF ! (zrfl(i)+zifl(i).GT.0.)
         ENDDO
-!
+
        ELSE ! (.NOT. ice_thermo) 
 !      ================================
@@ -691,7 +686,7 @@
      ! ----------------------------------------------------------------
      ENDIF ! (iflag_evap_prec>=1)
-     !
+
      ! Calculer Qs et L/Cp*dQs/dT:
-     !
+
      IF (thermcep) THEN
         DO i = 1, klon
@@ -722,8 +717,8 @@
         ENDDO
      ENDIF
-     !
+
      ! Determiner la condensation partielle et calculer la quantite
      ! de l'eau condensee:
-     !
+
 !verification de la valeur de iflag_fisrtilp_qsat pour iflag_ice_thermo=1
 !       if ((iflag_ice_thermo.eq.1).and.(iflag_fisrtilp_qsat.ne.0)) then
@@ -742,10 +737,10 @@
      !   zt : temperature de la maille
      ! ----------------------------------------------------------------
-     !
+
      IF (cpartiel) THEN
         ! -------------------------
         ! P2.A> Nuage fractionnaire
         ! -------------------------
-        !
+
         !   Calcul de l'eau condensee et de la fraction nuageuse et de l'eau
         !   nuageuse a partir des PDF de Sandrine Bony.
@@ -755,5 +750,5 @@
         !  on prend en compte le réchauffement qui diminue la partie
         ! condensee
-        !
+
         !   Version avec les raqts
 
@@ -863,5 +858,5 @@
                  if ((convergence(i).or.(n_i(i)==0)).and.lognormale(i)) then
                  ! si on n'a pas converge
-                 !
+
                  ! P2.A.2.1> Calcul de la fraction nuageuse et de la quantite d'eau condensee
                  ! ---------------------------------------------------------------
@@ -871,5 +866,5 @@
                  ! zcond: eau condensee en moyenne dans la maille
                  ! rhcl: humidite relative ciel-clair
-                 !
+
                  Tbef(i)=Tbef(i)+DT(i) ! nouvelle temperature
                  if (.not.ice_thermo) then   
@@ -1050,5 +1045,5 @@
         !   rhcl: humidite relative ciel-clair
         ! ----------------------------------------------------------------
-        !
+
         ! Bornage de l'eau in-cloud (zqn) et de la fraction nuageuse (rneb) 
         ! Calcule de l'eau condensee moyenne dans la maille (zcond),
@@ -1094,5 +1089,5 @@
         ENDDO
      ENDIF ! de IF (cpartiel) 
-     !
+
      ! Mise a jour vapeur d'eau
      ! -------------------------
@@ -1107,5 +1102,5 @@
      ! Variable calcule:
      !   zt : temperature de la maille
-     !
+
      IF (.NOT. ice_thermo) THEN
         if (iflag_fisrtilp_qsat<1) then
@@ -1166,7 +1161,6 @@
      ! P3> Formation des precipitations
      ! ----------------------------------------------------------------
-     !
+
      ! Partager l'eau condensee en precipitation et eau liquide nuageuse
-     !
 
 !<LTP
@@ -1269,5 +1263,5 @@
         ENDIF
      ENDDO
-     !
+
      DO n = 1, ninter
         DO i = 1, klon
@@ -1334,5 +1328,5 @@
 
      ! ----------------------------------------------------------------
-     !
+
      IF (.NOT. ice_thermo) THEN
        DO i = 1, klon
@@ -1344,5 +1338,5 @@
        ENDDO
      ELSE
-!
+
 !CR&JYG<
 ! On prend en compte l'effet Bergeron dans les flux de precipitation :
@@ -1355,5 +1349,5 @@
 ! Le condensat precipitant solide est augmente.
 ! La vapeur d'eau est augmentee.
-!
+
        IF ((iflag_bergeron == 2)) THEN
          DO i = 1, klon
@@ -1559,16 +1553,16 @@
      ! Fin de formation des precipitations
      ! ----------------------------------------------------------------
-     !
+
      ! Calculer les tendances de q et de t:
-     !
+
      DO i = 1, klon
         d_q(i,k) = zq(i) - q(i,k)
         d_t(i,k) = zt(i) - t(i,k)
      ENDDO
-     !
+
      !AA--------------- Calcul du lessivage stratiforme  -------------
 
      DO i = 1,klon
-        !
+
         if(zcond(i)>zoliq(i)+1.e-10) then
          beta(i,k) = (zcond(i)-zoliq(i))/zcond(i)/dtime
@@ -1596,12 +1590,12 @@
            pfrac_nucl(i,k)=pfrac_nucl(i,k)*(1.-zneb(i)*zfrac_lessi)
            frac_nucl(i,k)= 1.-zneb(i)*zfrac_lessi 
-           !
+
            ! nucleation avec un facteur -1 au lieu de -0.5
            zfrac_lessi = 1. - EXP(-zprec_cond(i)/zneb(i))
            pfrac_1nucl(i,k)=pfrac_1nucl(i,k)*(1.-zneb(i)*zfrac_lessi)
         ENDIF
-        !
+
      ENDDO      ! boucle sur i
-     !
+
      !AA Lessivage par impaction dans les couches en-dessous
      DO kk = k-1, 1, -1
@@ -1627,13 +1621,13 @@
         ENDDO
      ENDDO
-     !
+
      !AA===============================================================
      !                     FIN DE LA BOUCLE VERTICALE  
   end DO
-  !
+
   !AA==================================================================
-  !
+
   ! Pluie ou neige au sol selon la temperature de la 1ere couche
-  !
+
 !CR: si la thermo de la glace est active, on calcule zifl directement
   IF (.NOT.ice_thermo) THEN
@@ -1658,5 +1652,5 @@
    
    ENDIF
-  !
+
   ! For energy conservation : when snow is present, the solification
   ! latent heat is considered.
@@ -1672,5 +1666,4 @@
   END DO
   ENDIF
-  !
 
   if (ncoreczq>0) then
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_poprecip.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_poprecip.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_poprecip.F90	(revision 5099)
@@ -15,5 +15,5 @@
 ! Computes the processes-oriented precipitation formulations for
 ! evaporation and sublimation
-! 
+
 SUBROUTINE poprecip_precld( &
            klon, dtime, iftop, paprsdn, paprsup, pplay, temp, tempupnew, qvap, &
@@ -271,5 +271,5 @@
 ! - melting (melt)
 ! - freezing (freez)
-! 
+
 SUBROUTINE poprecip_postcld( &
            klon, dtime, paprsdn, paprsup, pplay, ctot_vol, ptconv, &
@@ -619,7 +619,7 @@
     ! Liquid water quantity to remove according to (Sundqvist, 1978)
     ! dqliq/dt = -qliq/tau * ( 1-exp(-(qliqincld/qthresh)**2) )
-    !
+
     !--And same formula for ice
-    !
+
     !--We first treat the second term (with exponential) in an explicit way
     !--and then treat the first term (-q/tau) in an exact way
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_multi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_multi.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_multi.F90	(revision 5099)
@@ -367,10 +367,10 @@
 
 ! References:
-!
+
 ! Etienne Vignon: effect of subgrid turbulence on ratqs
-!
+
 ! Field, P.R., Hill, A., Furtado, K., Korolev, A., 2014b. Mixed-phase clouds in a turbulent environment. Part
 ! 2: analytic treatment. Q. J. R. Meteorol. Soc. 21, 2651???2663. https://doi.org/10.1002/qj.2175.
-! 
+
 ! Furtado, K., Field, P.R., Boutle, I.A., Morcrette, C.R., Wilkinson, J., 2016. A physically-based, subgrid
 ! parametrization for the production and maintenance of mixed-phase clouds in a general circulation
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alim.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alim.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE lmdz_thermcell_alim
-!
+
 ! $Id: thermcell_plume.F90 2311 2015-06-25 07:45:24Z emillour $
-!
+
 CONTAINS
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_alp.F90	(revision 5099)
@@ -1,5 +1,5 @@
 MODULE lmdz_thermcell_alp
 ! $Id: thermcell_main.F90 2351 2015-08-25 15:14:59Z emillour $
-!
+
 CONTAINS
 
@@ -10,5 +10,5 @@
                     ,zw2,fraca &                                           ! in
                     ,pcon,rhobarz,wth3,wmax_sec,lalim,fm,alim_star,zmax &  ! in
-!
+
                     ,zcong,ale_bl,alp_bl,lalim_conv,wght_th &                    ! out
                     ,zlcl,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &   ! out
@@ -24,5 +24,5 @@
 
 !=======================================================================
-!
+
 !   Auteurs: Catherine Rio
 !   Modifications :
@@ -31,5 +31,5 @@
 !   Frédéric Hourdin :
 !         netoyage informatique. 2022
-!   
+
 !=======================================================================
 !-----------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_closure.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_closure.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_closure.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE lmdz_thermcell_closure
-!
+
 ! $Header$
-!
+
 CONTAINS
 
@@ -10,5 +10,5 @@
 !-------------------------------------------------------------------------
 !thermcell_closure: fermeture, determination de f
-!
+
 ! Modification 7 septembre 2009
 ! 1. On enleve alim_star_tot des arguments pour le recalculer et etre ainis
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_down.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_down.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_down.F90	(revision 5099)
@@ -287,5 +287,5 @@
    ! Si l'air est sec (et qu'on oublie le c??t?? theta_v) on peut
    ! se contenter de conserver theta.
-   !
+
    ! Connaissant thetadn, on peut calculer la flotabilit??.
    ! Connaissant la flotabilit??, on peut calculer w de proche en proche
@@ -298,6 +298,4 @@
 !------------------
 
-
-!
  RETURN
    END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dq.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dq.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dq.F90	(revision 5099)
@@ -9,14 +9,14 @@
 
 !=======================================================================
-!
+
 !   Calcul du transport verticale dans la couche limite en presence
 !   de "thermiques" explicitement representes
 !   calcul du dq/dt une fois qu'on connait les ascendances
-!
+
 ! Modif 2013/01/04 (FH hourdin@lmd.jussieu.fr)
 !  Introduction of an implicit computation of vertical advection in
 !  the environment of thermal plumes in thermcell_dq
 !  impl =     0 : explicit, 1 : implicit, -1 : old version
-!
+
 !=======================================================================
 
@@ -163,9 +163,9 @@
 
 !=======================================================================
-!
+
 !   Calcul du transport verticale dans la couche limite en presence
 !   de "thermiques" explicitement representes
 !   calcul du dq/dt une fois qu'on connait les ascendances
-!
+
 !=======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dry.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dry.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dry.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE lmdz_thermcell_dry
-!
+
 ! $Id$
-!
+
 CONTAINS
 
@@ -136,5 +136,5 @@
       enddo
        if (prt_level>=1) print*,'fin calcul zw2'
-!
+
 ! Determination de zw2 max
       do ig=1,ngrid
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dtke.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dtke.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dtke.F90	(revision 5099)
@@ -8,9 +8,9 @@
 
 !=======================================================================
-!
+
 !   Calcul du transport verticale dans la couche limite en presence
 !   de "thermiques" explicitement representes
 !   calcul du dq/dt une fois qu'on connait les ascendances
-!
+
 !=======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dv2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dv2.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dv2.F90	(revision 5099)
@@ -9,11 +9,11 @@
 
 !=======================================================================
-!
+
 !   Calcul du transport verticale dans la couche limite en presence
 !   de "thermiques" explicitement representes
 !   calcul du dq/dt une fois qu'on connait les ascendances
-!
+
 ! Vectorisation, FH : 2010/03/08
-!
+
 !=======================================================================
 
@@ -186,5 +186,5 @@
       enddo
    endif
-!
+
      if (nlarga0>0) then
           print*,'WARNING !!!!!! DANS THERMCELL_DV2 '
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_env.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_env.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_env.F90	(revision 5099)
@@ -37,5 +37,4 @@
    mask(:,:)=.true.
 
-!
 ! calcul des caracteristiques de l environnement
    DO  ll=1,nlay
@@ -76,5 +75,5 @@
 !Thetal
             zthl(ig,ll)=pt(ig,ll)/zpspsk(ig,ll)
-!            
+
       enddo
    enddo
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_flux2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_flux2.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_flux2.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE lmdz_thermcell_flux2
-!
+
 ! $Id$
-!
+
 CONTAINS
 
@@ -404,6 +404,4 @@
         enddo
 !    enddo
-!
-
 
       if (prt_level>=10) &
@@ -480,5 +478,5 @@
       endif
       endif
-!                  
+
 !              ddd=detr(ig)-entre
 !on s assure que tout s annule bien en zmax
@@ -495,5 +493,5 @@
 !IM 090508 beg
 !     if (ncorecfm1+ncorecfm2+ncorecfm3+ncorecfm4+ncorecfm5+ncorecalpha > 0 ) then
-!
+
 !         print*,'PB thermcell : on a du coriger ',ncorecfm1,'x fm1',&
 !   &     ncorecfm2,'x fm2',ncorecfm3,'x fm3 et', &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_height.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_height.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_height.F90	(revision 5099)
@@ -56,5 +56,5 @@
          endif
       enddo 
-!    
+
 ! Determination de zw2 max
       do ig=1,ngrid
@@ -125,5 +125,5 @@
       endif
 !endif iflag_thermals_ed
-!
+
 ! def de  zmix continu (profil parabolique des vitesses)
       do ig=1,ngrid
@@ -135,5 +135,5 @@
           *((zlev(ig,lmix(ig)-1))-(zlev(ig,lmix(ig)))))>1e-10)  &
           then
-!             
+
             zmix(ig)=((zw2(ig,lmix(ig)-1)-zw2(ig,lmix(ig)))  &
           *((zlev(ig,lmix(ig)))**2-(zlev(ig,lmix(ig)+1))**2)  &
@@ -157,5 +157,5 @@
          endif
       enddo
-!
+
 ! calcul du nouveau lmix correspondant
       do ig=1,ngrid
@@ -167,5 +167,5 @@
           enddo
       enddo
-!
+
  RETURN
       end
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90	(revision 5099)
@@ -1,5 +1,5 @@
 MODULE lmdz_thermcell_main
 ! $Id$
-!
+
 ! A REGARDER !!!!!!!!!!!!!!!!!
 ! ATTENTION : zpspsk est inout et out mais c'est pas forcement pour de bonnes raisons (FH, 2023)
@@ -63,11 +63,11 @@
 !   Calcul du transport vertical dans la couche limite en presence
 !   de "thermiques" explicitement representes avec processus nuageux
-!
+
 !   Reecriture a partir d'un listing papier a Habas, le 14/02/00
-!
+
 !   le thermique est suppose homogene et dissipe par melange avec
 !   son environnement. la longueur l_mix controle l'efficacite du
 !   melange
-!
+
 !   Le calcul du transport des differentes especes se fait en prenant
 !   en compte:
@@ -76,5 +76,5 @@
 !     3. un entrainement
 !     4. un detrainement
-!
+
 ! Modif 2013/01/04 (FH hourdin@lmd.jussieu.fr)
 !    Introduction of an implicit computation of vertical advection in
@@ -85,5 +85,5 @@
 !       17, 18 run with impl=1  : more stable
 !    15 and 17 correspond to the activation of the stratocumulus "bidouille"
-!
+
 ! Using
 !    abort_physic 
@@ -101,5 +101,5 @@
 !    thermcell_plume_5B
 !    thermcell_plume_6A
-!
+
 !=======================================================================
 
@@ -179,10 +179,8 @@
 #endif
 
-!
-
 !-----------------------------------------------------------------------
 !   initialisation:
 !   ---------------
-!
+
    fm=0. ; entr=0. ; detr=0.
 
@@ -196,5 +194,5 @@
          PRINT*,'ngrid  =',ngrid
       ENDIF
-!
+
 !print*,'thermcell_main debut'
 !     write(lunout,*)'WARNING thermcell_main f0=max(f0,1.e-2)'
@@ -214,5 +212,5 @@
 ! Calcul de T,q,ql a partir de Tl et qT dans l environnement
 !   --------------------------------------------------------------------
-!
+
           ! On condense l'eau liquide si besoin.
           ! En fait on arrive ici d'habitude (jusque 6A) après réévaporation
@@ -280,19 +278,18 @@
 !------------------------------------------------------------------------
 !                       --------------------
-!
-!
+
+
 !                       + + + + + + + + + + +
-!
-!
+
+
 !  wa, fraca, wd, fracd --------------------   zlev(2), rhobarz
 !  wh,wt,wo ...
-!
+
 !                       + + + + + + + + + + +  zh,zu,zv,z_o,rho
-!
-!
+
+
 !                       --------------------   zlev(1)
 !                       \\\\\\\\\\\\\\\\\\\\
-!
-!
+
 
 !-----------------------------------------------------------------------
@@ -328,5 +325,5 @@
 
 !------------------------------------------------------------------
-!
+
 !             /|\
 !    --------  |  F_k+1 -------   
@@ -336,11 +333,11 @@
 !                              ----> D_k-1
 !                              <---- E_k-1 , A_k-1
-!
-!
-!
-!
-!
+
+
+
+
+
 !    ---------------------------
-!
+
 !    ----- F_lmax+1=0 ----------         \
 !            lmax     (zmax)              |
@@ -370,9 +367,9 @@
 !    lmin  (=1 pour le moment)     |      |
 !    ----- F_lmin=0 ------------  /      /
-!
+
 !    ---------------------------
 !    //////////////////////////
-!
-!
+
+
 !=============================================================================
 !  Calculs initiaux ne faisant pas intervenir les changements de phase
@@ -384,5 +381,5 @@
 !  2. lmin et lalim sont les indices inferieurs et superieurs de alim_star
 !------------------------------------------------------------------
-!
+
       entr_star=0. ; detr_star=0. ; alim_star=0. ; alim_star_tot=0.
       lmin=1
@@ -397,5 +394,5 @@
 !calcul du melange et des variables dans le thermique
 !--------------------------------------------------------------------------------
-!
+
       if (prt_level>=1) print*,'avant thermcell_plume ',lev_out
 
@@ -455,5 +452,5 @@
 ! Calcul des caracteristiques du thermique:zmax,zmix,wmax
 !-------------------------------------------------------------------------------
-!
+
       CALL thermcell_height(ngrid,nlay,lalim,lmin,linter,lcong,lintercong,lmix,zw2,  &
              zlev,lmax,zmax,zmax0,zmix,wmax,zcong)
@@ -478,6 +475,6 @@
 ! Fermeture,determination de f
 !-------------------------------------------------------------------------------
-!
-!
+
+
       CALL thermcell_dry(ngrid,nlay,zlev,pphi,ztv,alim_star,  &
                         lalim,lmin,zmax_sec,wmax_sec)
@@ -504,5 +501,5 @@
       alim_star_clos(:,:)=alim_star(:,:)
       alim_star_clos(:,:)=entr_star(:,:)+alim_star(:,:)
-!
+
 !CR Appel de la fermeture seche 
       if (iflag_thermals_closure==1) then
@@ -762,5 +759,5 @@
             zf=fraca(ig,l)
             zf2=zf/(1.-zf)
-!
+
             thetath2(ig,l)=zf2*(ztla(ig,l)-zthl(ig,l))**2
             if(zw2(ig,l)>1.e-10) then
@@ -879,9 +876,9 @@
 
 !=======================================================================
-!
+
 !   Calcul du transport verticale dans la couche limite en presence
 !   de "thermiques" explicitement representes
 !   calcul du dq/dt une fois qu'on connait les ascendances
-!
+
 !=======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_plume.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_plume.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_plume.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE lmdz_thermcell_plume
-!
+
 ! $Id: thermcell_plume.F90 3074 2017-11-15 13:31:44Z fhourdin $
-!
+
 CONTAINS
 
@@ -13,5 +13,5 @@
 !--------------------------------------------------------------------------
 ! Auhtors : Catherine Rio, Frédéric Hourdin, Arnaud Jam
-!
+
 !thermcell_plume: calcule les valeurs de qt, thetal et w dans l ascendance
 !   This versions starts from a cleaning of thermcell_plume_6A (2019/01/20)
@@ -188,5 +188,4 @@
     endif
 enddo
-!
 
 !==============================================================================
@@ -376,5 +375,5 @@
 
    if (prt_level>=20) print*,'coucou calcul detr 460: ig, l',ig, l
-!
+
 !===========================================================================
 ! 6. initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_plume_6A.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_plume_6A.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_plume_6A.F90	(revision 5099)
@@ -1,6 +1,6 @@
 MODULE lmdz_thermcell_plume_6A
-!
+
 ! $Id$
-!
+
 CONTAINS
 
@@ -186,5 +186,4 @@
     endif
 enddo
-!
 
 !==============================================================================
@@ -622,5 +621,5 @@
 
         if (prt_level>=20) print*,'coucou calcul detr 460: ig, l',ig, l
-!
+
 !===========================================================================
 ! 6. initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max 
@@ -899,5 +898,4 @@
     endif
 enddo
-!
 
 !==============================================================================
@@ -1041,5 +1039,5 @@
 
         if (prt_level>=20) print*,'coucou calcul detr 460: ig, l',ig, l
-!
+
 !---------------------------------------------------------------------------
 !initialisations pour le calcul de la hauteur du thermique, de l'inversion et de la vitesse verticale max 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake.F90	(revision 5099)
@@ -152,5 +152,4 @@
   REAL, DIMENSION (klon),           INTENT(IN)          :: Cin
 
-  !
   ! Input/Output
   ! State variables
@@ -346,10 +345,10 @@
   ! alpk = 0.5
   ! alpk = 0.05
-!
+
  igout = klon/2+1/klon
-!
+
 !   sub-time-stepping parameters
   dtimesub = dtime/wk_nsub
-!
+
 IF (first_call) THEN
 !!#define IOPHYS_WK
@@ -376,5 +375,5 @@
   !>jyg
  ENDIF  ! (iflag_wk_pop_dyn == 0)
-!
+
  IF (iflag_wk_pop_dyn >=1) THEN
    IF (iflag_wk_pop_dyn == 3) THEN
@@ -444,5 +443,5 @@
       d_asig_bnd2(:) = 0.
       d_asigmaw2(:) = 0.
-!
+
       d_dens_gen2(:)   = 0.
       d_dens_death2(:) = 0.
@@ -468,5 +467,5 @@
    asigmaw_in(:) = asigmaw(:)
 !>jyg
-!
+
   IF (iflag_wk_pop_dyn >= 1) THEN
     awdens_in(:) = awdens(:)
@@ -521,5 +520,5 @@
     END DO
   ENDIF  ! (iflag_wk_pop_dyn >= 1)
-!
+
   DO i = 1, klon
     sigmaw_targ = min(max(sigmaw(i), sigmad),0.99)
@@ -528,5 +527,5 @@
     sigmaw(i) = sigmaw_targ
   END DO
-!
+
   IF (iflag_wk_pop_dyn == 3) THEN
      DO i = 1, klon  
@@ -547,5 +546,5 @@
   d_asigmaw(:) = 0.
   ktopw(:) = 0
-!
+
 !<jyg
 dth(:,:) = 0.
@@ -565,5 +564,5 @@
 cstar(:) = 0.
 ktopw(:) = 0
-!
+
 !  Vertical advection local variables
 omgbw(:,:) = 0.
@@ -573,5 +572,5 @@
 
 !>jyg
-!
+
   IF (prt_level>=10) THEN
     PRINT *, 'wake-1, sigmaw(igout) ', sigmaw(igout)
@@ -801,5 +800,5 @@
     ENDIF  !!  (wape(i)<0.)
   ENDDO
-  !
+
   IF (iflag_wk_pop_dyn == 3) THEN
     DO i = 1, klon
@@ -826,5 +825,4 @@
     END IF
   END DO
-  !
 
   ! Check qx and qw positivity
@@ -868,7 +866,7 @@
   ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   ! ------------------------------------------------------------------------
-  !
+
   DO isubstep = 1, wk_nsub
-  !
+
   ! ------------------------------------------------------------------------
     ! wk_adv is the logical flag enabling wake evolution in the time advance
@@ -977,5 +975,5 @@
 !!--------------------------------------------------------
     IF (iflag_wk_pop_dyn == 1) THEN
-  !
+
      CALL wake_popdyn_1 (klon, klev, dtime, cstar, tau_wk_inv, wgen, wdens, awdens, sigmaw, &
                   wdensmin, &
@@ -991,5 +989,5 @@
 !!--------------------------------------------------------
     ELSEIF (iflag_wk_pop_dyn == 2) THEN
-  !
+
      CALL wake_popdyn_2 ( klon, klev, wk_adv, dtimesub, wgen, &
                              wdensmin, &
@@ -1019,5 +1017,5 @@
     ENDIF
 #endif
-  !
+
      CALL wake_popdyn_3 ( klon, klev, phys_sub, wk_adv, dtimesub, wgen, &
                              wdensmin, &
@@ -1419,6 +1417,4 @@
           ! print*,'dtKE= ',dtKE(i,k),' dqKE= ',dqKE(i,k)
 
-!
-
           ! cc nrlmd          Prise en compte du taux de mortalite
           ! cc               Definitions de entr, detr
@@ -1495,5 +1491,5 @@
     CALL wake_vec_modulation(klon, klev, wk_adv, epsilon_loc, qb, d_qb, deltaqw, &
       d_deltaqw, sigmaw, d_sigmaw, alpha)
-    !
+
     ! Alpha_tot = Product of all the alpha's
     DO i = 1, klon
@@ -1555,5 +1551,5 @@
       END DO
     END DO
-!
+
     DO i = 1, klon
       IF (wk_adv(i)) THEN
@@ -1622,5 +1618,5 @@
         END IF
       END DO
-!
+
       IF (iflag_wk_pop_dyn >= 2) THEN
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! awdens again for iflag_wk_pop_dyn >= 2!!!!!!
@@ -1642,5 +1638,5 @@
            END IF
         END DO
-!
+
         IF (iflag_wk_pop_dyn == 3) THEN
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! asigmaw for iflag_wk_pop_dyn = 3!!!!!!
@@ -1675,5 +1671,5 @@
      CALL iophys_ecrit('sigmawb',1,'sigmawb','m',sigmaw)
      CALL iophys_ecrit('asigmawb',1,'asigmawb','m',asigmaw)
-!
+
      call iophys_ecrit('d_wdens2',1,'d_wdens2','',d_wdens2)
      call iophys_ecrit('d_dens_gen2',1,'d_dens_gen2','',d_dens_gen2)
@@ -1681,5 +1677,5 @@
      call iophys_ecrit('d_dens_col2',1,'d_dens_col2','',d_dens_col2)
      call iophys_ecrit('d_dens_bnd2',1,'d_dens_bnd2','',d_dens_bnd2)
-!
+
      call iophys_ecrit('d_awdens2',1,'d_awdens2','',d_awdens2)
      call iophys_ecrit('d_adens_death2',1,'d_adens_death2','',d_adens_death2)
@@ -1687,5 +1683,5 @@
      call iophys_ecrit('d_adens_acol2',1,'d_adens_acol2','',d_adens_acol2)
      call iophys_ecrit('d_adens_bnd2',1,'d_adens_bnd2','',d_adens_bnd2)
-!
+
      CALL iophys_ecrit('d_sigmaw2',1,'d_sigmaw2','',d_sigmaw2)
      CALL iophys_ecrit('d_sig_gen2',1,'d_sig_gen2','m',d_sig_gen2)
@@ -1694,5 +1690,5 @@
      CALL iophys_ecrit('d_sig_death2',1,'d_sig_death2','',d_sig_death2)
      CALL iophys_ecrit('d_sig_bnd2',1,'d_sig_bnd2','',d_sig_bnd2)
-!
+
      CALL iophys_ecrit('d_asigmaw2',1,'d_asigmaw2','',d_asigmaw2)
      CALL iophys_ecrit('d_asig_spread2',1,'d_asig_spread2','m',d_asig_spread2)
@@ -1843,5 +1839,5 @@
           d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i)
           sigmaw(i) = sigmaw_targ
-!
+
           d_asig_bnd2(i) = d_asig_bnd2(i) + sigmaw_targ - asigmaw(i)
           d_asigmaw2(i) = d_asigmaw2(i) + sigmaw_targ - asigmaw(i)
@@ -1856,13 +1852,12 @@
       END IF
     END DO
-  !
+
   ! ------------------------------------------------------------------------
-  !
+
   END DO   ! isubstep end sub-timestep loop
-  !
+
   ! ------------------------------------------------------------------------
   ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   ! ------------------------------------------------------------------------
-  !
 
 #ifdef IOPHYS_WK
@@ -1969,5 +1964,5 @@
           sum_dtdwn(i) = sum_dtdwn(i) + dtdwn(i, k)*dz(i)
           sum_dqdwn(i) = sum_dqdwn(i) + dqdwn(i, k)*dz(i)
-!
+
           dthmin(i) = min(dthmin(i), dth(i,k))
         END IF
@@ -2075,5 +2070,5 @@
       d_sigmaw2(i) = d_sigmaw2(i) + sigmaw_targ - sigmaw(i)
       sigmaw(i) = sigmaw_targ
-!
+
       d_asig_bnd2(i) = d_asig_bnd2(i) + sigmaw_targ - asigmaw(i)
       d_asigmaw2(i) = d_asigmaw2(i) + sigmaw_targ - asigmaw(i)
@@ -2132,9 +2127,9 @@
        CALL iophys_ecrit('sigmaw',1,'sigmaw','m',sigmaw)
        CALL iophys_ecrit('asigmaw',1,'asigmaw','m',asigmaw)
-!   
+
        CALL iophys_ecrit('rad_wk',1,'rad_wk','J/kg',rad_wk)
        CALL iophys_ecrit('arad_wk',1,'arad_wk','J/kg',arad_wk)
        CALL iophys_ecrit('irad_wk',1,'irad_wk','J/kg',irad_wk)
-!   
+
        call iophys_ecrit('d_wdens2',1,'d_wdens2','',d_wdens2)
        call iophys_ecrit('d_dens_gen2',1,'d_dens_gen2','',d_dens_gen2)
@@ -2142,5 +2137,5 @@
        call iophys_ecrit('d_dens_col2',1,'d_dens_col2','',d_dens_col2)
        call iophys_ecrit('d_dens_bnd2',1,'d_dens_bnd2','',d_dens_bnd2)
-!   
+
        call iophys_ecrit('d_awdens2',1,'d_awdens2','',d_awdens2)
        call iophys_ecrit('d_adens_death2',1,'d_adens_death2','',d_adens_death2)
@@ -2148,5 +2143,5 @@
        call iophys_ecrit('d_adens_acol2',1,'d_adens_acol2','',d_adens_acol2)
        call iophys_ecrit('d_adens_bnd2',1,'d_adens_bnd2','',d_adens_bnd2)
-!   
+
        CALL iophys_ecrit('d_sigmaw2',1,'d_sigmaw2','',d_sigmaw2)
        CALL iophys_ecrit('d_sig_gen2',1,'d_sig_gen2','m',d_sig_gen2)
@@ -2155,5 +2150,5 @@
        CALL iophys_ecrit('d_sig_death2',1,'d_sig_death2','',d_sig_death2)
        CALL iophys_ecrit('d_sig_bnd2',1,'d_sig_bnd2','',d_sig_bnd2)
-!   
+
        CALL iophys_ecrit('d_asigmaw2',1,'d_asigmaw2','',d_asigmaw2)
        CALL iophys_ecrit('d_asig_spread2',1,'d_asig_spread2','m',d_asig_spread2)
@@ -2218,5 +2213,5 @@
       hw(i) = 0.                            !jyg
       fip(i) = 0.
-!
+
 !!      sigmaw(i) = 0.                        !jyg
       sigmaw_targ = 0.
@@ -2225,5 +2220,5 @@
       d_sigmaw2(i) = sigmaw_targ - sigmaw_in(i)      ! _in = correction jyg 20220124
       sigmaw(i) = sigmaw_targ
-!
+
       IF (iflag_wk_pop_dyn >= 3) THEN
         sigmaw_targ = 0.
@@ -2235,5 +2230,5 @@
         asigmaw(i) = 0.
       ENDIF ! (iflag_wk_pop_dyn >= 3)
-!
+
       IF (iflag_wk_pop_dyn >= 1) THEN
 !!        awdens(i) = 0.
@@ -2305,5 +2300,5 @@
       d_sig_bnd2(i) = d_sig_bnd2(i)/dtime
       d_sigmaw2(i) = d_sigmaw2(i)/dtime
-!
+
       d_dens_gen2(i) = d_dens_gen2(i)/dtime
       d_dens_death2(i) = d_dens_death2(i)/dtime
@@ -2846,7 +2841,4 @@
   INTEGER,                          INTENT(IN)          :: iflag_wk_act
 
-  
-  !
- 
   ! Tendencies of state variables (2 is appended to the names of fields which are the cumul of fields 
   !                                 computed at each sub-timestep; e.g. d_wdens2 is the cumul of d_wdens)
@@ -2925,5 +2917,5 @@
 !!                         2.*wdens(i)*gfl(i)*drdt_pos )*dtimesub
 !>jyg+mlt
-!
+
 !jyg<
           d_wdens_targ = max(d_wdens(i), wdensmin-wdens(i))
@@ -2951,5 +2943,5 @@
           d_sigmaw(i) =  d_sig_gen(i) + d_sig_death(i) + d_sig_col(i) + d_sig_spread(i)
 !>jyg+mlt
-!
+
 !jyg<
           d_sigmaw_targ = max(d_sigmaw(i), sigmad-sigmaw(i))
@@ -3010,5 +3002,4 @@
   REAL, DIMENSION (klon),           INTENT(IN)          :: cin, wape  ! RM : A Faire disparaitre
 
-!  
   REAL, DIMENSION (klon),           INTENT(OUT)         :: rad_wk    !! r = wake radius
   REAL, DIMENSION (klon),           INTENT(OUT)         :: gfl       !! Lg = gust front lenght per unit area
@@ -3062,5 +3053,5 @@
           d_sig_col(i) = - cont_fact(i)*(wdens(i)-awdens(i))**2*(2.*sigmaw(i)/wdens(i)-aa0)
           d_sig_spread(i) = gfl(i)*cstar(i)
-!
+
           d_sig_gen(i) =  d_sig_gen(i)*dtimesub
           d_sig_death(i) = d_sig_death(i)*dtimesub
@@ -3081,5 +3072,5 @@
           d_dens_death(i) = - (wdens(i)-awdens(i))*tau_wk_inv_min 
           d_dens_col(i) =  - cont_fact(i)*wdens(i)**2
-! 
+
           d_dens_gen(i) =  d_dens_gen(i)*dtimesub
           d_dens_death(i) = d_dens_death(i)*dtimesub
@@ -3091,5 +3082,5 @@
           d_adens_icol(i) = cont_fact(i)*(wdens(i)-awdens(i))**2
           d_adens_acol(i) = - cont_fact(i)*awdens(i)**2
-!
+
           d_adens_death(i) =  d_adens_death(i)*dtimesub
           d_adens_icol(i) =   d_adens_icol(i)*dtimesub
@@ -3165,5 +3156,4 @@
   REAL, DIMENSION (klon),           INTENT(IN)          :: cin, wape  ! RM : A Faire disparaitre
 
-!  
   REAL, DIMENSION (klon),           INTENT(OUT)         :: rad_wk    !! r = mean wake radius
   REAL, DIMENSION (klon),           INTENT(OUT)         :: arad_wk    !! r_A = wake radius of active wakes
@@ -3222,14 +3212,14 @@
          iwdens(i) = wdens(i) - awdens(i)
          isigmaw(i) = sigmaw(i) - asigmaw(i)
-!
+
          arad_wk(i) = max( sqrt(asigmaw(i)/(3.14*awdens(i))) , rzero)
          irad_wk(i) = max( sqrt((sigmaw(i)-asigmaw(i))/  &
                            (3.14*max(smallestreal,(wdens(i)-awdens(i))))), rzero)
          rad_wk(i) = (awdens(i)*arad_wk(i)+(wdens(i)-awdens(i))*irad_wk(i))/wdens(i)
-!
+
          s_wk(i) = 3.14*rad_wk(i)**2
          as_wk(i) = 3.14*arad_wk(i)**2
          is_wk(i) = 3.14*irad_wk(i)**2
-!
+
          gfl(i)  = 2.*sqrt(3.14*wdens(i)*sigmaw(i))
          agfl(i) = 2.*sqrt(3.14*awdens(i)*asigmaw(i))
@@ -3249,5 +3239,5 @@
           d_sig_col(i) = - 2.*igfl(i)*cstar(i)*iwdens(i)*(2.*is_wk(i)-aa0)
           d_sig_spread(i) = gfl(i)*cstar(i)
-!
+
           d_sig_gen(i) =  d_sig_gen(i)*dtimesub
           d_sig_death(i) = d_sig_death(i)*dtimesub
@@ -3281,5 +3271,5 @@
           d_asig_iicol(i) = 2.*igfl(i)*cstar(i)*iwdens(i)*aa0
           d_asig_spread(i) = agfl(i)*cstar(i)
-!
+
           d_asig_death(i) = d_asig_death(i)*dtimesub
           d_asig_aicol(i) =  d_asig_aicol(i)*dtimesub 
@@ -3308,5 +3298,5 @@
           d_dens_death(i) = - iwdens(i)*tau_wk_inv_min 
           d_dens_col(i) =  - 2.*gfl(i)*cstar(i)*wdens(i)
-! 
+
           d_dens_gen(i) =  d_dens_gen(i)*dtimesub
           d_dens_death(i) = d_dens_death(i)*dtimesub
@@ -3330,5 +3320,5 @@
           d_adens_icol(i) =   2.*igfl(i)*cstar(i)*iwdens(i)
           d_adens_acol(i)  = - 2.*agfl(i)*cstar(i)*awdens(i)
-!
+
           d_adens_death(i) =  d_adens_death(i)*dtimesub
           d_adens_icol(i) =   d_adens_icol(i)*dtimesub
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake_ini.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake_ini.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_wake_ini.F90	(revision 5099)
@@ -108,13 +108,13 @@
 
   smallestreal=tiny(smallestreal)
-!
+
   prt_level=prt_lev
   epsilon_loc=1.E-15
   wapecut=1. ! previously 5.
-!
+
   rzero = 5000.
   CALL getin_p('rzero_wk', rzero)
   aa0 = 3.14*rzero*rzero
-! 
+
   ! Essais d'initialisation avec sigmaw = 0.02 et hw = 10.
 !!  sigmad=0.005
@@ -122,10 +122,10 @@
   CALL getin_p('sigmad', sigmad)
   hwmin=10.
-!
+
 !!wdensthreshold=1.e-12
   wdensthreshold=1.e-14
   wdensthreshold=2.e-14
   CALL getin_p('wdensthreshold', wdensthreshold)
-!
+
   IF (sigmad < 0.) THEN
     sigmad = abs(sigmad)
@@ -135,6 +135,6 @@
     wdensinit = wdensthreshold/2.
   ENDIF
-!
-!
+
+
   ! cc nrlmd
   sigmaw_max=0.4
@@ -211,5 +211,5 @@
   CALL getin_p('wdens_ref_l',wdens_ref(2))    !wake number per unit area ; land
 !>jyg
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !!!!!!!!!  Population dynamics parameters    !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_yoerad.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_yoerad.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_yoerad.f90	(revision 5099)
@@ -0,0 +1,181 @@
+! Copied from rrtm/yoerad.F90 to allow compilation of StratAer blocks
+
+MODULE lmdz_yoerad
+
+  IMPLICIT NONE
+
+  SAVE
+
+  !     ------------------------------------------------------------------
+  !*    ** *YOERAD* - CONTROL OPTIONS FOR RADIATION CONFIGURATION
+  !     ------------------------------------------------------------------
+
+  INTEGER :: NAER
+  INTEGER :: NMODE
+  INTEGER :: NOZOCL
+  INTEGER :: NRADFR
+  INTEGER :: NRADPFR
+  INTEGER :: NRADPLA
+  INTEGER :: NRINT
+  INTEGER :: NRADINT
+  INTEGER :: NRADRES
+  INTEGER :: NRADNFR
+  INTEGER :: NRADSFR
+  INTEGER :: NOVLP
+  INTEGER :: NRPROMA
+  INTEGER :: NLW
+  !INTEGER :: NSW  mis dans .def MPL 20140211
+  INTEGER :: NSWNL
+  INTEGER :: NSWTL
+  INTEGER :: NTSW
+  INTEGER :: NUV
+  INTEGER :: NCSRADF
+  INTEGER :: NICEOPT
+  INTEGER :: NLIQOPT
+  INTEGER :: NRADIP
+  INTEGER :: NRADLP
+  INTEGER :: NINHOM
+  INTEGER :: NLAYINH
+  INTEGER :: NLNGR1H
+  INTEGER :: NPERTAER
+  INTEGER :: NPERTOZ
+  INTEGER :: NSCEN
+  INTEGER :: NHINCSOL
+  INTEGER :: NMCICA
+
+  LOGICAL :: LERAD1H
+  LOGICAL :: LERADHS
+  LOGICAL :: LEPO3RA
+  LOGICAL :: LRADLB
+  LOGICAL :: LONEWSW
+  LOGICAL :: LECSRAD
+  LOGICAL :: LRRTM
+  LOGICAL :: LSRTM
+  LOGICAL :: LDIFFC
+  LOGICAL :: LHVOLCA
+  LOGICAL :: LNEWAER
+  LOGICAL :: LNOTROAER
+  LOGICAL :: LRAYL
+  LOGICAL :: LOPTRPROMA
+  LOGICAL :: LECO2VAR
+  LOGICAL :: LHGHG
+
+  CHARACTER (LEN = 256) :: CRTABLEDIR
+  CHARACTER (LEN = 32) :: CRTABLEFIL
+  LOGICAL :: LCCNL
+  LOGICAL :: LCCNO
+
+  REAL :: RAOVLP, RBOVLP
+  REAL :: RCCNLND, RCCNSEA
+  LOGICAL :: LEDBUG
+  REAL :: RPERTOZ, RRe2De
+  REAL :: RLWINHF, RSWINHF
+
+  !        * E.C.M.W.F. PHYSICS PACKAGE *
+
+  !     J.-J. MORCRETTE       E.C.M.W.F.      89/07/14
+
+  !  NAME     TYPE     PURPOSE
+  !  ----  :  ----   : ---------------------------------------------------
+  ! LERAD1H: LOGICAL : .T. TO ALLOW MORE FREQUENT RADIATION CALCULATIONS
+  !                  : DURING FIRST N HOURS OF FORECAST
+  ! NLNGR1H: INTEGER : NUMBER FORECAST HOURS DURING WHICH MORE FREQUENT
+  !                    RADIATION CALCULATIONS ARE REQUIRED
+  ! LERADHS: LOGICAL : .T. IF RAD.COMPUTED ON A COARSER SAMPLED GRID
+  ! LEPO3RA: LOGICAL : .T. IF PROGNOSTIC OZONE (EC) IS PASSED TO RADIATION
+  ! NAER   : INTEGER : CONFIGURATION INDEX FOR AEROSOLS
+  ! NMODE  : INTEGER : CONFIGURATION FOR RADIATION CODE: FLUX VS. RADIANCE
+  ! NOZOCL : INTEGER : CHOICE OF OZONE CLIMATOLOGY (0 old, 1 new)
+  ! NRADFR : INTEGER : FREQUENCY OF FULL RADIATION COMPUTATIONS
+  !                    IF(NRADFR.GT.0): RAD EVERY 'NRADFR' TIME-STEPS
+  !                    IF(NRADFR.LT.0): RAD EVERY '-NRADFR' HOURS
+  ! NRADPFR: INTEGER : PRINT FREQUENCY FOR RAD.STATISTICS (in RAD.T.STEPS)
+  ! NRADPLA: INTEGER : PRINT RAD.STATISTICS EVERY 'NRADPLA' ROWS
+  ! NRINT  : INTEGER : INTERPOLATION DISTANCE (in points)
+  ! NRADINT: INTEGER : RADIATION INTERPOLATION METHOD
+  !                  : 0 = CURRENT RADIATION INTERPOLATION (CONTROLLED BY NRINT)
+  !                  : 1 = SPECTRAL TRANSFORM INTERPOLATION
+  !                  : 2 =  4 POINT HORIZONTAL INTERPOLATION
+  !                  : 3 = 12 POINT HORIZONTAL INTERPOLATION
+  ! NRADRES: INTEGER : RADIATION GRID SPECTRAL RESOLUTION
+  ! NRADNFR: INTEGER : NORMAL   FREQUENCY OF RADIATION STEPS
+  ! NRADSFR: INTEGER : START-UP FREQUENCY OF RADIATION STEPS
+  ! NOVLP  : INTEGER : CLOUD OVERLAP CONFIGURATION
+  ! NRPROMA: INTEGER : VECTOR LENGTH FOR RADIATION CALCULATIONS
+  ! NLW    : INTEGER : NUMBER OF LONGWAVE SPECTRAL INTERVALS
+  ! NSW    : INTEGER : NUMBER OF SHORTWAVE SPECTRAL INTERVALS
+  ! NSWNL  : INTEGER : NUMBER OF SHORTWAVE SPECTRAL INTERVALS IN NL MODEL
+  ! NSWTL  : INTEGER : NUMBER OF SHORTWAVE SPECTRAL INTERVALS IN TL MODEL
+  ! NTSW   : INTEGER : MAXIMUM POSSIBLE NUMBER OF SW SPECTRAL INTERVALS
+  ! NUV    : INTEGER : NUMBER OF UV SPECTRAL INTERVALS FOR THE UV PROCESSOR
+  ! LRADLB : LOGICAL : .T. IF RADIATION COURSER GRID IS TO BE LOAD BALANCED
+  !                  : OVER PROCESSORS (I.E. WHEN NRINT>1)
+  ! LOPTRPROMA:LOGICAL: .T. NRPROMA will be optimised
+  !                   : .F. NRPROMA will not be optimised (forced
+  !                   :         by negative NRPROMA in namelist)
+
+  ! NRADIP : INTEGER : INDEX FOR DIAGNOSIS OF ICE CLOUD EFFECTIVE RADIUS
+  !          0=EbCu/SmSh  1=EbCu/EbCu  2=FuLi/FuLi  3=Fu/Fu&al
+  ! NRADLP : INTEGER : INDEX FOR DIAGNOSIS OF LIQ. CLOUD EFFECTIVE RADIUS
+  !          0=YF/SmSh    1=ASl/HSa    2=ASl/LiLi
+  ! NICEOPT: INTEGER : INDEX FOR ICE CLOUD OPTICAL PROPERTIES
+  !          0=40u        1=40-130     2=30-60      3=Sun'01
+  ! NLIQOPT: INTEGER : INDEX FOR LIQUID WATER CLOUD OPTICAL PROPERTIES
+  !          0=f(P)       1=10/13      2=Martin_et_al
+
+  ! LONEWSW: LOGICAL : .T. IF NEW SW CODE IS ACTIVE
+  ! LECSRAD: LOGICAL : .T. IF CLEAR-SKY RADIATION IS ARCHIVED AS PEXTR2
+  ! NCSRADF: INTEGER : 1 IF ACCUMULATED, 2 IF INSTANTANEOUS
+  ! LRRTM  : LOGICAL : .T. IF RRTM140MR IS USED FOR LW RADIATION TRANSFER
+
+  ! LHVOLCA: LOGICAL : .T. IF GISS HISTORY OF VOLCANIC AEROSOLS IS ON
+  ! LNEWAER: LOGICAL : .T. IF AEROSOL MONTHLY DISTRIBUTIONS ARE USED
+  ! LNOTROAER:LOGICAL: .T. IF NO TROPOSPHERIC AEROSOLS
+  ! CRTABLEDIR: CHAR : IF NRADINT > 0 SPECIFIES DIRECTORY PATH FOR RADIATION
+  !                  : GRID RTABLE NAMELIST
+  ! CRTABLEFIL: CHAR : IF NRADINT > 0 SPECIFIES FILE NAME OF RADIATION
+  !                  : GRID RTABLE NAMELIST
+  ! LRAYL  : LOGICAL : .T. NEW RAYLEIGH FOR SW-6 VERSION
+
+  ! RAOVLP : REAL    : COEFFICIENTS FOR ALPHA1 FACTOR IN HOGAN &
+  ! RBOVLP : REAL    : ILLINGWORTH's PARAMETRIZATION
+
+  ! LCCNL  : LOGICAL : .T. IF CCN CONCENTRATION OVER LAND IS DIAGNOSED
+  ! LCCNO  : LOGICAL : .T. IF CCN CONCENTRATION OVER OCEAN IS DIAGNOSED
+  ! RCCNLND: REAL    : NUMBER CONCENTRATION (CM-3) OF CCNs OVER LAND
+  ! RCCNSEA: REAL    : NUMBER CONCENTRATION (CM-3) OF CCNs OVER SEA
+
+  ! LDIFFC : LOGICAL : .T. IF SAVIJARVI'S DIFFUSIVITY CORRECTION IS ON
+
+  ! NINHOM : INTEGER : 0 IF NO INHOMOGENEITY SCALING EFFECT
+  !                    1 IF SIMPLE 0.7 SCALING
+  !                    2 IF BARKER, 3 IF CAIRNS ET AL.
+  ! RLWINHF: REAL    : INHOMOG. SCALING FACTOR FOR CLOUD LW OPTICAL THICKNESS
+  ! RSWINHF: REAL    : INHOMOG. SCALING FACTOR FOR CLOUD SW OPTICAL THICKNESS
+
+  ! NPERTAER : INTERGER : PERCENTAGE OF PERTURBATION FOR AEROSOL
+  ! NPERTOZONE : INTEGER : PERCENTAGE OF PERTURBATION FOR OZONE
+  ! NHINCSOL:INTEGER :
+  !        = 0 NO VARIABILITY OF SOLAR CONSTANT IS ACCOUNTED FOR
+  !        = 1 IF YEAR-TO-YEAR VARIABILITY OF SOLAR CONSTANT IS ACCOUNTED FOR
+  !        = 2 IF MONTH-TO-MONTH VARIABILITY OF SOLAR CONSTANT IS ACCOUNTED FOR
+  ! LECO2VAR: LOGICAL: .T. IF ERA-40/AMIP2 VARIABILITY OF GHG IS ON
+  ! LHGHG  : LOGICAL : .T. IF VARIABILITY OF GREENHOUSE GASES (INCLUDING CO2) IS ON
+  ! N.B.: LHGHG supercedes LECO2VAR and allows using better specification of trace gases
+  ! NSCEN  : INTEGER : 21st CENTURY SCENARIO FOR GHG (1=A1B, 2=A2, 3=B1)
+  ! RRe2De : REAL    : CONVERSION FACTOR BETWWEN EFFECTIVE RADIUS AND PARTICLE SIZE
+  !                    FOR ICE
+  ! NMCICA : INTEGER :  0: NO McICA
+  !                     1: McICA w maximum-random in cloud generator
+  !                     2: McICA w generalized overlap in cloud generator
+  !     ------------------------------------------------------------------
+
+  !$OMP THREADPRIVATE(crtabledir,crtablefil,lccnl,lccno,ldiffc,leco2var,lecsrad)
+  !$OMP THREADPRIVATE(ledbug,lepo3ra,lerad1h,leradhs,lhghg,lhvolca,lnewaer,lnotroaer)
+  !$OMP THREADPRIVATE(lonewsw,loptrproma,lradlb,lrayl,lrrtm,lsrtm,naer,ncsradf,nhincsol)
+  !$OMP THREADPRIVATE(niceopt,ninhom,nlayinh,nliqopt,nlngr1h,nlw,nmcica,nmode,novlp,nozocl)
+  !$OMP THREADPRIVATE(npertaer,npertoz,nradfr,nradint,nradip,nradlp,nradnfr,nradpfr,nradpla)
+  !$OMP THREADPRIVATE(nradres,nradsfr,nrint,nrproma,nscen,nswnl,nswtl,ntsw,nuv,raovlp)
+  !$OMP THREADPRIVATE(rbovlp,rccnlnd,rccnsea,rlwinhf,rpertoz,rre2de,rswinhf)
+
+END MODULE lmdz_yoerad
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lsc_scav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lsc_scav.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lsc_scav.F90	(revision 5099)
@@ -51,5 +51,5 @@
  LOGICAL,SAVE :: debut=.TRUE.
 !$OMP THREADPRIVATE(debut)
-!
+
   REAL,PARAMETER :: henry=1.4  ! constante de Henry en mol/l/atm ~1.4 for gases
   REAL           :: henry_t    !  constante de Henry a T t  (mol/l/atm)
@@ -88,8 +88,8 @@
   REAL           :: pr, ps, ice, water
 !  REAL :: conserv
-!
-!
+
+
   IF (debut) THEN
-!
+
       alpha_r=0.001        !  coefficient d'impaction pour la pluie
       alpha_s=0.01         !  coefficient d'impaction pour la neige  
@@ -101,5 +101,5 @@
       frac_aer=0.5
       debut=.FALSE.
-!
+
       OPEN(99,file='lsc_scav_param.data',status='old', &
                 form='formatted',err=9999)
@@ -122,8 +122,8 @@
    print*,'frac_coar_scav',frac_coar_scav
    print*,'frac_aer ev',frac_aer
-!
+
   ENDIF !(debut)
 !!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
+
 ! initialization
   dxin=0.
@@ -160,5 +160,5 @@
       frac_ev=frac_gas
   ENDIF
-!
+
 !jyg<
   IF (aerosol(it)) THEN ! aerosol
@@ -189,5 +189,5 @@
       ENDIF ! (iflag_lscav .eq. 4)
       beta_v1(i,k)=beta    !! for output
-!
+
       dxin=tr_seri(i,k,it)*(exp(-scav(i,k)*beta*pdtime)-1.)
       his_dh(i)=his_dh(i)-dxin*zmass(i,k)/pdtime !  kg/m2/s
@@ -230,5 +230,5 @@
         his_dh(i)=0.
       ENDIF
-!
+
 !      print*,  k, 'beta_ev',beta_ev
 ! remove tracers from precipitation owing to release by evaporation in his_dh
@@ -238,12 +238,12 @@
 
       d_tr_evap(i,k,it)=dxev       !  kg/kg/timestep
-!
+
     ENDDO
   ENDDO
-!
+
   DO i = 1,klon
      qPrls(i,it) = his_dh(i)/max(flxr(i,1)+flxs(i,1),1.e-16)
   ENDDO
-!
+
 ! test de conservation
 !      conserv=0.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/macv2sp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/macv2sp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/macv2sp.F90	(revision 5099)
@@ -1,4 +1,4 @@
 SUBROUTINE MACv2SP(pphis,pplay,paprs,xlon,xlat,tau_allaer,piz_allaer,cg_allaer)
-  !
+
   !--routine to read the MACv2SP plume and compute optical properties
   !--requires flag_aerosol = 7
@@ -7,10 +7,10 @@
   !--pre-ind aerosols (index=1) are not changed, present-day aerosols (index=2) are incremented
   !--uses model year so year_cur needs to be correct in the model simulation
-  !
+
   !--aod_prof = AOD per layer 
   !--ssa_prof = SSA 
   !--asy_prof = asymetry parameter
   !--dNovrN   = enhancement factor for CDNC
-  !
+
   USE mo_simple_plumes, ONLY: sp_aop_profile
   USE phys_cal_mod, ONLY : year_cur, day_cur, year_len
@@ -19,9 +19,9 @@
   USE phys_local_var_mod, ONLY: t_seri, od443aer, od550aer, od865aer, ec550aer, dryod550aer, od550lt1aer, dNovrN
   !!USE YOMCST, ONLY : RD, RG
-  !
+
   IMPLICIT NONE
-  !
+
   include "YOMCST.h"
-  ! 
+
   REAL,DIMENSION(klon),INTENT(IN)        :: pphis   ! Geopotentiel de surface
   REAL,DIMENSION(klon,klev),INTENT(IN)   :: pplay   ! pression pour le mileu de chaque couche (en Pa)
@@ -29,17 +29,17 @@
   REAL,DIMENSION(klon),INTENT(IN)        :: xlat    ! latitudes pour chaque point
   REAL,DIMENSION(klon),INTENT(IN)        :: xlon    ! longitudes pour chaque point
-  !
+
   REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(OUT) :: tau_allaer !  epaisseur optique aerosol
   REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(OUT) :: piz_allaer !  single scattering albedo aerosol
   REAL, DIMENSION(klon,klev,2,nbands_sw_rrtm), INTENT(OUT) :: cg_allaer  !  asymmetry parameter aerosol
-  !
+
   REAL,DIMENSION(klon,klev) :: aod_prof, ssa_prof, asy_prof
   REAL,DIMENSION(klon,klev) :: z, dz
   REAL,DIMENSION(klon)      :: oro, zrho, zt
-  !
+
   INTEGER, PARAMETER :: nmon = 12
-  !
+
   REAL, PARAMETER    :: l443 = 443.0, l550 = 550.0, l865 = 865.0 !--wavelengths in nm
-  !
+
   INTEGER, PARAMETER :: Nwvmax=25
   REAL, DIMENSION(0:Nwvmax), PARAMETER :: lambda=(/ 240.0, &  !--this one is for band 1
@@ -49,5 +49,5 @@
                  1100.0, 1190.0, 1280.0, 1530.0, 1640.0,   &
                  2130.0, 2380.0, 2910.0, 3420.0, 4000.0   /)
-  !
+
   REAL, DIMENSION(1:Nwvmax-1), PARAMETER :: weight =(/    &   !--and the weights to be given to the bands
                  0.01,  4.05,  9.51, 15.99, 26.07, 33.10, &   !--corresponding to a typical solar spectrum 
@@ -55,14 +55,14 @@
                 42.22, 40.12, 32.70, 14.44, 19.48, 14.23, &
                 13.43, 16.42,  8.33,  0.95,  0.65,  2.76  /)
-  !
+
   REAL :: zlambda, zweight
   REAL :: year_fr
-  !
+
   INTEGER band, i, k, Nwv
-  !
+
   ! define the height and dheight arrays
-  !
+
   oro(:)  = pphis(:)/RG                             ! surface height in m
-  !
+
   DO k = 1, klev
     zrho(:) = pplay(:,k)/t_seri(:,k)/RD                         ! air density in kg/m3
@@ -76,58 +76,58 @@
     ENDIF
   ENDDO
-  !
+
   !--fractional year
-  !
+
   year_fr = FLOAT(year_cur) + (FLOAT(day_cur)-0.5) / FLOAT(year_len)
   IF (year_fr<1850.0.OR.year_fr>=2017.0) THEN
      CALL abort_physic ('macv2sp','year not supported by plume model',1)
   ENDIF
-  !
+
   !--call to sp routine -- 443 nm
-  !
+
   CALL sp_aop_profile                                    ( &
        klev     ,klon ,l443 ,oro    ,xlon     ,xlat      , &
        year_fr  ,z    ,dz   ,dNovrN ,aod_prof ,ssa_prof  , &
        asy_prof )
-  !
+
   !--AOD calculations for diagnostics
   od443aer(:)= od443aer(:)+SUM(aod_prof(:,:),dim=2)
-  !
+
   !--call to sp routine -- 550 nm
-  !
+
   CALL sp_aop_profile                                    ( &
        klev     ,klon ,l550 ,oro    ,xlon     ,xlat      , &
        year_fr  ,z    ,dz   ,dNovrN ,aod_prof ,ssa_prof  , &
        asy_prof )
-  !
+
   !--AOD calculations for diagnostics
   od550aer(:)=od550aer(:)+SUM(aod_prof(:,:),dim=2)
-  !
+
   !--dry AOD calculation for diagnostics
   dryod550aer(:)=dryod550aer(:)+od550aer(:)
-  !
+
   !--fine-mode AOD calculation for diagnostics
   od550lt1aer(:)=od550lt1aer(:)+od550aer(:)
-  !
+
   !--extinction coefficient for diagnostic
   ec550aer(:,:)=ec550aer(:,:)+aod_prof(:,:)/dz(:,:)
-  !
+
   !--call to sp routine -- 865 nm
-  !
+
   CALL sp_aop_profile                                    ( &
        klev     ,klon ,l865 ,oro    ,xlon     ,xlat      , &
        year_fr  ,z    ,dz   ,dNovrN ,aod_prof ,ssa_prof  , &
        asy_prof )
-  !
+
   !--AOD calculations for diagnostics
   od865aer(:)=od865aer(:)+SUM(aod_prof(:,:),dim=2)
-  !
+
   !--re-weighting of piz and cg arrays before adding the anthropogenic aerosols
   !--index 2 = all natural + anthropogenic aerosols
   piz_allaer(:,:,2,:)=piz_allaer(:,:,2,:)*tau_allaer(:,:,2,:)
   cg_allaer(:,:,2,:) =cg_allaer(:,:,2,:)*piz_allaer(:,:,2,:)
-  !
+
   !--now computing the same at many wavelengths to fill the model bands
-  !
+
   DO Nwv=0,Nwvmax-1
 
@@ -157,20 +157,20 @@
       band=6
     ENDIF
-    !
+
     CALL sp_aop_profile                                       ( &
          klev     ,klon ,zlambda ,oro    ,xlon     ,xlat      , &
          year_fr  ,z    ,dz      ,dNovrN ,aod_prof ,ssa_prof  , &
          asy_prof )
-    !
+
     !--adding up the quantities tau, piz*tau and cg*piz*tau
     tau_allaer(:,:,2,band)=tau_allaer(:,:,2,band)+zweight*MAX(aod_prof(:,:),1.e-15)
     piz_allaer(:,:,2,band)=piz_allaer(:,:,2,band)+zweight*MAX(aod_prof(:,:),1.e-15)*ssa_prof(:,:)
     cg_allaer(:,:,2,band) =cg_allaer(:,:,2,band) +zweight*MAX(aod_prof(:,:),1.e-15)*ssa_prof(:,:)*asy_prof(:,:)
-    !
+
   ENDDO
-  !
+
   !--renpomalizing cg and piz now that MACv2SP increments have been added
   cg_allaer(:,:,2,:) =cg_allaer(:,:,2,:) /piz_allaer(:,:,2,:)
   piz_allaer(:,:,2,:)=piz_allaer(:,:,2,:)/tau_allaer(:,:,2,:)
-  !
+
 END SUBROUTINE MACv2SP
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/minmaxqfi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/minmaxqfi.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/minmaxqfi.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE minmaxqfi(zq,qmin,qmax,comment)
   USE dimphy
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/mo_simple_plumes.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/mo_simple_plumes.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/mo_simple_plumes.F90	(revision 5099)
@@ -21,5 +21,5 @@
 !! @par Copyright
 !! 
-!
+
 MODULE MO_SIMPLE_PLUMES
 
@@ -67,33 +67,33 @@
 
 CONTAINS
-  !
+
   ! ------------------------------------------------------------------------------------------------------------------------
   ! SP_SETUP:  This subroutine should be called at initialization to read the netcdf data that describes the simple plume
   ! climatology.  The information needs to be either read by each processor or distributed to processors.
-  !
+
   SUBROUTINE sp_setup
-    !
+
     USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root
     USE mod_phys_lmdz_omp_data, ONLY: is_omp_root
     USE mod_phys_lmdz_transfert_para, ONLY: bcast
-    !
-    ! ---------- 
-    !
+
+    ! ---------- 
+
     INTEGER :: iret, ncid, DimID, VarID, xdmy
     CHARACTER (len = 50)     :: modname = 'mo_simple_plumes.sp_setup'
     CHARACTER (len = 80)     :: abort_message
-    !
+
     ! ---------- 
     !--only one processor reads the input data
     IF (is_mpi_root.AND.is_omp_root) THEN
-       !    
+
        iret = nf90_open("MACv2.0-SP_v1.nc", NF90_NOWRITE, ncid)
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF File not opened'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        ! read dimensions and make sure file conforms to expected size
-       !
+
        iret = nf90_inq_dimid(ncid, "plume_number"  , DimId)
        iret = nf90_inquire_dimension(ncid, DimId, len = xdmy)
@@ -102,5 +102,5 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_dimid(ncid, "plume_feature", DimId)
        iret = nf90_inquire_dimension(ncid, DimId, len = xdmy)
@@ -109,5 +109,5 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_dimid(ncid, "year_fr"   , DimId)
        iret = nf90_inquire_dimension(ncid, DimID, len = xdmy)
@@ -116,5 +116,5 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_dimid(ncid, "years"   , DimId)
        iret = nf90_inquire_dimension(ncid, DimID, len = xdmy)
@@ -123,130 +123,130 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        ! read variables that define the simple plume climatology
-       !
+
        iret = nf90_inq_varid(ncid, "plume_lat", VarId)
        iret = nf90_get_var(ncid, VarID, plume_lat(:), start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading plume_lat'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "plume_lon", VarId)
        iret = nf90_get_var(ncid, VarID, plume_lon(:), start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading plume_lon'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "beta_a"   , VarId)
        iret = nf90_get_var(ncid, VarID, beta_a(:)   , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading beta_a'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "beta_b"   , VarId)
        iret = nf90_get_var(ncid, VarID, beta_b(:)   , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading beta_b'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "aod_spmx" , VarId)
        iret = nf90_get_var(ncid, VarID, aod_spmx(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading aod_spmx'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "aod_fmbg" , VarId)
        iret = nf90_get_var(ncid, VarID, aod_fmbg(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading aod_fmbg'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "ssa550"   , VarId)
        iret = nf90_get_var(ncid, VarID, ssa550(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading ssa550'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "asy550"   , VarId)
        iret = nf90_get_var(ncid, VarID, asy550(:)  , start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading asy550'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "angstrom" , VarId)
        iret = nf90_get_var(ncid, VarID, angstrom(:), start=(/1/),count=(/nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading angstrom'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "sig_lat_W"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lat_W(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading sig_lat_W'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "sig_lat_E"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lat_E(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading sig_lat_E'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "sig_lon_E"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lon_E(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading sig_lon_E'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "sig_lon_W"     , VarId)
        iret = nf90_get_var(ncid, VarID, sig_lon_W(:,:)    , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading sig_lon_W'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "theta"         , VarId)
        iret = nf90_get_var(ncid, VarID, theta(:,:)        , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading theta'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "ftr_weight"    , VarId)
        iret = nf90_get_var(ncid, VarID, ftr_weight(:,:)   , start=(/1,1/),count=(/nfeatures,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading plume_lat'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "year_weight"   , VarId)
        iret = nf90_get_var(ncid, VarID, year_weight(:,:)  , start=(/1,1/),count=(/nyears,nplumes   /))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading year_weight'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_inq_varid(ncid, "ann_cycle"     , VarId)
        iret = nf90_get_var(ncid, VarID, ann_cycle(:,:,:)  , start=(/1,1,1/),count=(/nfeatures,ntimes,nplumes/))
-       IF (iret /= NF90_NOERR) THEN
+       IF (iret /= nf90_noerr) THEN
           abort_message='NetCDF Error reading ann_cycle'
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        iret = nf90_close(ncid)
-       !
+
     ENDIF !--root processor
-    !
+
     CALL bcast(plume_lat)
     CALL bcast(plume_lon)
@@ -266,11 +266,11 @@
     CALL bcast(year_weight)
     CALL bcast(ann_cycle)
-    !
+
     sp_initialized = .TRUE.
-    !
+
     RETURN
-    !
+
   END SUBROUTINE sp_setup
-  !
+
   ! ------------------------------------------------------------------------------------------------------------------------
   ! SET_TIME_WEIGHT:  The simple plume model assumes that meteorology constrains plume shape and that only source strength
@@ -278,9 +278,9 @@
   ! for the plumes.  Each plume feature has its own temporal weights which varies yearly.  The annual cycle is indexed by
   ! week in the year and superimposed on the yearly mean value of the weight. 
-  !
+
   SUBROUTINE set_time_weight(year_fr)
-    !
-    ! ---------- 
-    !
+
+    ! ---------- 
+
     REAL, INTENT(IN) ::  &
          year_fr           !< Fractional Year (1850.0 - 2100.99)
@@ -290,7 +290,7 @@
          iweek          ,& !< Integer index (between 1 and ntimes); for ntimes=52 this corresponds to weeks (roughly)
          iplume            ! plume number
-    !
-    ! ---------- 
-    !
+
+    ! ---------- 
+
     iyear = FLOOR(year_fr) - 1849
     iweek = FLOOR((year_fr - FLOOR(year_fr)) * ntimes) + 1
@@ -309,17 +309,17 @@
     RETURN
   END SUBROUTINE set_time_weight
-  !
+
   ! ------------------------------------------------------------------------------------------------------------------------
   ! SP_AOP_PROFILE:  This subroutine calculates the simple plume aerosol and cloud active optical properties based on the
   ! the simple plume fit to the MPI Aerosol Climatology (Version 2).  It sums over nplumes to provide a profile of aerosol
   ! optical properties on a host models vertical grid. 
-  !
+
   SUBROUTINE sp_aop_profile                                                                           ( &
        nlevels        ,ncol           ,lambda         ,oro            ,lon            ,lat            , &
        year_fr        ,z              ,dz             ,dNovrN         ,aod_prof       ,ssa_prof       , &
        asy_prof       )
-    !
-    ! ---------- 
-    !
+
+    ! ---------- 
+
     INTEGER, INTENT(IN)        :: &
          nlevels,                 & !< number of levels
@@ -372,17 +372,17 @@
          aod_lmd,                  & !< aerosol optical depth at input wavelength
          lfactor                     !< factor to compute wavelength dependence of optical properties
-    !
-    ! ---------- 
-    !
+
+    ! ---------- 
+
     ! initialize input data (by calling setup at first instance) 
-    !
+
     IF (.NOT.sp_initialized) CALL sp_setup
-    !
+
     ! get time weights
-    !
+
     CALL set_time_weight(year_fr)
-    !
+
     ! initialize variables, including output
-    !
+
     DO k=1,nlevels
       DO icol=1,ncol
@@ -399,11 +399,11 @@
       caod_bg(icol)  = 0.02
     ENDDO
-    !
+
     ! sum contribution from plumes to construct composite profiles of aerosol optical properties
-    !
+
     DO iplume=1,nplumes
-      !
+
       ! calculate vertical distribution function from parameters of beta distribution
-      !
+
       DO icol=1,ncol
         beta_sum(icol) = 0.
@@ -420,11 +420,11 @@
         ENDDO
       ENDDO
-      !
+
       ! calculate plume weights
-      !
+
       DO icol=1,ncol
-        !
+
         ! get plume-center relative spatial parameters for specifying amplitude of plume at given lat and lon
-        !
+
         delta_lat   = lat(icol) - plume_lat(iplume)
         delta_lon   = lon(icol) - plume_lon(iplume)
@@ -436,15 +436,15 @@
         a_plume2  = 0.5 / (MERGE(sig_lon_E(2,iplume), sig_lon_W(2,iplume), delta_lon > 0)**2)
         b_plume2  = 0.5 / (MERGE(sig_lat_E(2,iplume), sig_lat_W(2,iplume), delta_lon > 0)**2)
-        !
+
         ! adjust for a plume specific rotation which helps match plume state to climatology.
-        !
+
         lon1 =   COS(theta(1,iplume))*(delta_lon) + SIN(theta(1,iplume))*(delta_lat)
         lat1 = - SIN(theta(1,iplume))*(delta_lon) + COS(theta(1,iplume))*(delta_lat)
         lon2 =   COS(theta(2,iplume))*(delta_lon) + SIN(theta(2,iplume))*(delta_lat)
         lat2 = - SIN(theta(2,iplume))*(delta_lon) + COS(theta(2,iplume))*(delta_lat)
-        !
+
         ! calculate contribution to plume from its different features, to get a column weight for the anthropogenic
         ! (cw_an) and the fine-mode natural background aerosol (cw_bg)
-        !
+
         f1 = time_weight(1,iplume) * ftr_weight(1,iplume) * EXP(-1.* (a_plume1 * ((lon1)**2) + (b_plume1 * ((lat1)**2)))) 
         f2 = time_weight(2,iplume) * ftr_weight(2,iplume) * EXP(-1.* (a_plume2 * ((lon2)**2) + (b_plume2 * ((lat2)**2)))) 
@@ -454,15 +454,15 @@
         cw_an(icol) = f1 * aod_spmx(iplume) + f2 * aod_spmx(iplume)  
         cw_bg(icol) = f3 * aod_fmbg(iplume) + f4 * aod_fmbg(iplume) 
-        !
+
         ! calculate wavelength-dependent scattering properties
-        !
+
         lfactor   = MIN(1.0,700.0/lambda)
         ssa(icol) = (ssa550(iplume) * lfactor**4) / ((ssa550(iplume) * lfactor**4) + ((1-ssa550(iplume)) * lfactor))
         asy(icol) =  asy550(iplume) * SQRT(lfactor)
       ENDDO
-      !
+
       ! distribute plume optical properties across its vertical profile weighting by optical depth and scaling for
       ! wavelength using the angstrom parameter. 
-      !      
+
       lfactor = EXP(-angstrom(iplume) * LOG(lambda/550.0))
       DO k=1,nlevels
@@ -478,7 +478,7 @@
       ENDDO
     ENDDO
-    !
+
     ! complete optical depth weighting
-    !
+
     DO k=1,nlevels
       DO icol = 1,ncol
@@ -487,7 +487,7 @@
       ENDDO
     ENDDO
-    !
+
     ! calculate effective radius normalization (divisor) factor
-    !
+
     DO icol=1,ncol
       dNovrN(icol) = LOG((1000.0 * (caod_sp(icol) + caod_bg(icol))) + 1.0)/LOG((1000.0 * caod_bg(icol)) + 1.0)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/mod_synchro_omp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/mod_synchro_omp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/mod_synchro_omp.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE mod_synchro_omp
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/modd_csts.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/modd_csts.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/modd_csts.F90	(revision 5099)
@@ -6,5 +6,5 @@
       MODULE MODD_CSTS      
 !     ###############
-!
+
 !!****  *MODD_CSTS* - declaration of Physic constants 
 !!
@@ -13,5 +13,5 @@
 !       The purpose of this declarative module is to declare  the 
 !     Physics constants.    
-!
+
 !!
 !!**  IMPLICIT ARGUMENTS
@@ -36,14 +36,14 @@
 !!      J. Escobar     06/13  add XSURF_TIMY XSURF_TIMY_12 XSURF_EPSILON for REAL*4
 !-------------------------------------------------------------------------------
-!
+
 !*       0.   DECLARATIONS
 !             ------------
-!
+
 IMPLICIT NONE 
 REAL,SAVE :: XPI                ! Pi
-!
+
 REAL,SAVE :: XDAY,XSIYEA,XSIDAY ! day duration, sideral year duration,
                                 ! sideral day duration
-!
+
 REAL,SAVE :: XKARMAN            ! von karman constant
 REAL,SAVE :: XLIGHTSPEED        ! light speed
@@ -51,12 +51,12 @@
 REAL,SAVE :: XBOLTZ             ! Boltzman constant 
 REAL,SAVE :: XAVOGADRO          ! Avogadro number
-!
+
 REAL,SAVE :: XRADIUS,XOMEGA     ! Earth radius, earth rotation
 REAL,SAVE :: XG                 ! Gravity constant
-!
+
 REAL,SAVE :: XP00               ! Reference pressure
-!
+
 REAL,SAVE :: XSTEFAN,XI0        ! Stefan-Boltzman constant, solar constant
-!
+
 REAL,SAVE :: XMD,XMV            ! Molar mass of dry air and molar mass of vapor
 REAL,SAVE :: XRD,XRV            ! Gaz constant for dry air, gaz constant for vapor
@@ -81,11 +81,11 @@
 REAL,SAVE :: XRHOLI             ! Volumic mass of ice
 REAL,SAVE :: XCONDI             ! thermal conductivity of ice (W m-1 K-1)
-!
+
 INTEGER, SAVE :: NDAYSEC        ! Number of seconds in a day
-!
+
 REAL,SAVE     :: XSURF_TINY          ! minimum real on this machine
 REAL,SAVE     :: XSURF_TINY_12       ! sqrt(minimum real on this machine)
 REAL,SAVE     :: XSURF_EPSILON       ! minimum space with 1.0
-!
+
 END MODULE MODD_CSTS
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/nflxtr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/nflxtr.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/nflxtr.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE nflxtr(pdtime,pmfu,pmfd,pen_u,pde_u,pen_d,pde_d,pplay,paprs,x,dx) 
   USE dimphy
@@ -20,13 +20,13 @@
 !    contrairement au schema de Tiedtke d'ou les changements de signe!!!! 
 !=====================================================================
-!
+
   include "YOMCST.h"
   include "YOECUMF.h" 
 
   REAL,INTENT(IN) :: pdtime  ! pdtphys
-!
+
 ! les flux sont definis au 1/2 niveaux 
 ! => pmfu(klev+1) et pmfd(klev+1) sont implicitement nuls
-!
+
   REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfu  ! flux de masse dans le panache montant 
   REAL,DIMENSION(klon,klev),INTENT(IN) :: pmfd  ! flux de masse dans le panache descendant
@@ -90,5 +90,5 @@
 ! calcul des flux dans le panache montant
 ! =========================================
-!
+
 ! Dans la premiere couche, on prend q comme valeur de qu
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/nuage.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/nuage.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/nuage.F90	(revision 5099)
@@ -143,32 +143,32 @@
       IF (ok_aie) THEN
           ! Formula "D" of Boucher and Lohmann, Tellus, 1995
-          !
+
         cdnc(i, k) = 10.**(bl95_b0+bl95_b1*log(max(mass_solu_aero(i,k), &
           1.E-4))/log(10.))*1.E6 !-m-3
           ! Cloud droplet number concentration (CDNC) is restricted
           ! to be within [20, 1000 cm^3]
-          !
+
         cdnc(i, k) = min(1000.E6, max(20.E6,cdnc(i,k)))
         cdnc_pi(i, k) = 10.**(bl95_b0+bl95_b1*log(max(mass_solu_aero_pi(i,k), &
           1.E-4))/log(10.))*1.E6 !-m-3
         cdnc_pi(i, k) = min(1000.E6, max(20.E6,cdnc_pi(i,k)))
-          !
-          !
+
+
           ! air density: pplay(i,k) / (RD * zT(i,k))
           ! factor 1.1: derive effective radius from volume-mean radius
           ! factor 1000 is the water density
           ! _chaud means that this is the CDR for liquid water clouds
-          !
+
         rad_chaud = 1.1*((pqlwp(i,k)*pplay(i,k)/(rd*t(i,k)))/(4./3.*rpi*1000. &
           *cdnc(i,k)))**(1./3.)
-          !
+
           ! Convert to um. CDR shall be at least 3 um.
-          !
+
         rad_chaud = max(rad_chaud*1.E6, 3.)
 
           ! For output diagnostics
-          !
+
           ! Cloud droplet effective radius [um]
-          !
+
           ! we multiply here with f * xl (fraction of liquid water
           ! clouds in the grid cell) to avoid problems in the
@@ -176,10 +176,10 @@
           ! In the output of IOIPSL, derive the real cloud droplet
           ! effective radius as re/fl
-          !
+
         fl(i, k) = pclc(i, k)*(1.-zfice(i))
         re(i, k) = rad_chaud*fl(i, k)
 
           ! Pre-industrial cloud opt thickness
-          !
+
           ! "radius" is calculated as rad_chaud above (plus the
           ! ice cloud contribution) but using cdnc_pi instead of
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/nuage.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/nuage.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/nuage.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
       REAL rad_froid, rad_chau1, rad_chau2
       REAL tau_cld_cv,coefw_cld_cv
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/oasis.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/oasis.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/oasis.F90	(revision 5099)
@@ -1,13 +1,13 @@
-!
+
 MODULE oasis
-!
+
 ! This module contains subroutines for initialization, sending and receiving 
 ! towards the coupler OASIS3. It also contains some parameters for the coupling.
-!
+
 ! This module should always be compiled. With the coupler OASIS3 available the cpp key
 ! CPP_COUPLE should be set and the entier of this file will then be compiled. 
 ! In a forced mode CPP_COUPLE should not be defined and the compilation ends before 
 ! the CONTAINS, without compiling the subroutines.
-!
+
   USE dimphy 
   USE mod_phys_lmdz_para
@@ -107,8 +107,8 @@
 !**** *INICMA*  - Initialize coupled mode communication for atmosphere
 !                 and exchange some initial information with Oasis
-!
+
 !     Rewrite to take the PRISM/psmile library into account
 !     LF 09/2003
-!
+
     USE IOIPSL
     USE surface_data, ONLY : version_ocean
@@ -150,7 +150,6 @@
     WRITE(lunout,*) ' '
 
-!
 ! Define the model name
-!
+
     IF (grid_type==unstructured) THEN
         clmodnam = 'icosa'                 ! as in $NBMODEL in Cpl/Nam/namcouple.tmp
@@ -399,7 +398,5 @@
   END SUBROUTINE inicma
 
-!
-!************************************************************************************
-!
+!************************************************************************************
 
   SUBROUTINE fromcpl(ktime, tab_get)
@@ -408,5 +405,5 @@
 ! and Sea-Ice provided by the coupler. Adaptation to psmile library
 !======================================================================
-!
+
     USE print_control_mod, ONLY: lunout
     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
@@ -459,7 +456,5 @@
   END SUBROUTINE fromcpl
 
-!
-!************************************************************************************
-! 
+!************************************************************************************
 
   SUBROUTINE intocpl(ktime, last, tab_put) 
@@ -469,6 +464,6 @@
 ! IF last time step, writes output fields to binary files.
 ! ======================================================================
-!
-! 
+
+
     USE print_control_mod, ONLY: lunout
     USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_albedo.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_albedo.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_albedo.F90	(revision 5099)
@@ -1,5 +1,4 @@
-!
+
 ! $Id$
-!
 
 SUBROUTINE ocean_albedo(knon,zrmu0,knindex,pwind,SFRWL,alb_dir_new,alb_dif_new)
@@ -39,20 +38,20 @@
 !!       
 !-------------------------------------------------------------------------------
-!
+
 !*           DECLARATIONS
 !            ------------
-!
+
 USE ocean_albedo_para
 USE dimphy
 USE phys_state_var_mod, ONLY : chl_con
-!
-!
+
+
 IMPLICIT NONE
-!
+
 !*      0.1    declarations of arguments
 !              -------------------------
-!
+
 include "clesphys.h"
-!
+
 INTEGER, INTENT(IN) :: knon
 INTEGER, DIMENSION(klon), INTENT(IN) :: knindex
@@ -61,16 +60,16 @@
 REAL, DIMENSION(6),INTENT(IN) :: SFRWL
 REAL, DIMENSION(klon,nsw), INTENT(OUT) :: alb_dir_new, alb_dif_new
-!
+
 !*      0.2    declarations of local variables
 !              -------------------------
-!
+
 REAL, DIMENSION(klon)           :: ZCHL        ! surface chlorophyll
 REAL, DIMENSION(klon)           :: ZCOSZEN     ! Cosine of the zenith solar angle
-!
+
 INTEGER                         :: JWL, INU    ! indexes
 INTEGER                         :: JI
 REAL                            :: ZWL         ! input parameter: wavelength and diffuse/direct fraction of light
 REAL:: ZCHLABS, ZAW, ZBW, ZREFM, ZYLMD, ZUE, ZUE2 ! scalar computation variables
-!
+
 REAL, DIMENSION(klon) :: ZAP, ZXX2, ZR00, ZRR0, ZRRR               ! computation variables
 REAL, DIMENSION(klon) :: ZR22, ZR11DF                              ! computation variables
@@ -78,7 +77,6 @@
 REAL, DIMENSION(klon) :: ZR11, ZRW, ZRWDF, ZRDF                    ! 4 components of the OSA
 REAL, DIMENSION(klon) :: ZSIG, ZFWC, ZWORK1, ZWORK2, ZWORK3
-! 
+
 !--initialisations-------------
-!
 
 IF (knon==0) RETURN ! A verifier pourquoi on en a besoin...
@@ -86,5 +84,5 @@
 alb_dir_new(:,:) = 0. 
 alb_dif_new(:,:) = 0. 
-!
+
 ! Initialisation of chlorophyll content
 ! ZCHL(:) = CHL_CON!0.05 ! averaged global values for surface chlorophyll
@@ -108,7 +106,7 @@
 ! has to be update once we have information from wave model (discussion with G. Madec)
 ZFWC(1:knon)=3.97e-4*PWIND(1:knon)**1.59 ! Salisbury 2014 eq(2) at 37GHz, value in fraction
-!
+
 DO JWL=1,NNWL           ! loop over the wavelengths
-  !
+
   !---------------------------------------------------------------------------------
   ! 0- Compute baseline values
@@ -122,5 +120,5 @@
   ! 1- Compute direct surface albedo (ZR11)
   !---------------------------------------------------------------------------------
-  !
+
   ZXX2(1:knon)=SQRT(1.0-(1.0-ZCOSZEN(1:knon)**2)/ZREFM**2)
   ZRR0(1:knon)=0.50*(((ZXX2(1:knon)-ZREFM*ZCOSZEN(1:knon))/(ZXX2(1:knon)+ZREFM*ZCOSZEN(1:knon)))**2 +  & 
@@ -132,5 +130,5 @@
                EXP(0.1643-7.8409*ZCOSZEN(1:knon)-3.5639*ZCOSZEN(1:knon)**2-2.3588*ZSIG(1:knon)+ & 
                10.0538*ZCOSZEN(1:knon)*ZSIG(1:knon))*ZRR0(1:knon)/ZRRR(1:knon)
-  ! 
+
   !---------------------------------------------------------------------------------
   ! 2- Compute surface diffuse albedo (ZRDF)
@@ -144,5 +142,5 @@
   ! *- Determine absorption and backscattering
   ! coefficients to determine reflectance below the surface (Ro) once for all
-  !
+
   ! *.1- Absorption by chlorophyll
   ZCHLABS= XAKACHL(JWL) 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_albedo_para.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_albedo_para.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_albedo_para.F90	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 ! $Id$
-!
+
 !     ######################
 MODULE ocean_albedo_para
 !     ######################
-!
+
 !!****  *MOD_DALBEDO_RS14* - declaration of ISBA parameters
 !!
@@ -12,5 +12,5 @@
 !       The purpose of this declarative module is to specify  the 
 !     parameters related to direct & diffuse albedo over open water 
-!
+
 !!
 !!      
@@ -24,19 +24,18 @@
 !       S. Baek : extention from 200-800nm to 200-40000nm 
 !-------------------------------------------------------------------------------
-!
+
 !*       0.   DECLARATIONS
 !             ------------
-!
 
 IMPLICIT NONE
-!
+
 INTEGER, PARAMETER   :: NNWL = 381                ! number of wavelength
-!
+
 ! absorption coefficients for seawater et 440 nm
 REAL, PARAMETER      :: XAW440 =  0.00635
-!
+
 !! white-caps reflectance (Koepke , 1983 estimation)
 !REAL, PARAMETER      :: XRWC   =  0.55
-!
+
 ! table of wavelength discretization
 REAL, PARAMETER, DIMENSION(NNWL)::  XAKWL= &
@@ -82,7 +81,4 @@
 3920.0, 3930.0, 3940.0, 3950.0, 3960.0, 3970.0, 3980.0, 3990.0, 4000.0 /) 
 
-
- 
-!
 ! proportion of each wavelength
 REAL, PARAMETER, DIMENSION(NNWL)::  XFRWL= &
@@ -165,6 +161,4 @@
 0.6389357E-04 /) 
 
-
-!
 ! Table for computing Reflectance just below ocean surface (bounded to 200-800 nm)
 ! table of refractive index as function of wavelength
@@ -214,8 +208,4 @@
 1.3357,  1.3351,  1.3345,  1.3339 /)
 
-
-
-
-!
 ! table of chlorophyll absorption coefficient as function of wavelength
 REAL, PARAMETER, DIMENSION(NNWL)::  XAKACHL= &
@@ -377,11 +367,4 @@
 -0.4844930E-01 /)
 
-
-
-
-
-
-
-!
 ! table of seawater absorption coefficient as function of wavelength
 REAL, PARAMETER, DIMENSION(NNWL)::  XAKAW3= &
@@ -464,7 +447,4 @@
 0.1509941E+05 /)
 
-
-
-!
 ! table of seawater backscattering coefficient as function of wavelength
 REAL, PARAMETER, DIMENSION(NNWL)::  XAKBW= &
@@ -628,8 +608,6 @@
 0.0000000E+00 /)
 
-
-!
 !--------------------------------------------------------------------------------
-!
+
 END MODULE 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_cpl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_cpl_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_cpl_mod.F90	(revision 5099)
@@ -1,10 +1,9 @@
-!
+
 ! $Id$
-!
+
 MODULE ocean_cpl_mod
-!
+
 ! This module is used both for the sub-surface ocean and sea-ice for the case of a 
 ! coupled model configuration, ocean=couple. 
-!
 
   IMPLICIT NONE
@@ -15,13 +14,13 @@
 
 !****************************************************************************************
-!
+
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE ocean_cpl_init(dtime, rlon, rlat)
-!
+
 ! Allocate fields for this module and initailize the module mod_cpl
-!
+
     USE dimphy,           ONLY : klon
     USE cpl_mod
@@ -42,7 +41,7 @@
     
   END SUBROUTINE ocean_cpl_init
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE ocean_cpl_noice( &
        swnet, lwnet, alb1, &
@@ -58,9 +57,8 @@
        delta_sst, dTer, dSer, dt_ds)
 
-!
 ! This subroutine treats the "open ocean", all grid points that are not entierly covered
 ! by ice. The subroutine first receives fields from coupler, then some calculations at 
 ! surface is done and finally it sends some fields to the coupler.
-!
+
     USE dimphy,           ONLY : klon
     USE calcul_fluxs_mod
@@ -73,5 +71,5 @@
     INCLUDE "YOMCST.h"
     INCLUDE "clesphys.h"
-!    
+
 ! Input arguments  
 !****************************************************************************************
@@ -154,5 +152,5 @@
 !****************************************************************************************
 ! Receive sea-surface temperature(tsurf_cpl) from coupler
-!
+
 !****************************************************************************************
     CALL cpl_receive_ocean_fields(knon, knindex, tsurf_cpl, u0_cpl, v0_cpl, &
@@ -161,5 +159,5 @@
 !****************************************************************************************
 ! Calculate fluxes at surface
-!
+
 !****************************************************************************************
     cal = 0.
@@ -211,5 +209,5 @@
 !****************************************************************************************
 ! Calculate fder : flux derivative (sensible and latente)
-!
+
 !****************************************************************************************
     fder_new(:) = fder_old(:) + dflux_s(:) + dflux_l(:)
@@ -225,5 +223,5 @@
 !****************************************************************************************
 ! Send and cumulate fields to the coupler
-!
+
 !****************************************************************************************
 
@@ -234,7 +232,7 @@
 
   END SUBROUTINE ocean_cpl_noice
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE ocean_cpl_ice( &
        rlon, rlat, swnet, lwnet, alb1, &
@@ -249,9 +247,9 @@
        alb1_new, alb2_new, evap, fluxsens, fluxlat, flux_u1, flux_v1, &
        tsurf_new, dflux_s, dflux_l, rhoa)
-!
+
 ! This subroutine treats the ocean where there is ice. The subroutine first receives 
 ! fields from coupler, then some calculations at surface is done and finally sends 
 ! some fields to the coupler.
-!    
+
     USE dimphy,           ONLY : klon
     USE cpl_mod
@@ -323,5 +321,5 @@
 !****************************************************************************************
 ! Receive ocean temperature(tsurf_cpl) and albedo(alb_new) from coupler
-!
+
 !****************************************************************************************
 
@@ -335,5 +333,5 @@
 !****************************************************************************************
 ! Calculate fluxes at surface
-!
+
 !****************************************************************************************
     cal = 0.
@@ -371,5 +369,5 @@
 !****************************************************************************************
 ! Calculate fder : flux derivative (sensible and latente)
-!
+
 !****************************************************************************************
     fder_new(:) = fder_old(:) + dflux_s(:) + dflux_l(:)
@@ -385,5 +383,5 @@
 !****************************************************************************************
 ! Send and cumulate fields to the coupler
-!
+
 !****************************************************************************************
 
@@ -397,6 +395,6 @@
 
   END SUBROUTINE ocean_cpl_ice
-!  
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE ocean_cpl_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_forced_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_forced_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_forced_mod.F90	(revision 5099)
@@ -1,16 +1,16 @@
-!
+
 ! $Id$
-!
+
 MODULE ocean_forced_mod
-!
+
 ! This module is used for both the sub-surfaces ocean and sea-ice for the case of a 
 ! forced ocean,  "ocean=force".
-!
+
   IMPLICIT NONE
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE ocean_forced_noice( &
        itime, dtime, jour, knon, knindex, &
@@ -28,10 +28,10 @@
 #endif            
        )
-!
+
 ! This subroutine treats the "open ocean", all grid points that are not entierly covered
 ! by ice.
 ! The routine receives data from climatologie file limit.nc and does some calculations at the 
 ! surface. 
-!
+
     USE dimphy
     USE calcul_fluxs_mod
@@ -139,5 +139,5 @@
 ! 1)    
 ! Read sea-surface temperature from file limit.nc
-!
+
 !****************************************************************************************
 !--sb:
@@ -162,5 +162,5 @@
 ! 2)
 ! Flux calculation
-!
+
 !****************************************************************************************
 ! Set some variables for calcul_fluxs
@@ -237,7 +237,7 @@
 
   END SUBROUTINE ocean_forced_noice
-!
+
 !***************************************************************************************
-!
+
   SUBROUTINE ocean_forced_ice( &
        itime, dtime, jour, knon, knindex, &
@@ -254,9 +254,9 @@
 #endif            
        )
-!
+
 ! This subroutine treats the ocean where there is ice. 
 ! The routine reads data from climatologie file and does flux calculations at the 
 ! surface.
-!
+
     USE dimphy
     USE geometry_mod, ONLY: longitude,latitude
@@ -421,5 +421,5 @@
 ! 2)
 ! Calculations due to snow and runoff
-!
+
 !****************************************************************************************
 #ifdef ISO
@@ -489,5 +489,5 @@
     
 ! Calculation of albedo at snow (alb_neig) and update the age of snow (agesno)
-! 
+
     CALL albsno(klon, knon, dtime, agesno(:), alb_neig(:), precip_snow(:))  
 
@@ -508,24 +508,24 @@
 !************************************************************************
 !  SUBROUTINE read_tsurf1d(knon,sst_out)
-!
+
 ! This subroutine specifies the surface temperature to be used in 1D simulations
-!
+
 !      USE dimphy, ONLY : klon
-!
+
 !      INTEGER, INTENT(IN)                  :: knon     ! nomber of points on compressed grid
 !      REAL, DIMENSION(klon), INTENT(OUT)   :: sst_out  ! tsurf used to force the single-column model
-!
+
 !       INTEGER :: i
 ! COMMON defined in lmdz1d.F:
 !       real ts_cur
 !       common /sst_forcing/ts_cur
-!
+
 !       DO i = 1, knon
 !        sst_out(i) = ts_cur
 !       ENDDO
-!
+
 !      END SUBROUTINE read_tsurf1d
-!
-!
+
+
 !************************************************************************
 END MODULE ocean_forced_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_slab_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_slab_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ocean_slab_mod.F90	(revision 5099)
@@ -1,8 +1,7 @@
 !Completed
 MODULE ocean_slab_mod
-!
+
 ! This module is used for both surface ocean and sea-ice when using the slab ocean,
 ! "ocean=slab".
-!
 
   USE dimphy
@@ -123,7 +122,7 @@
 
 CONTAINS
-!
-!***********************************************************************************
-!
+
+!***********************************************************************************
+
   SUBROUTINE ocean_slab_init(dtime, pctsrf_rst)
   !, seaice_rst etc
@@ -308,7 +307,7 @@
 
  END SUBROUTINE ocean_slab_init
-!
-!***********************************************************************************
-!
+
+!***********************************************************************************
+
   SUBROUTINE ocean_slab_frac(itime, dtime, jour, pctsrf_chg, is_modified)
 
@@ -330,7 +329,7 @@
 
   END SUBROUTINE ocean_slab_frac
-!
+
 !************************************************************************************
-!
+
   SUBROUTINE ocean_slab_noice( & 
        itime, dtime, jour, knon, knindex, &
@@ -419,5 +418,5 @@
 !****************************************************************************************
 ! 1) Surface fluxes calculation
-!    
+
 !****************************************************************************************
     !cal(:)      = 0. ! infinite thermal inertia
@@ -471,5 +470,5 @@
 !****************************************************************************************
 ! 2) Q-Flux : get global variables lmt_bils, diff_sst and diff_siv from file limit_slab.nc
-!
+
 !****************************************************************************************
     CALL limit_slab(itime, dtime, jour, lmt_bils, diff_sst, diff_siv) 
@@ -484,5 +483,5 @@
 ! 3) Recalculate new temperature (add Surf fluxes, Q-Flux, Ocean transport)
 !    Bring to freezing temp and make sea ice if necessary
-!  
+
 !***********************************************o*****************************************
     tsurf_new=tsurf_in
@@ -669,5 +668,5 @@
     END IF ! coupling time
   END SUBROUTINE ocean_slab_noice
-!
+
 !****************************************************************************************
 
@@ -965,7 +964,7 @@
 
   END SUBROUTINE ocean_slab_ice
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE ocean_slab_final
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/open_climoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/open_climoz_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/open_climoz_m.F90	(revision 5099)
@@ -8,7 +8,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE open_climoz(ncid, press_in_cen, press_in_edg, time_in, daily, adjust)
-!
+
 !-------------------------------------------------------------------------------
   USE netcdf95, ONLY: nf95_open, nf95_close, nf95_gw_var, nf95_inq_varid
@@ -96,5 +96,5 @@
 
 END SUBROUTINE open_climoz
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/paramlmdz_phy_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/paramlmdz_phy_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/paramlmdz_phy_mod.F90	(revision 5099)
@@ -49,5 +49,5 @@
 !$OMP MASTER
       IF (is_mpi_root) THEN
-!
+
 !       zstophy = pdtphys
 !       zout = -1
@@ -55,8 +55,8 @@
        zstophy = 86400.
        zout = 86400.
-!
+
        idayref = day_ref
        CALL ymds2ju(annee_ref, 1, idayref, 0.0, zjulian)
-!
+
        CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,rlon_glo,zx_lon)
        IF (nbp_lon>1) THEN
@@ -66,7 +66,7 @@
        ENDDO
        ENDIF
-!
+
        CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,rlat_glo,zx_lat)
-!
+
        CALL histbeg("paramLMDZ_phy.nc",  &
                        np,zx_lon(np:np,1), np,zx_lat(1,np:np), &
@@ -74,25 +74,25 @@
                        itau_phy, zjulian, dtime, &
                        nhori, nid_ctesGCM)
-!
+
        CALL histdef(nid_ctesGCM, "R_ecc",  &
                       "Excentricite","-", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "R_peri",  &
                       "Equinoxe","-", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "R_incl",  &
                       "Inclinaison","deg", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "solaire",  &
                       "Constante solaire","W/m2", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
 #ifdef CPP_RRTM
        IF (iflag_rrtm.EQ.1) THEN
@@ -106,30 +106,30 @@
        ENDIF
 #endif
-!
+
        CALL histdef(nid_ctesGCM, "co2_ppm",  &
                       "Concentration du CO2", "ppm", &
                       1,1,nhori, 1,1,1, -99, 32,  &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "CH4_ppb",  &
                       "Concentration du CH4", "ppb", &
                       1,1,nhori, 1,1,1, -99, 32,  &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "N2O_ppb", &
                       "Concentration du N2O", "ppb", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "CFC11_ppt", &
                       "Concentration du CFC11", "ppt", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histdef(nid_ctesGCM, "CFC12_ppt", &
                       "Concentration du CFC12", "ppt", &
                       1,1,nhori, 1,1,1, -99, 32, &
                       "ave(X)", zstophy,zout)
-!
+
        CALL histend(nid_ctesGCM)
        
@@ -171,26 +171,26 @@
 !$OMP MASTER
       IF (is_mpi_root) THEN      
-!
+
       ndex2d = 0
       itau_w = itau_phy + itap + int(start_time * day_step_phy)
-!
+
 ! Variables globales
-!
+
       zx_tmp_0d=R_ecc
       CALL histwrite(nid_ctesGCM,"R_ecc",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=R_peri
       CALL histwrite(nid_ctesGCM,"R_peri",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=R_incl
       CALL histwrite(nid_ctesGCM,"R_incl",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=solaire
       CALL histwrite(nid_ctesGCM,"solaire",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
 #ifdef CPP_RRTM
       IF (iflag_rrtm.EQ.1) THEN
@@ -203,27 +203,27 @@
       ENDIF
 #endif
-!
+
       zx_tmp_0d=co2_ppm
       CALL histwrite(nid_ctesGCM,"co2_ppm",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=CH4_ppb
       CALL histwrite(nid_ctesGCM,"CH4_ppb",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=N2O_ppb
       CALL histwrite(nid_ctesGCM,"N2O_ppb",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=CFC11_ppt
       CALL histwrite(nid_ctesGCM,"CFC11_ppt",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
       zx_tmp_0d=CFC12_ppt
       CALL histwrite(nid_ctesGCM,"CFC12_ppt",itau_w, &
                      zx_tmp_0d,np,ndex2d)
-!
+
 !=================================================================
-!
+
       IF (ok_sync) THEN
         call histsync(nid_ctesGCM)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/pbl_surface_mod.F90	(revision 5099)
@@ -1,13 +1,13 @@
-!
+
 ! $Id$
-!
+
 MODULE pbl_surface_mod
-!
+
 ! Planetary Boundary Layer and Surface module
-!
+
 ! This module manages the calculation of turbulent diffusion in the boundary layer 
 ! and all interactions towards the differents sub-surfaces.
-!
-!
+
+
   USE dimphy
   USE mod_phys_lmdz_para,  ONLY : mpi_size
@@ -73,7 +73,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE pbl_surface_init(fder_rst, snow_rst, qsurf_rst, ftsoil_rst)
 
@@ -104,5 +104,5 @@
 !****************************************************************************************
 ! Allocate and initialize module variables with fields read from restart file.
-!
+
 !****************************************************************************************    
     ALLOCATE(fder(klon), stat=ierr)
@@ -133,5 +133,5 @@
 !****************************************************************************************
 ! Test for sub-surface indices
-!
+
 !****************************************************************************************
     IF (is_ter /= 1) THEN 
@@ -163,5 +163,5 @@
 !****************************************************************************************
 ! Validation of ocean mode
-!
+
 !****************************************************************************************
 
@@ -179,9 +179,9 @@
 !    iflag_frein = 0
 !    CALL getin_p('iflag_frein',iflag_frein)
-!
+
 !jyg<
 !****************************************************************************************
 ! Allocate variables for pbl splitting
-!
+
 !****************************************************************************************
 
@@ -222,5 +222,5 @@
 !****************************************************************************************
 ! Allocate and initialize module variables with fields read from restart file.
-!
+
 !****************************************************************************************    
 
@@ -255,7 +255,5 @@
 #endif
 
-!  
-!****************************************************************************************
-!  
+!****************************************************************************************
 
   SUBROUTINE pbl_surface( &
@@ -329,5 +327,5 @@
 ! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
 ! Objet: interface de "couche limite" (diffusion verticale)
-!
+
 !AA REM:
 !AA-----
@@ -345,7 +343,7 @@
 !AA il faudra sortir ces memes champs en leur ajoutant une dimension, 
 !AA c'est a dire nbsrf (nbre de subsurface).
-!
+
 ! Arguments:
-!
+
 ! dtime----input-R- interval du temps (secondes)
 ! itap-----input-I- numero du pas de temps
@@ -367,5 +365,5 @@
 ! cldt-----input-R- total cloud fraction
 ! Martin
-!
+
 ! d_t------output-R- le changement pour "t"
 ! d_q------output-R- le changement pour "q"
@@ -392,5 +390,5 @@
 ! pblT-----output-R- T au nveau HCL
 ! treedrg--output-R- tree drag (m)               
-!
+
     USE carbon_cycle_mod,   ONLY : carbon_cycle_cpl, carbon_cycle_tr, level_coupling_esm 
     USE carbon_cycle_mod,   ONLY : co2_send, nbcf_out, fields_out, yfields_out, cfname_out
@@ -858,5 +856,5 @@
 !!!jyg le 08/02/2012
     REAL, DIMENSION(klon, nbsrf)       :: windsp
-!
+
     REAL, DIMENSION(klon, nbsrf)       :: t2m_x
     REAL, DIMENSION(klon, nbsrf)       :: q2m_x
@@ -867,5 +865,5 @@
     REAL, DIMENSION(klon, nbsrf)       :: ustar_x
     REAL, DIMENSION(klon, nbsrf)       :: wstar_x
-!              
+
     REAL, DIMENSION(klon, nbsrf)       :: pblh_x
     REAL, DIMENSION(klon, nbsrf)       :: plcl_x
@@ -878,5 +876,5 @@
     REAL, DIMENSION(klon, nbsrf)       :: trmb2_x
     REAL, DIMENSION(klon, nbsrf)       :: trmb3_x
-!
+
     REAL, DIMENSION(klon, nbsrf)       :: t2m_w
     REAL, DIMENSION(klon, nbsrf)       :: q2m_w
@@ -887,5 +885,5 @@
     REAL, DIMENSION(klon, nbsrf)       :: ustar_w
     REAL, DIMENSION(klon, nbsrf)       :: wstar_w
-!                           
+
     REAL, DIMENSION(klon, nbsrf)       :: pblh_w
     REAL, DIMENSION(klon, nbsrf)       :: plcl_w
@@ -898,5 +896,5 @@
     REAL, DIMENSION(klon, nbsrf)       :: trmb2_w
     REAL, DIMENSION(klon, nbsrf)       :: trmb3_w
-!
+
     REAL, DIMENSION(klon)       :: yt2m_x
     REAL, DIMENSION(klon)       :: yq2m_x
@@ -907,5 +905,5 @@
     REAL, DIMENSION(klon)       :: yustar_x
     REAL, DIMENSION(klon)       :: ywstar_x
-!              
+
     REAL, DIMENSION(klon)       :: ypblh_x
     REAL, DIMENSION(klon)       :: ylcl_x
@@ -918,5 +916,5 @@
     REAL, DIMENSION(klon)       :: ytrmb2_x
     REAL, DIMENSION(klon)       :: ytrmb3_x
-!
+
     REAL, DIMENSION(klon)       :: yt2m_w
     REAL, DIMENSION(klon)       :: yq2m_w
@@ -927,5 +925,5 @@
     REAL, DIMENSION(klon)       :: yustar_w
     REAL, DIMENSION(klon)       :: ywstar_w
-!                       
+
     REAL, DIMENSION(klon)       :: ypblh_w
     REAL, DIMENSION(klon)       :: ylcl_w
@@ -938,8 +936,8 @@
     REAL, DIMENSION(klon)       :: ytrmb2_w
     REAL, DIMENSION(klon)       :: ytrmb3_w
-!
+
     REAL, DIMENSION(klon)       :: uzon_x, vmer_x, speed_x, zri1_x, pref_x !speed_x, zri1_x, pref_x, added by Fuxing WANG, 04/03/2015
     REAL, DIMENSION(klon)       :: zgeo1_x, tair1_x, qair1_x, tairsol_x
-!
+
     REAL, DIMENSION(klon)       :: uzon_w, vmer_w, speed_w, zri1_w, pref_w !speed_w, zri1_w, pref_w, added by Fuxing WANG, 04/03/2015
     REAL, DIMENSION(klon)       :: zgeo1_w, tair1_w, qair1_w, tairsol_w
@@ -984,5 +982,5 @@
     REAL, DIMENSION(klon)              :: yGamma_dTs_phiT, yGamma_dQs_phiQ
     REAL, DIMENSION(klon)              :: ydTs_ins, ydqs_ins
-!
+
     REAL, PARAMETER                    :: facteur=2./sqrt(3.14)
     REAL, PARAMETER                    :: inertia=2000.
@@ -1010,5 +1008,5 @@
 
     REAL                               :: vent
-!
+
 ! For debugging with IOIPSL
     INTEGER, DIMENSION(nbp_lon*nbp_lat)    :: ndexbg
@@ -1072,8 +1070,8 @@
 
       IF (prt_level >=10) print *,' -> pbl_surface, itap ',itap
-!
+
 !!jyg      iflag_split = mod(iflag_pbl_split,2)
 !!jyg      iflag_split = mod(iflag_pbl_split,10)
-!
+
 ! Flags controlling the splitting of the turbulent boundary layer:
 !   iflag_split_ref = 0  ==> no splitting
@@ -1131,5 +1129,5 @@
 ! 1) Initialisation and validation tests 
 !    Only done first time entering this subroutine
-!
+
 !****************************************************************************************
 
@@ -1208,5 +1206,5 @@
 ! 2) Initialization to zero 
 !****************************************************************************************
-!
+
 ! 2a) Initialization of all argument variables with INTENT(OUT)
 !****************************************************************************************
@@ -1383,5 +1381,5 @@
     flux_t_x(:,:,:)=0. ;          flux_t_w(:,:,:)=0. 
     flux_q_x(:,:,:)=0. ;          flux_q_w(:,:,:)=0.
-!
+
 !jyg<
     flux_u_x(:,:,:)=0. ;          flux_u_w(:,:,:)=0.
@@ -1392,9 +1390,9 @@
     flux_xt_x(:,:,:,:)=0. ;          flux_xt_w(:,:,:,:)=0.
 #endif
-!
+
 !jyg<
 ! pblh,plcl,capCL,cteiCL ... are meaningfull only over sub-surfaces
 ! actually present in the grid cell  ==> value set to 999999.
-!                           
+
 !jyg<
        ustar(:,:)   = 999999.
@@ -1404,5 +1402,5 @@
        v10m(:,:)    = 999999. 
 !>jyg
-!
+
        pblh(:,:)   = 999999.        ! Hauteur de couche limite
        plcl(:,:)   = 999999.        ! Niveau de condensation de la CLA
@@ -1415,5 +1413,5 @@
        trmb2(:,:)  = 999999.        ! inhibition 
        trmb3(:,:)  = 999999.        ! Point Omega
-!
+
        t2m_x(:,:)    = 999999. 
        q2m_x(:,:)    = 999999. 
@@ -1422,5 +1420,5 @@
        u10m_x(:,:)   = 999999. 
        v10m_x(:,:)   = 999999. 
-!                           
+
        pblh_x(:,:)   = 999999.      ! Hauteur de couche limite
        plcl_x(:,:)   = 999999.      ! Niveau de condensation de la CLA
@@ -1433,5 +1431,5 @@
        trmb2_x(:,:)  = 999999.      ! inhibition 
        trmb3_x(:,:)  = 999999.      ! Point Omega
-!
+
        t2m_w(:,:)    = 999999. 
        q2m_w(:,:)    = 999999. 
@@ -1452,5 +1450,5 @@
        trmb3_w(:,:)  = 999999.      ! Point Omega
 !!!      
-!
+
 !!!
 !****************************************************************************************
@@ -1468,5 +1466,5 @@
 !****************************************************************************************
 ! Test for rugos........ from physiq.. A la fin plutot???
-!
+
 !****************************************************************************************
 
@@ -1479,7 +1477,7 @@
 
 ! Mean calculations of albedo
-!
+
 ! * alb  : mean albedo for whole SW interval
-!
+
 ! Mean albedo for grid point
 ! * alb_m  : mean albedo at whole SW interval
@@ -1537,5 +1535,5 @@
        ENDDO
     ENDDO
-!
+
 !<al1: second order corrections
 !- net = dwn -up; up=sig( T4 + 4sum%T3T' + 6sum%T2T'2 +...)
@@ -1577,7 +1575,7 @@
 !****************************************************************************************
 ! 4) Loop over different surfaces
-!
+
 ! Only points containing a fraction of the sub surface will be treated.
-! 
+
 !****************************************************************************************
                                                                           !<<<<<<<<<<<<<
@@ -1585,5 +1583,5 @@
                                                                           !<<<<<<<<<<<<<
        IF (prt_level >=10) print *,' Loop nsrf ',nsrf
-!
+
        IF (iflag_split_ref == 3) THEN
          IF (nsrf == is_oce) THEN
@@ -1627,8 +1625,7 @@
 !****************************************************************************************
 ! 5) Compress variables 
-!
-!****************************************************************************************
-
-!
+
+!****************************************************************************************
+
 !jyg<    (20190926)
 !   Provisional : set ybeta to standard values
@@ -1646,5 +1643,5 @@
        ENDIF !  (nsrf .NE. is_ter)
 !>jyg
-!
+
        DO j = 1, knon
           i = ni(j)
@@ -1740,5 +1737,5 @@
           ENDDO
        ENDDO
-!
+
 !!! jyg le 07/02/2012 et le 10/04/2013
         DO k = 1, klev+1
@@ -1767,5 +1764,5 @@
           ENDDO
         ENDDO
-!
+
        IF (iflag_split>=1) THEN
 !!! nrlmd le 02/05/2011
@@ -1805,5 +1802,5 @@
 !!             ywake_dltke(j,k) = wake_dltke(i,k,nsrf)
 !!             ytke(j,k)     = tke(i,k,nsrf)
-!
+
              ytke_x(j,k)      = tke_x(i,k,nsrf)
              ytke(j,k)        = tke_x(i,k,nsrf)+wake_s(i)*wake_dltke(i,k,nsrf)
@@ -1866,5 +1863,5 @@
 !****************************************************************************************
 ! 6a) Calculate coefficients for turbulent diffusion at surface, cdragh et cdragm.
-!
+
 !****************************************************************************************
 
@@ -1936,5 +1933,5 @@
         ENDIF
         IF (prt_level >=10) print *,'clcdrag -> ycdragh_x ', ycdragh_x(1:knon)
-!
+
 ! Faire disparaitre les lignes commentees fin 2015 (le temps des tests)
 !        CALL clcdrag( knon, nsrf, ypaprs, ypplay, &
@@ -1952,5 +1949,5 @@
             yts_w, yqsurf_w, yz0m, yz0h, yri0, 0, &
             ycdragm_w, ycdragh_w, zri1_w, pref_w, rain_f, zxtsol, ypplay(:,1) )
-!
+
         IF(ok_bug_zg_wk_pbl) THEN
          zgeo1(1:knon) = wake_s(1:knon)*zgeo1_w(1:knon) + (1.-wake_s(1:knon))*zgeo1_x(1:knon)
@@ -1976,5 +1973,5 @@
 !****************************************************************************************
 ! 6b) Calculate coefficients for turbulent diffusion in the atmosphere, ycoefh et ycoefm.
-!
+
 !****************************************************************************************
 
@@ -2066,5 +2063,5 @@
 
         IF (prt_level >=10) print *,'coef_diff_turb -> ycoefh_x ',ycoefh_x(1:knon,:)
-!
+
       IF (prt_level >=10) THEN
       print *,' args coef_diff_turb: yu_w ',  yu_w(1:knon,:)
@@ -2122,11 +2119,11 @@
        
 !****************************************************************************************
-! 
+
 ! 8) "La descente" - "The downhill"
-!  
+
 !  climb_hq_down and climb_wind_down calculate the coefficients
 !  Ccoef_X et Dcoef_X for X=[H, Q, U, V].
 !  Only the coefficients at surface for H and Q are returned.
-!
+
 !****************************************************************************************
 
@@ -2166,5 +2163,5 @@
          PRINT *,'pbl_surface (climb_hq_down.x->) BcoefQ_x ',BcoefQ_x
        ENDIF
-!
+
         CALL climb_hq_down(knon, ycoefh_w, ypaprs, ypplay, &
             ydelp, yt_w, yq_w, dtime, &
@@ -2206,5 +2203,5 @@
 !!!
             AcoefU_x, AcoefV_x, BcoefU_x, BcoefV_x)
-!
+
         CALL climb_wind_down(knon, dtime, ycoefm_w, ypplay, ypaprs, yt_w, ydelp, yu_w, yv_w, &
 !!! nrlmd le 02/05/2011
@@ -2236,5 +2233,5 @@
 !****************************************************************************************
 ! 9) Small calculations
-!
+
 !****************************************************************************************
 
@@ -2268,5 +2265,4 @@
 #endif
 
-!
 ! Cdragq computation
 ! ------------------
@@ -2278,5 +2274,5 @@
     ! pbl_surface of an independant cdragq variable.
     !******************************************************************************
-!
+
     IF ( f_z0qh_oce /= 1. .and. nsrf ==is_oce) THEN
        ! Si on suit les formulations par exemple de Tessel, on 
@@ -2286,5 +2282,5 @@
 !!       ycdragq_w(1:knon)=ycdragh_w(1:knon)*                                      &
 !!            log(z1lay(1:knon)/yz0h(1:knon))/log(z1lay(1:knon)/(f_z0qh_oce*yz0h(1:knon)))
-!
+
        DO j = 1,knon
          z1lay = zgeo1(j)/RG
@@ -2294,5 +2290,5 @@
 !!     Print *,'YYYYpbl0: fact_cdrag ', fact_cdrag
        ENDDO  ! j = 1,knon
-!
+
 !!  Print *,'YYYYpbl0: z1lay, yz0h, f_z0qh_oce, ycdragh_w, ycdragq_w ', &
 !!                z1lay, yz0h(1:knon), f_z0qh_oce, ycdragh_w(1:knon), ycdragq_w(1:knon)
@@ -2301,5 +2297,5 @@
        ycdragq_w(1:knon)=ycdragh_w(1:knon)
     ENDIF  ! ( f_z0qh_oce .ne. 1. .and. nsrf .eq.is_oce)
-!
+
          CALL wx_pbl_prelim_0(knon, nsrf, dtime, ypplay, ypaprs, ywake_s,  &
                          yts, y_delta_tsurf, ygustiness, &
@@ -2375,10 +2371,10 @@
 !  Save initial value of z0h for use in evappot (z0h wiil be computed again in the surface models)
           yz0h_old(1:knon) = yz0h(1:knon)
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 ! Calulate t2m and q2m for the case of calculation at land grid points 
 ! t2m and q2m are needed as input to ORCHIDEE
-!
+
 !****************************************************************************************
        IF (nsrf == is_ter) THEN
@@ -2406,9 +2402,9 @@
 
 !****************************************************************************************
-!
+
 ! 10) Switch according to current surface
 !     It is necessary to start with the continental surfaces because the ocean
 !     needs their run-off.
-!
+
 !****************************************************************************************
        SELECT CASE(nsrf)
@@ -2666,5 +2662,5 @@
 !****************************************************************************************
 ! 11) - Calcul the increment of surface temperature
-!
+
 !****************************************************************************************
 
@@ -2677,10 +2673,10 @@
  
 !****************************************************************************************
-!
+
 ! 12) "La remontee" - "The uphill"
-!
+
 !  The fluxes (y_flux_X) and tendancy (y_d_X) are calculated 
 !  for X=H, Q, U and V, for all vertical levels.
-!
+
 !****************************************************************************************
 !!
@@ -2703,5 +2699,5 @@
           y_flux_q1(:) =  flat/RLVTT
           yfluxlat(:) =  flat
-!
+
 !!  Test sur iflag_split retire le 2/02/2018, sans vraiment comprendre la raison de ce test. (jyg)
 !!          IF (iflag_split .eq.0) THEN
@@ -2737,5 +2733,5 @@
         ENDDO
         ENDIF
-!
+
 ! ------------------------------------------------------------------------------
 ! 12a)  Splitting
@@ -2746,8 +2742,8 @@
         call abort_gcm('pbl_surface_mod 2607','isos pas encore dans iflag_split=1',1)
 #endif
-!
-!
+
+
          IF (nsrf /= is_oce) THEN
-!
+
 !         Compute potential evaporation and aridity factor  (jyg, 20200328)
           ybeta_prev(:) = ybeta(:)
@@ -2755,7 +2751,7 @@
                yqa(j) = AcoefQ(j) - BcoefQ(j)*yevap(j)*dtime
              ENDDO
-!
+
           CALL wx_evappot(knon, yqa, yTsurf_new, yevap_pot)
-!
+
           ybeta(1:knon) = min(yevap(1:knon)/yevap_pot(1:knon), 1.)
           
@@ -2768,8 +2764,8 @@
            ENDDO
           ENDIF  ! (prt_level >=10)
-!
+
 ! Second call to wx_pbl0_merge and wx_pbl_dts_merge in order to take into account 
 ! the update of the aridity coeficient beta.
-!
+
         CALL wx_pbl_prelim_beta(knon, dtime, ywake_s, ybeta,  &
                         BcoefQ_x, BcoefQ_w  &
@@ -2815,5 +2811,5 @@
             ydqs_ins(:) = 0.
           ENDIF   ! (iflag_split .eq. 2)
-!
+
         ELSE    ! (nsrf .ne. is_oce)
           ybeta(1:knon) = 1.
@@ -2830,5 +2826,5 @@
           ydqs_ins(:) = 0.
         ENDIF   ! (nsrf .ne. is_oce)
-! 
+
         CALL wx_pbl_split(knon, nsrf, dtime, ywake_s, ybeta, iflag_split, &
                        yg_T, yg_Q, &
@@ -2846,5 +2842,5 @@
                        y_delta_tsurf_new, y_delta_qsurf &
                        )
-!
+
          CALL wx_pbl_check(knon, dtime, ypplay, ypaprs, ywake_s, ybeta, iflag_split, &
                        yTs, y_delta_tsurf,  & 
@@ -2858,5 +2854,5 @@
                        y_flux_t1_x, y_flux_t1_w, &
                        y_flux_q1_x, y_flux_q1_w)
-!
+
          IF (nsrf /= is_oce) THEN
            CALL wx_pbl_dts_check(knon, dtime, ypplay, ypaprs, ywake_s, ybeta, iflag_split, &
@@ -2877,18 +2873,17 @@
                          y_flux_q1_x, y_flux_q1_w )
          ENDIF   ! (nsrf .ne. is_oce)
-!
+
        ELSE  ! (iflag_split .ge. 1)
          ybeta(1:knon) = 1.
          yevap_pot(1:knon) = yevap(1:knon)
        ENDIF  ! (iflag_split .ge. 1)
-!
+
        IF (prt_level >= 10) THEN
          print *,'pbl_surface, ybeta , yevap, yevap_pot ', &
                                ybeta(1:knon) , yevap(1:knon), yevap_pot(1:knon)
        ENDIF  ! (prt_level >= 10)
-!
+
 !>jyg
-!
- 
+
 !!jyg!!   A reprendre apres reflexion   ===============================================
 !!jyg!!
@@ -2986,5 +2981,5 @@
 #endif
       )
-!
+
        CALL climb_hq_up(knon, dtime, yt_w, yq_w, &
             y_flux_q1_w, y_flux_t1_w, ypaprs, ypplay, &
@@ -3032,5 +3027,5 @@
 !!!
             y_flux_u_x, y_flux_v_x, y_d_u_x, y_d_v_x)
-!
+
      y_d_t_diss_x(:,:)=0.
      IF (iflag_pbl>=20 .and. iflag_pbl<30) THEN
@@ -3058,10 +3053,10 @@
      ENDIF
 !     print*,'yamada_c OK'
-!
+
         IF (prt_level >=10) THEN
          print *, 'After climbing up, lfuxlat_x, fluxlat_w ', &
                yfluxlat_x(1:knon), yfluxlat_w(1:knon)
         ENDIF
-!
+
        ENDIF  ! (iflag_split .eq.0)
 
@@ -3087,5 +3082,5 @@
 !     - Multiply with pourcentage of current surface
 !     - Cumulate in global variable
-!
+
 !****************************************************************************************
 
@@ -3298,7 +3293,7 @@
 !!jyg20210118          delta_tsurf(i,nsrf)=y_delta_tsurf(j)
           delta_tsurf(i,nsrf)=y_delta_tsurf_new(j)
-!
+
           delta_qsurf(i) = delta_qsurf(i) + y_delta_qsurf(j)*ypct(j)
-!
+
           cdragh_x(i) = cdragh_x(i) + ycdragh_x(j)*ypct(j)
           cdragh_w(i) = cdragh_w(i) + ycdragh_w(j)*ypct(j)
@@ -3434,5 +3429,5 @@
            d_u_x(i,k) = d_u_x(i,k) + y_d_u_x(j,k)
            d_v_x(i,k) = d_v_x(i,k) + y_d_v_x(j,k)
-!
+
            d_t_diss_w(i,k) = d_t_diss_w(i,k) + y_d_t_diss_w(j,k)
            d_t_w(i,k) = d_t_w(i,k) + y_d_t_w(j,k)
@@ -3447,5 +3442,4 @@
 #endif
 
-!
 !!           d_wake_dlt(i,k) = d_wake_dlt(i,k) + y_d_t_w(i,k)-y_d_t_x(i,k)
 !!           d_wake_dlq(i,k) = d_wake_dlq(i,k) + y_d_q_w(i,k)-y_d_q_x(i,k)
@@ -3542,8 +3536,8 @@
 ! 14) Calculate the temperature and relative humidity at 2m and the wind at 10m 
 !     Call HBTM
-!
-!****************************************************************************************
-!!!
-!
+
+!****************************************************************************************
+!!!
+
 #undef T2m     
 #define T2m     
@@ -3662,9 +3656,9 @@
           u10m(i,nsrf)=(yu10m(j) * uzon(j))/SQRT(uzon(j)**2+vmer(j)**2)
           v10m(i,nsrf)=(yu10m(j) * vmer(j))/SQRT(uzon(j)**2+vmer(j)**2)
-!
+
           DO k = 1, 6
            n2mout(i,nsrf,k) = yn2mout(j,nsrf,k)
           END DO  
-!
+
         ENDDO
        ELSE  !(iflag_split .eq.0)
@@ -3677,9 +3671,9 @@
           u10m_x(i,nsrf)=(yu10m_x(j) * uzon_x(j))/SQRT(uzon_x(j)**2+vmer_x(j)**2)
           v10m_x(i,nsrf)=(yu10m_x(j) * vmer_x(j))/SQRT(uzon_x(j)**2+vmer_x(j)**2)
-!
+
           DO k = 1, 6
            n2mout_x(i,nsrf,k) = yn2mout_x(j,nsrf,k)
           END DO  
-!
+
         ENDDO
         DO j=1, knon
@@ -3691,13 +3685,13 @@
           u10m_w(i,nsrf)=(yu10m_w(j) * uzon_w(j))/SQRT(uzon_w(j)**2+vmer_w(j)**2)
           v10m_w(i,nsrf)=(yu10m_w(j) * vmer_w(j))/SQRT(uzon_w(j)**2+vmer_w(j)**2)
-!
+
           ustar(i,nsrf) = ustar_x(i,nsrf) + wake_s(i)*(ustar_w(i,nsrf)-ustar_x(i,nsrf))
           u10m(i,nsrf) = u10m_x(i,nsrf) + wake_s(i)*(u10m_w(i,nsrf)-u10m_x(i,nsrf))
           v10m(i,nsrf) = v10m_x(i,nsrf) + wake_s(i)*(v10m_w(i,nsrf)-v10m_x(i,nsrf))
-!
+
           DO k = 1, 6
            n2mout_w(i,nsrf,k) = yn2mout_w(j,nsrf,k)
           END DO  
-!
+
         ENDDO
 !!!
@@ -3749,5 +3743,5 @@
 !!!
        ENDIF
-!
+
        IF (prt_level >=10) THEN
          print *, 'T2m, q2m, RH2m ', &
@@ -3756,5 +3750,5 @@
 
 !   print*,'OK pbl 5'
-!
+
 !!! jyg le 07/02/2012
        IF (iflag_split ==0) THEN
@@ -3879,11 +3873,11 @@
 !****************************************************************************************
 ! 15) End of loop over different surfaces
-!
+
 !****************************************************************************************
     ENDDO loop_nbsrf
-!
+
 !----------------------------------------------------------------------------------------
 !   Reset iflag_split 
-!
+
    iflag_split=iflag_split_ref
 
@@ -3901,5 +3895,5 @@
 !****************************************************************************************
 ! 16) Calculate the mean value over all sub-surfaces for some variables
-!
+
 !****************************************************************************************
     
@@ -3939,5 +3933,5 @@
               zxfluxu_x(i,k) = zxfluxu_x(i,k) + flux_u_x(i,k,nsrf) * pctsrf(i,nsrf)
               zxfluxv_x(i,k) = zxfluxv_x(i,k) + flux_v_x(i,k,nsrf) * pctsrf(i,nsrf)
-!
+
               zxfluxt_w(i,k) = zxfluxt_w(i,k) + flux_t_w(i,k,nsrf) * pctsrf(i,nsrf)
               zxfluxq_w(i,k) = zxfluxq_w(i,k) + flux_q_w(i,k,nsrf) * pctsrf(i,nsrf)
@@ -4009,7 +4003,6 @@
 !!!
 
-!
 ! Incrementer la temperature du sol
-!
+
     zxtsol(:) = 0.0  ; zxfluxlat(:) = 0.0
     zt2m(:) = 0.0    ; zq2m(:) = 0.0 ; zn2mout(:,:) = 0
@@ -4045,5 +4038,5 @@
        ENDDO
     ENDDO
-!
+
 !<al1 order 2 correction to zxtsol, for radiation computations (main atm effect of Ts)
    IF (iflag_order2_sollw == 1) THEN
@@ -4064,9 +4057,9 @@
           zt2m(i)  = zt2m(i)  + t2m(i,nsrf)  * pctsrf(i,nsrf)
           zq2m(i)  = zq2m(i)  + q2m(i,nsrf)  * pctsrf(i,nsrf)
-!
+
           DO k = 1, 6
            zn2mout(i,k)  = zn2mout(i,k)  + n2mout(i,nsrf,k)  * pctsrf(i,nsrf)
           ENDDO  
-!
+
           zustar(i) = zustar(i) + ustar(i,nsrf) * pctsrf(i,nsrf)
           wstar(i,is_ave)=wstar(i,is_ave)+wstar(i,nsrf)*pctsrf(i,nsrf)
@@ -4100,22 +4093,22 @@
           zt2m(i)  = zt2m(i)  + (t2m_x(i,nsrf)+wake_s(i)*(t2m_w(i,nsrf)-t2m_x(i,nsrf))) * pctsrf(i,nsrf)
           zq2m(i)  = zq2m(i)  + q2m_x(i,nsrf)  * pctsrf(i,nsrf)
-!
+
           DO k = 1, 6
            zn2mout(i,k)  = zn2mout(i,k)  + n2mout_x(i,nsrf,k)  * pctsrf(i,nsrf)
           ENDDO
-!
+
           zustar(i) = zustar(i) + ustar_x(i,nsrf) * pctsrf(i,nsrf)
           wstar(i,is_ave)=wstar(i,is_ave)+wstar_x(i,nsrf)*pctsrf(i,nsrf)
           zu10m(i) = zu10m(i) + u10m_x(i,nsrf) * pctsrf(i,nsrf)
           zv10m(i) = zv10m(i) + v10m_x(i,nsrf) * pctsrf(i,nsrf)
-!
+
           s_pblh(i)     = s_pblh(i)     + pblh_x(i,nsrf)  * pctsrf(i,nsrf)
           s_pblh_x(i)   = s_pblh_x(i)   + pblh_x(i,nsrf)  * pctsrf(i,nsrf)
           s_pblh_w(i)   = s_pblh_w(i)   + pblh_w(i,nsrf)  * pctsrf(i,nsrf)
-!
+
           s_plcl(i)     = s_plcl(i)     + plcl_x(i,nsrf)  * pctsrf(i,nsrf)
           s_plcl_x(i)   = s_plcl_x(i)   + plcl_x(i,nsrf)  * pctsrf(i,nsrf)
           s_plcl_w(i)   = s_plcl_w(i)   + plcl_w(i,nsrf)  * pctsrf(i,nsrf)
-!
+
           s_capCL(i)  = s_capCL(i)  + capCL_x(i,nsrf) * pctsrf(i,nsrf)
           s_oliqCL(i) = s_oliqCL(i) + oliqCL_x(i,nsrf)* pctsrf(i,nsrf)
@@ -4202,7 +4195,7 @@
 
   END SUBROUTINE pbl_surface
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE pbl_surface_final(fder_rst, snow_rst, qsurf_rst, ftsoil_rst &
 #ifdef ISO
@@ -4235,5 +4228,5 @@
 !****************************************************************************************
 ! Return module variables for writing to restart file
-!
+
 !****************************************************************************************    
     fder_rst(:)       = fder(:)
@@ -4248,5 +4241,5 @@
 !****************************************************************************************
 ! Deallocate module variables
-!
+
 !****************************************************************************************
 !   DEALLOCATE(qsol, fder, snow, qsurf, evap, rugos, agesno, ftsoil)
@@ -4266,5 +4259,5 @@
 !****************************************************************************************
 ! Deallocate variables for pbl splitting
-!
+
 !****************************************************************************************
 
@@ -4273,7 +4266,6 @@
 
   END SUBROUTINE pbl_surface_final
-!  
-!****************************************************************************************
-! 
+
+!****************************************************************************************
 
 !albedo SB >>>
@@ -4326,5 +4318,5 @@
     INTEGER           :: ixt
 #endif
-!
+
 ! All at once !! 
 !****************************************************************************************
@@ -4460,6 +4452,6 @@
 
   END SUBROUTINE pbl_surface_newfrac
-!  
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
 END MODULE pbl_surface_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/perturb_radlwsw.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/perturb_radlwsw.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/perturb_radlwsw.F90	(revision 5099)
@@ -1,26 +1,26 @@
       SUBROUTINE perturb_radlwsw(zxtsol,iflag_radia)
-!
+
 !Case-specific radiative setup
-!
+
       use dimphy
       IMPLICIT none
       INCLUDE "flux_arp.h"     
-!
+
 ! Arguments :
 !------------
       REAL,DIMENSION(klon), INTENT(INOUT) :: zxtsol
       INTEGER, INTENT(IN)                 :: iflag_radia
-!
+
 !======================================================================
-!
+
       IF (iflag_radia == 2) THEN
-!
+
 ! Iflag_radia = 2 : DICE case : 
 !               on force zxtsol=tg pour le rayonnement (MPL 20130806)
 !Sonia : Cas dice lmdz1d force en flux : on impose Tg pour imposer le LWUP
-!
+
         zxtsol(:) =  tg
       ENDIF
-!
+
       RETURN
       END
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE phyaqua_mod
   ! Routines complementaires pour la physique planetaire.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phyetat0_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phyetat0_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phyetat0_mod.F90	(revision 5099)
@@ -443,5 +443,5 @@
 !  TKE
 !==================================
-!
+
   IF (iflag_pbl>1) then
      found=phyetat0_srf(pbl_tke,"TKE","Turb. Kinetic. Energ. ",1.e-8)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phyredem.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phyredem.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phyredem.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE phyredem (fichnom)
-!
+
 !-------------------------------------------------------------------------------
 ! Author: Z.X. Li (LMD/CNRS), 1993/08/18
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_local_var_mod.F90	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Id$
-!
+
 MODULE phys_local_var_mod
   USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_STRATAER
   ! Variables locales pour effectuer les appels en serie
   !======================================================================
-  !
-  !
+
+
   !======================================================================
   ! Declaration des variables
@@ -206,5 +206,5 @@
   REAL, SAVE, ALLOCATABLE :: ZFSDN0(:, :), ZFSUP0(:, :)      ! diag
   !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
-  !
+
   REAL, SAVE, ALLOCATABLE :: stratomask(:, :)
   !$OMP THREADPRIVATE(stratomask)
@@ -389,5 +389,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
   !$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
-  !
+
   !nrlmd+jyg<
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_pblh_x, s_pblh_w
@@ -396,5 +396,5 @@
   !$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
   !>nrlmd+jyg
-  !
+
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: slab_wfbils
   !$OMP THREADPRIVATE(slab_wfbils)
@@ -426,5 +426,5 @@
 !$OMP THREADPRIVATE(xtrain_lsc)
 #endif
-  !
+
   !jyg+nrlmd<
   !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
@@ -476,5 +476,5 @@
   !$OMP THREADPRIVATE(ratqsc)
   !>jyg+nrlmd
-  !
+
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
   !$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
@@ -503,5 +503,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: epmax_diag ! epmax_cape
   !$OMP THREADPRIVATE(epmax_diag)
-  !
+
   !  Deep convective variables used in phytrac
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ep ! epmax_cape
@@ -577,5 +577,5 @@
 #endif
 #endif
-  !
+
   !      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: lambda_th
@@ -713,9 +713,4 @@
   !$OMP THREADPRIVATE(dqsfreez)
 
-
-
-
-
-  !
   ! variables for stratospheric aerosol
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d_q_emiss
@@ -773,5 +768,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :, :) :: nd_mode
   !$OMP THREADPRIVATE(nd_mode)
-  !
+
   !---3D budget variables
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_nucl
@@ -787,5 +782,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_backgr_so2
   !$OMP THREADPRIVATE(budg_3D_backgr_so2)
-  !
+
   !---2D budget variables
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
@@ -920,5 +915,5 @@
     ZFLDN0 = 0.
     ALLOCATE(ZFLUP0(klon, klev + 1), ZFSDN0(klon, klev + 1), ZFSUP0(klon, klev + 1))
-    !
+
     ALLOCATE(topswad_aero(klon), solswad_aero(klon))
     ALLOCATE(topswai_aero(klon), solswai_aero(klon))
@@ -1040,10 +1035,10 @@
     ALLOCATE(s_lcl(klon))
     ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
-    !
+
     !nrlmd+jyg<
     ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
     ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
     !>nrlmd+jyg
-    !
+
     ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
     ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
@@ -1057,5 +1052,5 @@
     ALLOCATE(rain_num(klon))
     ALLOCATE(qlth(klon, klev), qith(klon, klev), qsith(klon, klev), wiceth(klon, klev))
-    !
+
 #ifdef ISO
       ALLOCATE(xtevap(ntraciso,klon))
@@ -1070,5 +1065,5 @@
       runoff_diag(:)=0. ; xtrunoff_diag(:,:)=0. ! because variables are only given values on knon grid points
 #endif
-    !
+
     ALLOCATE(sens_x(klon), sens_w(klon))
     ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
@@ -1093,8 +1088,8 @@
       ALLOCATE(xt_therm(ntraciso,klon,klev))
 #endif
-    !
+
     ALLOCATE(ptconv(klon, klev))
     ALLOCATE(ratqsc(klon, klev))
-    !
+
     ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
     ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
@@ -1131,5 +1126,5 @@
     ! FC
     ALLOCATE(zxfluxq(klon, klev), zxfluxt(klon, klev))
-    !
+
     !  Deep convective variables used in phytrac
     ALLOCATE(pmflxr(klon, klev + 1), pmflxs(klon, klev + 1))
@@ -1436,5 +1431,5 @@
     DEALLOCATE(tal1, pal1, pab1, pab2)
     DEALLOCATE(ptstar, pt0, slp)
-    !
+
     DEALLOCATE(alp_wake)
     DEALLOCATE(wake_h, wake_k)
@@ -1454,5 +1449,5 @@
       DEALLOCATE(d_deltaxt_vdf)
 #endif
-    !
+
     DEALLOCATE(bils)
     DEALLOCATE(cdragm, cdragh, cldh, cldl)
@@ -1462,10 +1457,10 @@
     DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
     DEALLOCATE(s_pblh, s_pblt, s_therm)
-    !
+
     !nrlmd+jyg<
     DEALLOCATE(s_pblh_x, s_pblh_w)
     DEALLOCATE(s_lcl_x, s_lcl_w)
     !>nrlmd+jyg
-    !
+
     DEALLOCATE(slab_wfbils, tpot, tpote, ue)
     DEALLOCATE(uq, ve, vq, zxffonte)
@@ -1478,5 +1473,5 @@
     DEALLOCATE(rain_num)
     DEALLOCATE(qlth, qith, qsith, wiceth)
-    !
+
     DEALLOCATE(sens_x, sens_w)
     DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
@@ -1503,8 +1498,8 @@
       DEALLOCATE(h1_diag,runoff_diag,xtrunoff_diag)
 #endif
-    !
+
     DEALLOCATE(ptconv)
     DEALLOCATE(ratqsc)
-    !
+
     DEALLOCATE(wbeff, convoccur, zmax_th)
     DEALLOCATE(zq2m, zt2m, weak_inversion)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_ctrlout_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_ctrlout_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE phys_output_ctrlout_mod
 
@@ -1321,8 +1321,8 @@
        ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(13),       &
        "Dry aerosol Optical depth at 550 nm "//name_aero_tau(13),"13", (/ ('', i=1, 10) /)) /)
-!
+
   TYPE(ctrl_out), SAVE :: o_tausumaero_lw = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     'od_10um_STRAT', 'Stratospheric Aerosol Optical depth at 10 um ', '1', (/ ('', i=1, 10) /))
-!
+
   TYPE(ctrl_out), SAVE :: o_od443aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
     'od443aer', 'Total aerosol optical depth at 440nm', '-', (/ ('', i=1, 10) /))
@@ -2224,7 +2224,5 @@
        "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
 
-#ifdef CPP_Dust
-      INCLUDE 'spla_output_dat.h'
-#endif
+  INCLUDE 'spla_output_dat.h'
 
    type(ctrl_out), save:: o_delta_sst &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_mod.F90	(revision 5099)
@@ -1,4 +1,3 @@
 ! $Id$
-!
 
 MODULE phys_output_mod 
@@ -310,5 +309,5 @@
 ! afin d avoir une seule sortie mensuelle par mois lorsque l on tourne 
 ! par annee (IM).
-!
+
      idayref = day_ref
      IF (klon_glo==1) THEN
@@ -414,5 +413,5 @@
           spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2
         ENDDO
-!
+
 !!! ajout axe vertical spectband : solar band number
         CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')
@@ -650,5 +649,5 @@
 
     ipos=scan(str,'0123456789.',.TRUE.)
-    !  
+
     il=len_trim(str)
     WRITE(lunout,*) "ipos = ", ipos
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_var_mod.F90	(revision 5099)
@@ -1,3 +1,3 @@
-!
+
 ! phys_local_var_mod.F90 1327 2010-03-17 15:33:56Z idelkadi $
 
@@ -8,6 +8,6 @@
   ! Variables outputs pour les ecritures des sorties
   !======================================================================
-  !
-  !
+
+
   !======================================================================
   ! Declaration des variables
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_output_write_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE phys_output_write_mod
 
@@ -616,5 +616,5 @@
        CALL histwrite_phy(o_contfracATM, zx_tmp_fi2d)
        CALL histwrite_phy(o_contfracOR, pctsrf(:,is_ter))
-!
+
        IF (using_xios) THEN
 
@@ -633,5 +633,5 @@
          CALL histwrite_phy(o_longitude, longitude_deg)
          CALL histwrite_phy(o_latitude, latitude_deg)
-!
+
 #ifdef CPP_RRTM
          IF (iflag_rrtm.EQ.1) THEN
@@ -644,5 +644,5 @@
          ENDIF
 #endif
-!
+
          CALL histwrite_phy("co2_ppm",co2_ppm)
          CALL histwrite_phy("CH4_ppb",CH4_ppb)
@@ -650,5 +650,5 @@
          CALL histwrite_phy("CFC11_ppt",CFC11_ppt)
          CALL histwrite_phy("CFC12_ppt",CFC12_ppt)
-!
+
        ENDIF !using_xios
 
@@ -1558,5 +1558,5 @@
 !!               CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d) 
 !!               IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=dqvdf_w(1:klon,1:klev)/pdtphys
-!
+
                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf_x(1:klon,1:klev)/pdtphys
                CALL histwrite_phy(o_dtvdf_x    ,zx_tmp_fi3d) 
@@ -1566,5 +1566,5 @@
                CALL histwrite_phy(o_dqvdf_x    ,zx_tmp_fi3d) 
                IF (vars_defined) zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf_w(1:klon,1:klev)/pdtphys
-!
+
                CALL histwrite_phy(o_dqvdf_w    ,zx_tmp_fi3d) 
        IF (vars_defined)  zx_tmp_fi2d(1:klon)=-1*sens_x(1:klon)
@@ -2545,5 +2545,5 @@
        CALL histwrite_phy(o_ref_liq, ref_liq)
        CALL histwrite_phy(o_ref_ice, ref_ice)
-!
+
        IF (ok_4xCO2atm) THEN
           IF (vars_defined) zx_tmp_fi2d(:) = swupp(:,klevp1)*swradcorr(:)
@@ -2726,5 +2726,5 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        IF (iflag_phytrac == 1 ) then
-!
+
          IF (type_trac == 'co2i') THEN
            itr = 0
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phys_state_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phys_state_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phys_state_var_mod.F90	(revision 5099)
@@ -1,10 +1,10 @@
-!
+
 ! $Id$
-!
+
       MODULE phys_state_var_mod
 ! Variables sauvegardees pour le startphy.nc
 !======================================================================
-!
-!
+
+
 !======================================================================
 ! Declaration des variables
@@ -70,7 +70,7 @@
 
 !clesphy0 param physiq
-!
+
 ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
-!
+
       REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
 !$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
@@ -223,5 +223,5 @@
       REAL,ALLOCATABLE,SAVE :: sigd(:)
 !$OMP THREADPRIVATE(sigd)
-!
+
       REAL,ALLOCATABLE,SAVE :: cin(:)
 !$OMP THREADPRIVATE(cin)
@@ -245,5 +245,5 @@
       REAL,ALLOCATABLE,SAVE :: ALP(:)
 !$OMP THREADPRIVATE(ALP)
-!
+
 ! nouvelles variables pour le couplage convection-couche limite
       REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
@@ -259,5 +259,5 @@
       REAL,ALLOCATABLE,SAVE    :: ale_bl_stat(:)
 !$OMP THREADPRIVATE(ale_bl_stat)
-!
+
 ! variables de la wake
 ! wake_deltat : ecart de temperature avec la zone non perturbee
@@ -292,5 +292,5 @@
       REAL,ALLOCATABLE,SAVE :: wake_fip(:)
 !$OMP THREADPRIVATE(wake_fip)
-!
+
 !jyg<
 ! variables related to the spitting of the PBL between wake and 
@@ -304,5 +304,5 @@
 !>nrlmd
 !>jyg
-!
+
 ! pfrac_impa : Produits des coefs lessivage impaction
 ! pfrac_nucl : Produits des coefs lessivage nucleation
@@ -312,5 +312,5 @@
       REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
 !$OMP THREADPRIVATE(pfrac_1nucl)
-!
+
       REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:)  
 !$OMP THREADPRIVATE(total_rain,nday_rain)
@@ -432,5 +432,5 @@
       REAL,ALLOCATABLE,SAVE :: bbase(:)
 !$OMP THREADPRIVATE(bbase)
-!
+
       REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
 !$OMP THREADPRIVATE( zqasc)
@@ -441,5 +441,5 @@
       REAL,SAVE,ALLOCATABLE :: snow_con(:)
 !$OMP THREADPRIVATE(snow_con)
-!
+
 #ifdef ISO
       REAL,SAVE,ALLOCATABLE :: xtrain_con(:,:)
@@ -454,10 +454,10 @@
       REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
 !$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
-!
+
 ! ok_ade=T -ADE=topswad-topsw
 ! ok_aie=T ->
 !       ok_ade=T -AIE=topswai-topswad
 !       ok_ade=F -AIE=topswai-topsw
-!
+
 !topswad, solswad : Aerosol direct effect
       REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
@@ -656,5 +656,5 @@
 !cloud base pressure & cloud top pressure
       ALLOCATE(ema_pcb(klon), ema_pct(klon))
-!
+
       ALLOCATE(Mipsh(klon,klev))
       ALLOCATE(Ma(klon,klev))
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5099)
@@ -1,5 +1,4 @@
-
 ! $Id$
-!
+
 !#define IO_DEBUG
 MODULE physiq_mod
@@ -9,22 +8,22 @@
 CONTAINS
 
-  SUBROUTINE physiq (nlon,nlev, &
-       debut,lafin,pdtphys_, &
-       paprs,pplay,pphi,pphis,presnivs, &
-       u,v,rot,t,qx, &
-       flxmass_w, &
-       d_u, d_v, d_t, d_qx, d_ps)
-
-! For clarity, the "USE" section is now arranged in alphabetical order,
-! with a separate section for CPP keys
-! PLEASE try to follow this rule 
-
-    USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando
+  SUBROUTINE physiq (nlon, nlev, &
+          debut, lafin, pdtphys_, &
+          paprs, pplay, pphi, pphis, presnivs, &
+          u, v, rot, t, qx, &
+          flxmass_w, &
+          d_u, d_v, d_t, d_qx, d_ps)
+
+    ! For clarity, the "USE" section is now arranged in alphabetical order,
+    ! with a separate section for CPP keys
+    ! PLEASE try to follow this rule
+
+    USE ACAMA_GWD_rando_m, only : ACAMA_GWD_rando
     USE aero_mod
     USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
-        fl_ebil, fl_cor_ebil
-    USE assert_m, only: assert
+            fl_ebil, fl_cor_ebil
+    USE assert_m, only : assert
     USE change_srf_frac_mod
-    USE conf_phys_m, only: conf_phys
+    USE conf_phys_m, only : conf_phys
     USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad
     USE CFMIP_point_locations   ! IM stations CFMIP
@@ -32,49 +31,49 @@
     USE dimphy
     USE etat0_limit_unstruct_mod
-    USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
-    USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
-    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
-    USE ioipsl, only: histbeg, histvert, histdef, histend, histsync, &
-         histwrite, ju2ymds, ymds2ju, getin
+    USE FLOTT_GWD_rando_m, only : FLOTT_GWD_rando
+    USE fonte_neige_mod, ONLY : fonte_neige_get_vars
+    USE geometry_mod, ONLY : cell_area, latitude_deg, longitude_deg
+    USE ioipsl, only : histbeg, histvert, histdef, histend, histsync, &
+            histwrite, ju2ymds, ymds2ju, getin
     USE ioipsl_getin_p_mod, ONLY : getin_p
     USE indice_sol_mod
-    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac
-    USE readTracFiles_mod, ONLY: addPhase
-    USE strings_mod,  ONLY: strIdx
+    USE infotrac_phy, ONLY : nqtot, nbtr, nqo, tracers, type_trac
+    USE readTracFiles_mod, ONLY : addPhase
+    USE strings_mod, ONLY : strIdx
     USE iophy
     USE limit_read_mod, ONLY : init_limit_read
-    USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
-    USE mod_phys_lmdz_mpi_data, only: is_mpi_root
+    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, nbp_lev, klon_glo, grid1dTo2d_glo, grid_type, unstructured
+    USE mod_phys_lmdz_mpi_data, only : is_mpi_root
     USE mod_phys_lmdz_para
-    USE netcdf95, only: nf95_close
-    USE netcdf, only: nf90_fill_real     ! IM for NMC files
-    USE open_climoz_m, only: open_climoz ! ozone climatology from a file
-    USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
+    USE netcdf95, only : nf95_close
+    USE netcdf, only : nf90_fill_real     ! IM for NMC files
+    USE open_climoz_m, only : open_climoz ! ozone climatology from a file
+    USE ozonecm_m, only : ozonecm ! ozone of J.-F. Royer
     USE pbl_surface_mod, ONLY : pbl_surface
-    USE phyaqua_mod, only: zenang_an
-    USE phyetat0_mod, only: phyetat0
-    USE phystokenc_mod, ONLY: offline, phystokenc
-    USE phys_cal_mod, only: year_len, mth_len, days_elapsed, jh_1jan, &
-         year_cur, mth_cur,jD_cur, jH_cur, jD_ref, day_cur, hour, calend
-!!  USE phys_local_var_mod, ONLY : a long list of variables
-!!              ==> see below, after "CPP Keys" section
+    USE phyaqua_mod, only : zenang_an
+    USE phyetat0_mod, only : phyetat0
+    USE phystokenc_mod, ONLY : offline, phystokenc
+    USE phys_cal_mod, only : year_len, mth_len, days_elapsed, jh_1jan, &
+            year_cur, mth_cur, jD_cur, jH_cur, jD_ref, day_cur, hour, calend
+    !!  USE phys_local_var_mod, ONLY : a long list of variables
+    !!              ==> see below, after "CPP Keys" section
     USE phys_state_var_mod ! Variables sauvegardees de la physique
     USE phys_output_mod
     USE phys_output_ctrlout_mod
-    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, &
-         alert_first_call, call_alert, prt_alerte
+    USE print_control_mod, ONLY : mydebug => debug, lunout, prt_level, &
+            alert_first_call, call_alert, prt_alerte
     USE readaerosol_mod, ONLY : init_aero_fromfile
     USE readaerosolstrato_m, ONLY : init_readaerosolstrato
-    USE radlwsw_m, only: radlwsw
-    USE regr_horiz_time_climoz_m, ONLY: regr_horiz_time_climoz
-    USE regr_pr_time_av_m, only: regr_pr_time_av
-    USE surface_data,     ONLY : type_ocean, ok_veget
-    USE time_phylmdz_mod, only: current_time, itau_phy, pdtphys, raz_date, update_time
-    USE tracinca_mod, ONLY: config_inca
-    USE tropopause_m,     ONLY: dyn_tropopause
-    USE ice_sursat_mod,  ONLY: flight_init, airplane
+    USE radlwsw_m, only : radlwsw
+    USE regr_horiz_time_climoz_m, ONLY : regr_horiz_time_climoz
+    USE regr_pr_time_av_m, only : regr_pr_time_av
+    USE surface_data, ONLY : type_ocean, ok_veget
+    USE time_phylmdz_mod, only : current_time, itau_phy, pdtphys, raz_date, update_time
+    USE tracinca_mod, ONLY : config_inca
+    USE tropopause_m, ONLY : dyn_tropopause
+    USE ice_sursat_mod, ONLY : flight_init, airplane
     USE vampir
     USE write_field_phy
-    USE wxios, ONLY: g_ctx, wxios_set_context
+    USE wxios, ONLY : g_ctx, wxios_set_context
     USE lmdz_lscp, ONLY : lscp
     USE lmdz_call_cloud_optics_prop, ONLY : call_cloud_optics_prop
@@ -86,39 +85,33 @@
     USE lmdz_thermcell_ini, ONLY : thermcell_ini, iflag_thermals_tenv
     USE lmdz_thermcell_dtke, ONLY : thermcell_dtke
-    USE lmdz_blowing_snow_ini, ONLY : blowing_snow_ini , qbst_bs 
+    USE lmdz_blowing_snow_ini, ONLY : blowing_snow_ini, qbst_bs
     USE lmdz_lscp_ini, ONLY : lscp_ini
     USE lmdz_ratqs_main, ONLY : ratqs_main
     USE lmdz_ratqs_ini, ONLY : ratqs_ini
     USE lmdz_cloud_optics_prop_ini, ONLY : cloud_optics_prop_ini
-    USE phys_output_var_mod, ONLY :      cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv
+    USE phys_output_var_mod, ONLY : cloudth_sth, cloudth_senv, cloudth_sigmath, cloudth_sigmaenv
     USE phys_output_var_mod, ONLY : cloud_cover_sw, cloud_cover_sw_s2
 
-    USE geometry_mod,      ONLY: longitude, latitude, boundslon, boundslat, ind_cell_glo
-    USE time_phylmdz_mod,  ONLY: ndays
-    USE infotrac_phy,      ONLY: nqCO2
-
-    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
-    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
-
-
-    USE lmdz_xios, ONLY: xios_update_calendar, xios_context_finalize, xios_get_field_attr, &
+    USE geometry_mod, ONLY : longitude, latitude, boundslon, boundslat, ind_cell_glo
+    USE time_phylmdz_mod, ONLY : ndays
+    USE infotrac_phy, ONLY : nqCO2
+
+    USE time_phylmdz_mod, ONLY : annee_ref, day_ini, day_ref, start_time
+    USE vertical_layers_mod, ONLY : aps, bps, ap, bp
+
+    USE lmdz_xios, ONLY : xios_update_calendar, xios_context_finalize, xios_get_field_attr, &
             xios_field_is_active, xios_context, xios_set_current_context
-    USE wxios, ONLY: missing_val, using_xios
+    USE wxios, ONLY : missing_val, using_xios
     USE paramLMDZ_phy_mod
 
-    !USE cmp_seri_mod
-!    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
-!  &      fl_ebil, fl_cor_ebil
-
-!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
-!
-!
-#ifdef CPP_Dust
-    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
+    USE phytracr_spl_mod, ONLY : phytracr_spl, phytracr_spl_out_init
     USE phys_output_write_spl_mod
-#else
     USE phytrac_mod, ONLY : phytrac_init, phytrac
     USE phys_output_write_mod
-#endif
+
+    USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_DUST
+
+    !!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
+
 
 #ifdef REPROBUS
@@ -131,232 +124,230 @@
 #ifdef CPP_RRTM
     USE YOERAD, ONLY : NRADLP
-!    USE YOESW, ONLY : RSUN
 #endif
 
-    USE phys_local_var_mod, ONLY: d_q_emiss
+    USE phys_local_var_mod, ONLY : d_q_emiss
     USE strataer_local_var_mod
-    USE strataer_nuc_mod, ONLY: strataer_nuc_init
-    USE strataer_emiss_mod, ONLY: strataer_emiss_init
-    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_STRATAER
-!
-!
-!!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
-
-USE physiqex_mod, ONLY : physiqex
-USE phys_local_var_mod, ONLY: phys_local_var_init, phys_local_var_end, &
-       ! [Variables internes non sauvegardees de la physique]
-       ! Variables locales pour effectuer les appels en serie
-       t_seri,q_seri,ql_seri,qs_seri,qbs_seri,u_seri,v_seri,tr_seri,rneb_seri, &
-       rhcl, &        
-       ! Dynamic tendencies (diagnostics)
-       d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_qbs_dyn,d_u_dyn,d_v_dyn,d_tr_dyn,d_rneb_dyn, &
-       d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d,d_qbs_dyn2d, &
-       ! Physic tendencies
-       d_t_con,d_q_con,d_q_con_zmasse,d_u_con,d_v_con, &
-       d_tr, &                              !! to be removed?? (jyg)
-       d_t_wake,d_q_wake, &
-       d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0, &
-       d_t_ajsb,d_q_ajsb, &
-       d_t_ajs,d_q_ajs,d_u_ajs,d_v_ajs, &
-!       d_t_ajs_w,d_q_ajs_w, &
-!       d_t_ajs_x,d_q_ajs_x, &
-       !
-       d_t_eva,d_q_eva,d_ql_eva,d_qi_eva, &
-       d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc, &
-       d_t_lscst,d_q_lscst, &
-       d_t_lscth,d_q_lscth, &
-       plul_st,plul_th, &
-       !
-       d_t_vdf,d_q_vdf, d_qbs_vdf, d_u_vdf,d_v_vdf,d_t_diss, &
-       d_t_vdf_x, d_t_vdf_w, &
-       d_q_vdf_x, d_q_vdf_w, &
-       d_ts, &
-       !
-       d_t_bsss,d_q_bsss,d_qbs_bsss, &
-       !
-!       d_t_oli,d_u_oli,d_v_oli, &
-       d_t_oro,d_u_oro,d_v_oro, &
-       d_t_oro_gw,d_u_oro_gw,d_v_oro_gw, &
-       d_t_lif,d_u_lif,d_v_lif, &
-       d_t_ec, &
-       !
-       du_gwd_hines,dv_gwd_hines,d_t_hin, &
-       dv_gwd_rando,dv_gwd_front, &
-       east_gwstress,west_gwstress, &
-       d_q_ch4, &
-       ! proprecip
-       qraindiag, qsnowdiag, &
-       dqreva, dqssub, &
-       dqrauto,dqrcol,dqrmelt,dqrfreez, &
-       dqsauto,dqsagg,dqsrim,dqsmelt,dqsfreez, &
-       !  Special RRTM
-       ZLWFT0_i,ZSWFT0_i,ZFLDN0,  &
-       ZFLUP0,ZFSDN0,ZFSUP0,      &
-       !
-       topswad_aero,solswad_aero,   &
-       topswai_aero,solswai_aero,   &
-       topswad0_aero,solswad0_aero, &
-       !LW additional
-       toplwad_aero,sollwad_aero,   &
-       toplwai_aero,sollwai_aero,   &
-       toplwad0_aero,sollwad0_aero, &
-       !pour Ecrad
-       topswad_aero_s2, solswad_aero_s2,   &
-       topswai_aero_s2, solswai_aero_s2,   &
-       topswad0_aero_s2, solswad0_aero_s2, &
-       topsw_aero_s2, topsw0_aero_s2,      &
-       solsw_aero_s2, solsw0_aero_s2,      &
-       topswcf_aero_s2, solswcf_aero_s2,   &
-       !LW diagnostics
-       toplwad_aero_s2, sollwad_aero_s2,   &
-       toplwai_aero_s2, sollwai_aero_s2,   &
-       toplwad0_aero_s2, sollwad0_aero_s2, &
-       !
-       topsw_aero,solsw_aero,       &
-       topsw0_aero,solsw0_aero,     &
-       topswcf_aero,solswcf_aero,   &
-       tausum_aero,tau3d_aero,      &
-       drytausum_aero,              &
-       !
-       !variables CFMIP2/CMIP5
-       topswad_aerop, solswad_aerop,   &
-       topswai_aerop, solswai_aerop,   &
-       topswad0_aerop, solswad0_aerop, &
-       topsw_aerop, topsw0_aerop,      & 
-       solsw_aerop, solsw0_aerop,      &
-       topswcf_aerop, solswcf_aerop,   &
-       !LW diagnostics
-       toplwad_aerop, sollwad_aerop,   &
-       toplwai_aerop, sollwai_aerop,   &
-       toplwad0_aerop, sollwad0_aerop, &
-       !pour Ecrad
-       topswad_aero_s2, solswad_aero_s2,   &
-       topswai_aero_s2, solswai_aero_s2,   &
-       topswad0_aero_s2, solswad0_aero_s2, &
-       topsw_aero_s2, topsw0_aero_s2,      &
-       solsw_aero_s2, solsw0_aero_s2,      &
-       topswcf_aero_s2, solswcf_aero_s2,   &
-       !LW diagnostics
-       toplwad_aero_s2, sollwad_aero_s2,   &
-       toplwai_aero_s2, sollwai_aero_s2,   &
-       toplwad0_aero_s2, sollwad0_aero_s2, &
-       !
-       ptstar, pt0, slp, &
-       !
-       bils, &
-       !
-       cldh, cldl,cldm, cldq, cldt,      &
-       JrNt,                             &
-       dthmin, evap, snowerosion,fder, plcl, plfc,   &
-       prw, prlw, prsw, prbsw, water_budget,         &
-       s_lcl, s_pblh, s_pblt, s_therm,   &
-       cdragm, cdragh,                   &
-       zustar, zu10m, zv10m, rh2m, qsat2m, &
-       zq2m, zt2m, zn2mout, weak_inversion, &
-       zt2m_min_mon, zt2m_max_mon,   &         ! pour calcul_divers.h
-       t2m_min_mon, t2m_max_mon,  &            ! pour calcul_divers.h
-       !
-       s_pblh_x, s_pblh_w, &
-       s_lcl_x, s_lcl_w,   &
-       !
-       slab_wfbils, tpot, tpote,               &
-       ue, uq, ve, vq, zxffonte,               &
-       uwat, vwat,                             &
-       zxfqcalving, zxfluxlat,                 &
-       zxrunofflic,                            &
-       zxtsol, snow_lsc, zxfqfonte, zxqsurf,   &
-       delta_qsurf,                            &
-       rain_lsc, rain_num,                     &
-       !
-       sens_x, sens_w, &
-       zxfluxlat_x, zxfluxlat_w, &
-       !
-       pbl_tke_input, pbl_eps, l_mix, wprime,&
-       t_therm, q_therm, u_therm, v_therm, &
-       cdragh_x, cdragh_w, &
-       cdragm_x, cdragm_w, &
-       kh, kh_x, kh_w, &
-       !
-       wake_k, &
-       alp_wake, & 
-       wake_h, wake_omg, &
-                       ! tendencies of delta T and delta q:
-       d_deltat_wk, d_deltaq_wk, &         ! due to wakes
-       d_deltat_wk_gw, d_deltaq_wk_gw, &   ! due to wake induced gravity waves
-       d_deltat_vdf, d_deltaq_vdf, &       ! due to vertical diffusion
-       d_deltat_the, d_deltaq_the, &       ! due to thermals
-       d_deltat_ajs_cv, d_deltaq_ajs_cv, & ! due to dry adjustment of (w) before convection
-                       ! tendencies of wake fractional area and wake number per unit area:
-       d_s_wk, d_s_a_wk, d_dens_wk,  d_dens_a_wk, &  ! due to wakes
-!!!       d_s_vdf, d_dens_a_vdf, d_dens_vdf, & ! due to vertical diffusion
-!!!       d_s_the, d_dens_a_the, d_dens_the, & ! due to thermals
-       !                                  
-       ptconv, ratqsc, &
-       wbeff, convoccur, zmax_th, &
-       sens, flwp, fiwp,  &
-       alp_bl_conv,alp_bl_det,  &
-       alp_bl_fluct_m,alp_bl_fluct_tke,  &
-       alp_bl_stat, n2, s2,  strig, zcong, zlcl_th, &
-       proba_notrig, random_notrig,  &
-!!       cv_gen,  &  !moved to phys_state_var_mod
-       !
-       dnwd0,  &
-       omega,  &
-       epmax_diag,  &
-       !    Deep convective variables used in phytrac
-       pmflxr, pmflxs,  &
-       wdtrainA, wdtrainS, wdtrainM,  &
-       upwd, dnwd, &
-       ep,  &
-       da, mp, &
-       phi, &
-       wght_cvfd, &
-       phi2, &
-       d1a, dam, &
-       ev, &
-       elij, &
-       qtaa, &
-       clw, &
-       epmlmMm, eplaMm, &
-       sij, &
-       !
-       rneblsvol, &
-       pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb,  &
-       distcltop, temp_cltop,  &
-       zqsatl, zqsats, &
-       qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
-       Tcontr, qcontr, qcontr2, fcontrN, fcontrP, &
-       cldemi,  &
-       cldfra, cldtau, fiwc,  &
-       fl, re, flwc,  &
-       ref_liq, ref_ice, theta,  &
-       ref_liq_pi, ref_ice_pi,  &
-       zphi, zx_rh, zx_rhl, zx_rhi,  &
-       pmfd, pmfu,  &
-       !
-       t2m, fluxlat,  &
-       fsollw, evap_pot,  &
-       fsolsw, wfbils, wfevap, &  
-       prfl, psfl,bsfl, fraca, Vprecip,  &
-       zw2,  &
-       !
-       fluxu, fluxv,  &
-       fluxt,  &
-       !
-       uwriteSTD, vwriteSTD, &                !pour calcul_STDlev.h
-       wwriteSTD, phiwriteSTD, &              !pour calcul_STDlev.h
-       qwriteSTD, twriteSTD, rhwriteSTD, &    !pour calcul_STDlev.h
-       ! 
-       beta_prec,  &
-       rneb,  &
-       zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic, &
-       zxfluxt,zxfluxq 
-       !
-       USE phys_local_var_mod, ONLY: zfice, dNovrN, ptconv
-       USE phys_output_var_mod, ONLY: scdnc, cldncl, reffclwtop, lcc, reffclws, &
-       reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra
-       USE output_physiqex_mod, ONLY: output_physiqex
-        USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
-
+    USE strataer_nuc_mod, ONLY : strataer_nuc_init
+    USE strataer_emiss_mod, ONLY : strataer_emiss_init
+    USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_STRATAER
+
+
+    !!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
+
+    USE physiqex_mod, ONLY : physiqex
+    USE phys_local_var_mod, ONLY : phys_local_var_init, phys_local_var_end, &
+            ! [Variables internes non sauvegardees de la physique]
+            ! Variables locales pour effectuer les appels en serie
+            t_seri, q_seri, ql_seri, qs_seri, qbs_seri, u_seri, v_seri, tr_seri, rneb_seri, &
+            rhcl, &
+            ! Dynamic tendencies (diagnostics)
+            d_t_dyn, d_q_dyn, d_ql_dyn, d_qs_dyn, d_qbs_dyn, d_u_dyn, d_v_dyn, d_tr_dyn, d_rneb_dyn, &
+            d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d, &
+            ! Physic tendencies
+            d_t_con, d_q_con, d_q_con_zmasse, d_u_con, d_v_con, &
+            d_tr, &                              !! to be removed?? (jyg)
+            d_t_wake, d_q_wake, &
+            d_t_lwr, d_t_lw0, d_t_swr, d_t_sw0, &
+            d_t_ajsb, d_q_ajsb, &
+            d_t_ajs, d_q_ajs, d_u_ajs, d_v_ajs, &
+            !       d_t_ajs_w,d_q_ajs_w, &
+            !       d_t_ajs_x,d_q_ajs_x, &
+
+            d_t_eva, d_q_eva, d_ql_eva, d_qi_eva, &
+            d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, &
+            d_t_lscst, d_q_lscst, &
+            d_t_lscth, d_q_lscth, &
+            plul_st, plul_th, &
+
+            d_t_vdf, d_q_vdf, d_qbs_vdf, d_u_vdf, d_v_vdf, d_t_diss, &
+            d_t_vdf_x, d_t_vdf_w, &
+            d_q_vdf_x, d_q_vdf_w, &
+            d_ts, &
+
+            d_t_bsss, d_q_bsss, d_qbs_bsss, &
+
+            !       d_t_oli,d_u_oli,d_v_oli, &
+            d_t_oro, d_u_oro, d_v_oro, &
+            d_t_oro_gw, d_u_oro_gw, d_v_oro_gw, &
+            d_t_lif, d_u_lif, d_v_lif, &
+            d_t_ec, &
+
+            du_gwd_hines, dv_gwd_hines, d_t_hin, &
+            dv_gwd_rando, dv_gwd_front, &
+            east_gwstress, west_gwstress, &
+            d_q_ch4, &
+            ! proprecip
+            qraindiag, qsnowdiag, &
+            dqreva, dqssub, &
+            dqrauto, dqrcol, dqrmelt, dqrfreez, &
+            dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez, &
+            !  Special RRTM
+            ZLWFT0_i, ZSWFT0_i, ZFLDN0, &
+            ZFLUP0, ZFSDN0, ZFSUP0, &
+
+            topswad_aero, solswad_aero, &
+            topswai_aero, solswai_aero, &
+            topswad0_aero, solswad0_aero, &
+            !LW additional
+            toplwad_aero, sollwad_aero, &
+            toplwai_aero, sollwai_aero, &
+            toplwad0_aero, sollwad0_aero, &
+            !pour Ecrad
+            topswad_aero_s2, solswad_aero_s2, &
+            topswai_aero_s2, solswai_aero_s2, &
+            topswad0_aero_s2, solswad0_aero_s2, &
+            topsw_aero_s2, topsw0_aero_s2, &
+            solsw_aero_s2, solsw0_aero_s2, &
+            topswcf_aero_s2, solswcf_aero_s2, &
+            !LW diagnostics
+            toplwad_aero_s2, sollwad_aero_s2, &
+            toplwai_aero_s2, sollwai_aero_s2, &
+            toplwad0_aero_s2, sollwad0_aero_s2, &
+
+            topsw_aero, solsw_aero, &
+            topsw0_aero, solsw0_aero, &
+            topswcf_aero, solswcf_aero, &
+            tausum_aero, tau3d_aero, &
+            drytausum_aero, &
+
+            !variables CFMIP2/CMIP5
+            topswad_aerop, solswad_aerop, &
+            topswai_aerop, solswai_aerop, &
+            topswad0_aerop, solswad0_aerop, &
+            topsw_aerop, topsw0_aerop, &
+            solsw_aerop, solsw0_aerop, &
+            topswcf_aerop, solswcf_aerop, &
+            !LW diagnostics
+            toplwad_aerop, sollwad_aerop, &
+            toplwai_aerop, sollwai_aerop, &
+            toplwad0_aerop, sollwad0_aerop, &
+            !pour Ecrad
+            topswad_aero_s2, solswad_aero_s2, &
+            topswai_aero_s2, solswai_aero_s2, &
+            topswad0_aero_s2, solswad0_aero_s2, &
+            topsw_aero_s2, topsw0_aero_s2, &
+            solsw_aero_s2, solsw0_aero_s2, &
+            topswcf_aero_s2, solswcf_aero_s2, &
+            !LW diagnostics
+            toplwad_aero_s2, sollwad_aero_s2, &
+            toplwai_aero_s2, sollwai_aero_s2, &
+            toplwad0_aero_s2, sollwad0_aero_s2, &
+
+            ptstar, pt0, slp, &
+
+            bils, &
+
+            cldh, cldl, cldm, cldq, cldt, &
+            JrNt, &
+            dthmin, evap, snowerosion, fder, plcl, plfc, &
+            prw, prlw, prsw, prbsw, water_budget, &
+            s_lcl, s_pblh, s_pblt, s_therm, &
+            cdragm, cdragh, &
+            zustar, zu10m, zv10m, rh2m, qsat2m, &
+            zq2m, zt2m, zn2mout, weak_inversion, &
+            zt2m_min_mon, zt2m_max_mon, &         ! pour calcul_divers.h
+            t2m_min_mon, t2m_max_mon, &            ! pour calcul_divers.h
+
+            s_pblh_x, s_pblh_w, &
+            s_lcl_x, s_lcl_w, &
+
+            slab_wfbils, tpot, tpote, &
+            ue, uq, ve, vq, zxffonte, &
+            uwat, vwat, &
+            zxfqcalving, zxfluxlat, &
+            zxrunofflic, &
+            zxtsol, snow_lsc, zxfqfonte, zxqsurf, &
+            delta_qsurf, &
+            rain_lsc, rain_num, &
+
+            sens_x, sens_w, &
+            zxfluxlat_x, zxfluxlat_w, &
+
+            pbl_tke_input, pbl_eps, l_mix, wprime, &
+            t_therm, q_therm, u_therm, v_therm, &
+            cdragh_x, cdragh_w, &
+            cdragm_x, cdragm_w, &
+            kh, kh_x, kh_w, &
+
+            wake_k, &
+            alp_wake, &
+            wake_h, wake_omg, &
+            ! tendencies of delta T and delta q:
+            d_deltat_wk, d_deltaq_wk, &         ! due to wakes
+            d_deltat_wk_gw, d_deltaq_wk_gw, &   ! due to wake induced gravity waves
+            d_deltat_vdf, d_deltaq_vdf, &       ! due to vertical diffusion
+            d_deltat_the, d_deltaq_the, &       ! due to thermals
+            d_deltat_ajs_cv, d_deltaq_ajs_cv, & ! due to dry adjustment of (w) before convection
+            ! tendencies of wake fractional area and wake number per unit area:
+            d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk, &  ! due to wakes
+            !!!       d_s_vdf, d_dens_a_vdf, d_dens_vdf, & ! due to vertical diffusion
+            !!!       d_s_the, d_dens_a_the, d_dens_the, & ! due to thermals
+
+            ptconv, ratqsc, &
+            wbeff, convoccur, zmax_th, &
+            sens, flwp, fiwp, &
+            alp_bl_conv, alp_bl_det, &
+            alp_bl_fluct_m, alp_bl_fluct_tke, &
+            alp_bl_stat, n2, s2, strig, zcong, zlcl_th, &
+            proba_notrig, random_notrig, &
+            !!       cv_gen,  &  !moved to phys_state_var_mod
+
+            dnwd0, &
+            omega, &
+            epmax_diag, &
+            !    Deep convective variables used in phytrac
+            pmflxr, pmflxs, &
+            wdtrainA, wdtrainS, wdtrainM, &
+            upwd, dnwd, &
+            ep, &
+            da, mp, &
+            phi, &
+            wght_cvfd, &
+            phi2, &
+            d1a, dam, &
+            ev, &
+            elij, &
+            qtaa, &
+            clw, &
+            epmlmMm, eplaMm, &
+            sij, &
+
+            rneblsvol, &
+            pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb, &
+            distcltop, temp_cltop, &
+            zqsatl, zqsats, &
+            qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
+            Tcontr, qcontr, qcontr2, fcontrN, fcontrP, &
+            cldemi, &
+            cldfra, cldtau, fiwc, &
+            fl, re, flwc, &
+            ref_liq, ref_ice, theta, &
+            ref_liq_pi, ref_ice_pi, &
+            zphi, zx_rh, zx_rhl, zx_rhi, &
+            pmfd, pmfu, &
+
+            t2m, fluxlat, &
+            fsollw, evap_pot, &
+            fsolsw, wfbils, wfevap, &
+            prfl, psfl, bsfl, fraca, Vprecip, &
+            zw2, &
+
+            fluxu, fluxv, &
+            fluxt, &
+
+            uwriteSTD, vwriteSTD, &                !pour calcul_STDlev.h
+            wwriteSTD, phiwriteSTD, &              !pour calcul_STDlev.h
+            qwriteSTD, twriteSTD, rhwriteSTD, &    !pour calcul_STDlev.h
+
+            beta_prec, &
+            rneb, &
+            zxsnow, snowhgt, qsnow, to_ice, sissnow, runoff, albsol3_lic, &
+            zxfluxt, zxfluxq
+
+    USE phys_local_var_mod, ONLY : zfice, dNovrN, ptconv
+    USE phys_output_var_mod, ONLY : scdnc, cldncl, reffclwtop, lcc, reffclws, &
+            reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra
+    USE output_physiqex_mod, ONLY : output_physiqex
+    USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_INCA
 
     IMPLICIT NONE
@@ -369,5 +360,5 @@
     !!AA                  -  uniformisation des parametrisations ds phytrac
     !!AA                  -  stockage des moyennes des champs necessaires
-    !!AA                     en mode traceur off-line 
+    !!AA                     en mode traceur off-line
     !!======================================================================
     !!   CLEFS CPP POUR LES IO
@@ -422,14 +413,14 @@
     !$OMP THREADPRIVATE(flag_volc_surfstrat)
     LOGICAL ok_cvl  ! pour activer le nouveau driver pour convection KE
-    PARAMETER (ok_cvl=.TRUE.)
+    PARAMETER (ok_cvl = .TRUE.)
     LOGICAL ok_gust ! pour activer l'effet des gust sur flux surface
-    PARAMETER (ok_gust=.FALSE.)
+    PARAMETER (ok_gust = .FALSE.)
     INTEGER, SAVE :: iflag_radia     ! active ou non le rayonnement (MPL)
     !$OMP THREADPRIVATE(iflag_radia)
     !======================================================================
     LOGICAL check ! Verifier la conservation du modele en eau
-    PARAMETER (check=.FALSE.)
+    PARAMETER (check = .FALSE.)
     LOGICAL ok_stratus ! Ajouter artificiellement les stratus
-    PARAMETER (ok_stratus=.FALSE.)
+    PARAMETER (ok_stratus = .FALSE.)
     !======================================================================
     REAL amn, amx
@@ -438,5 +429,5 @@
     ! Clef iflag_cycle_diurne controlant l'activation du cycle diurne:
     ! en attente du codage des cles par Fred
-    ! iflag_cycle_diurne est initialise par conf_phys et se trouve 
+    ! iflag_cycle_diurne est initialise par conf_phys et se trouve
     ! dans clesphys.h (IM)
     !======================================================================
@@ -462,30 +453,28 @@
     SAVE ok_journe
     !$OMP THREADPRIVATE(ok_journe)
-    !
+
     LOGICAL ok_mensuel ! sortir le fichier mensuel
     SAVE ok_mensuel
     !$OMP THREADPRIVATE(ok_mensuel)
-    !
+
     LOGICAL ok_instan ! sortir le fichier instantane
     SAVE ok_instan
     !$OMP THREADPRIVATE(ok_instan)
-    !
-    LOGICAL ok_LES ! sortir le fichier LES 
-    SAVE ok_LES                            
-    !$OMP THREADPRIVATE(ok_LES)                  
-    !
-    LOGICAL callstats ! sortir le fichier stats 
-    SAVE callstats                            
-    !$OMP THREADPRIVATE(callstats)                  
-    !
+
+    LOGICAL ok_LES ! sortir le fichier LES
+    SAVE ok_LES
+    !$OMP THREADPRIVATE(ok_LES)
+
+    LOGICAL callstats ! sortir le fichier stats
+    SAVE callstats
+    !$OMP THREADPRIVATE(callstats)
+
     LOGICAL ok_region ! sortir le fichier regional
-    PARAMETER (ok_region=.FALSE.)
+    PARAMETER (ok_region = .FALSE.)
     !======================================================================
     REAL seuil_inversion
     SAVE seuil_inversion
     !$OMP THREADPRIVATE(seuil_inversion)
-    
-    
-    
+
     real facteur
 
@@ -495,37 +484,37 @@
     INTEGER lmax_th(klon)
     INTEGER limbas(klon)
-    REAL ratqscth(klon,klev)
-    REAL ratqsdiff(klon,klev)
-    REAL zqsatth(klon,klev)
+    REAL ratqscth(klon, klev)
+    REAL ratqsdiff(klon, klev)
+    REAL zqsatth(klon, klev)
 
     !======================================================================
-    !
+
     ! indices de traceurs eau vapeur, liquide, glace, fraction nuageuse LS (optional), blowing snow (optional)
-    INTEGER,SAVE :: ivap, iliq, isol, irneb, ibs
-!$OMP THREADPRIVATE(ivap, iliq, isol, irneb, ibs)
-    !
-    !
+    INTEGER, SAVE :: ivap, iliq, isol, irneb, ibs
+    !$OMP THREADPRIVATE(ivap, iliq, isol, irneb, ibs)
+
+
     ! Variables argument:
-    !
+
     INTEGER nlon
     INTEGER nlev
-    REAL,INTENT(IN) :: pdtphys_
+    REAL, INTENT(IN) :: pdtphys_
     ! NB: pdtphys to be used in physics is in time_phylmdz_mod
     LOGICAL debut, lafin
-    REAL paprs(klon,klev+1)
-    REAL pplay(klon,klev)
-    REAL pphi(klon,klev)
+    REAL paprs(klon, klev + 1)
+    REAL pplay(klon, klev)
+    REAL pphi(klon, klev)
     REAL pphis(klon)
     REAL presnivs(klev)
-!JLD    REAL znivsig(klev)
-!JLD    real pir
-
-    REAL u(klon,klev)
-    REAL v(klon,klev)
-
-    REAL, intent(in):: rot(klon, klev)
+    !JLD    REAL znivsig(klev)
+    !JLD    real pir
+
+    REAL u(klon, klev)
+    REAL v(klon, klev)
+
+    REAL, intent(in) :: rot(klon, klev)
     ! relative vorticity, in s-1, needed for frontal waves
 
-    REAL t(klon,klev),thetal(klon,klev)
+    REAL t(klon, klev), thetal(klon, klev)
     ! thetal: ligne suivante a decommenter si vous avez les fichiers
     !     MPL 20130625
@@ -533,47 +522,47 @@
     ! sinon thetal=theta
     !     REAL fth_thetae,fth_thetav,fth_thetal
-    REAL qx(klon,klev,nqtot)
-    REAL flxmass_w(klon,klev)
-    REAL d_u(klon,klev)
-    REAL d_v(klon,klev)
-    REAL d_t(klon,klev)
-    REAL d_qx(klon,klev,nqtot)
+    REAL qx(klon, klev, nqtot)
+    REAL flxmass_w(klon, klev)
+    REAL d_u(klon, klev)
+    REAL d_v(klon, klev)
+    REAL d_t(klon, klev)
+    REAL d_qx(klon, klev, nqtot)
     REAL d_ps(klon)
-  ! variables pour tend_to_tke
-    REAL duadd(klon,klev)
-    REAL dvadd(klon,klev)
-    REAL dtadd(klon,klev)
-
-!!   Variables moved to phys_local_var_mod
-!!    ! Variables pour le transport convectif
-!!    real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
-!!    real wght_cvfd(klon,klev)
-!!    ! Variables pour le lessivage convectif
-!!    ! RomP >>> 
-!!    real phi2(klon,klev,klev)
-!!    real d1a(klon,klev),dam(klon,klev)
-!!    real ev(klon,klev)
-!!    real clw(klon,klev),elij(klon,klev,klev)
-!!    real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
-!!    ! RomP <<<
+    ! variables pour tend_to_tke
+    REAL duadd(klon, klev)
+    REAL dvadd(klon, klev)
+    REAL dtadd(klon, klev)
+
+    !!   Variables moved to phys_local_var_mod
+    !!    ! Variables pour le transport convectif
+    !!    real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
+    !!    real wght_cvfd(klon,klev)
+    !!    ! Variables pour le lessivage convectif
+    !!    ! RomP >>>
+    !!    real phi2(klon,klev,klev)
+    !!    real d1a(klon,klev),dam(klon,klev)
+    !!    real ev(klon,klev)
+    !!    real clw(klon,klev),elij(klon,klev,klev)
+    !!    real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
+    !!    ! RomP <<<
     !IM definition dynamique o_trac dans phys_output_open
     !      type(ctrl_out) :: o_trac(nqtot)
 
     ! variables a une pression donnee
-    !
+
     include "declare_STDlev.h"
-    !
-    !
+
+
     include "radepsi.h"
     include "radopt.h"
-    !
-    !
+
+
     INTEGER n
     !ym      INTEGER npoints
-    !ym      PARAMETER(npoints=klon) 
-    !
+    !ym      PARAMETER(npoints=klon)
+
     INTEGER nregISCtot
-    PARAMETER(nregISCtot=1) 
-    !
+    PARAMETER(nregISCtot = 1)
+
     ! imin_debut, nbpti, jmin_debut, nbptj : parametres pour sorties
     ! sur 1 region rectangulaire y compris pour 1 point
@@ -582,36 +571,35 @@
     ! jmin_debut : indice minimum de j; nbptj : nombre de points en
     ! direction j (latitude)
-!JLD    INTEGER imin_debut, nbpti
-!JLD    INTEGER jmin_debut, nbptj 
+    !JLD    INTEGER imin_debut, nbpti
+    !JLD    INTEGER jmin_debut, nbptj
     !IM: region='3d' <==> sorties en global
     CHARACTER*3 region
-    PARAMETER(region='3d')
+    PARAMETER(region = '3d')
     LOGICAL ok_hf
-    !
+
     SAVE ok_hf
     !$OMP THREADPRIVATE(ok_hf)
 
-    INTEGER, PARAMETER :: longcles=20
+    INTEGER, PARAMETER :: longcles = 20
     REAL, SAVE :: clesphy0(longcles)
     !$OMP THREADPRIVATE(clesphy0)
-    !
+
     ! Variables propres a la physique
     INTEGER, SAVE :: itap         ! compteur pour la physique
     !$OMP THREADPRIVATE(itap)
 
-    INTEGER, SAVE :: abortphy=0   ! Reprere si on doit arreter en fin de phys
+    INTEGER, SAVE :: abortphy = 0   ! Reprere si on doit arreter en fin de phys
     !$OMP THREADPRIVATE(abortphy)
-    !
-    REAL,SAVE ::  solarlong0
+
+    REAL, SAVE :: solarlong0
     !$OMP THREADPRIVATE(solarlong0)
 
-    !
     !  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
-    !
+
     !IM 141004     REAL zulow(klon),zvlow(klon),zustr(klon), zvstr(klon)
-    REAL zulow(klon),zvlow(klon)
-    !
-    INTEGER igwd,idx(klon),itest(klon)
-    !
+    REAL zulow(klon), zvlow(klon)
+
+    INTEGER igwd, idx(klon), itest(klon)
+
     !      REAL,allocatable,save :: run_off_lic_0(:)
     ! !$OMP THREADPRIVATE(run_off_lic_0)
@@ -619,11 +607,11 @@
     !KE43
     ! Variables liees a la convection de K. Emanuel (sb):
-    !
+
     REAL, SAVE :: bas, top             ! cloud base and top levels
     !$OMP THREADPRIVATE(bas, top)
     !------------------------------------------------------------------
     ! Upmost level reached by deep convection and related variable (jyg)
-    !
-!    INTEGER izero
+
+    !    INTEGER izero
     INTEGER k_upper_cv
     !------------------------------------------------------------------
@@ -632,5 +620,5 @@
     SAVE Ncvpaseq1
     !$OMP THREADPRIVATE(Ncvpaseq1)
-    !
+
     !==========================================================================
     !CR04.12.07: on ajoute les nouvelles variables du nouveau schema
@@ -638,25 +626,25 @@
     ! Variables li\'ees \`a la poche froide (jyg)
 
-!!    REAL mipsh(klon,klev)  ! mass flux shed by the adiab ascent at each level
-!!      Moved to phys_state_var_mod
-    !
+    !!    REAL mipsh(klon,klev)  ! mass flux shed by the adiab ascent at each level
+    !!      Moved to phys_state_var_mod
+
     REAL wape_prescr, fip_prescr
     INTEGER it_wape_prescr
     SAVE wape_prescr, fip_prescr, it_wape_prescr
     !$OMP THREADPRIVATE(wape_prescr, fip_prescr, it_wape_prescr)
-    !
+
     ! variables supplementaires de concvl
-    REAL Tconv(klon,klev)
-!!    variable moved to phys_local_var_mod
-!!    REAL sij(klon,klev,klev)
-!!    !
-!!    ! variables pour tester la conservation de l'energie dans concvl
-!!    REAL, DIMENSION(klon,klev)     :: d_t_con_sat
-!!    REAL, DIMENSION(klon,klev)     :: d_q_con_sat
-!!    REAL, DIMENSION(klon,klev)     :: dql_sat
-
-    REAL, SAVE :: alp_bl_prescr=0.
-    REAL, SAVE :: ale_bl_prescr=0.
-    REAL, SAVE :: wake_s_min_lsp=0.1
+    REAL Tconv(klon, klev)
+    !!    variable moved to phys_local_var_mod
+    !!    REAL sij(klon,klev,klev)
+    !!    !
+    !!    ! variables pour tester la conservation de l'energie dans concvl
+    !!    REAL, DIMENSION(klon,klev)     :: d_t_con_sat
+    !!    REAL, DIMENSION(klon,klev)     :: d_q_con_sat
+    !!    REAL, DIMENSION(klon,klev)     :: dql_sat
+
+    REAL, SAVE :: alp_bl_prescr = 0.
+    REAL, SAVE :: ale_bl_prescr = 0.
+    REAL, SAVE :: wake_s_min_lsp = 0.1
     !$OMP THREADPRIVATE(alp_bl_prescr,ale_bl_prescr)
     !$OMP THREADPRIVATE(wake_s_min_lsp)
@@ -667,79 +655,77 @@
     ! Variables li\'ees \`a la poche froide (jyg et rr)
 
-    INTEGER,  SAVE               :: iflag_wake_tend  ! wake: if =0, then wake state variables are
-                                                     ! updated within calwake
+    INTEGER, SAVE :: iflag_wake_tend  ! wake: if =0, then wake state variables are
+    ! updated within calwake
     !$OMP THREADPRIVATE(iflag_wake_tend)
-    INTEGER,  SAVE               :: iflag_alp_wk_cond=0 ! wake: if =0, then Alp_wk is the average lifting
-                                                        ! power provided by the wakes; else, Alp_wk is the
-                                                        ! lifting power conditionned on the presence of a 
-                                                        ! gust-front in the grid cell.
+    INTEGER, SAVE :: iflag_alp_wk_cond = 0 ! wake: if =0, then Alp_wk is the average lifting
+    ! power provided by the wakes; else, Alp_wk is the
+    ! lifting power conditionned on the presence of a
+    ! gust-front in the grid cell.
     !$OMP THREADPRIVATE(iflag_alp_wk_cond)
 
-    REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region
-    REAL t_x(klon,klev),q_x(klon,klev) ! temperature and moisture profiles in the off-wake region
-
-    REAL wake_dth(klon,klev)        ! wake : temp pot difference
-
-    REAL wake_omgbdth(klon,klev)    ! Wake : flux of Delta_Theta
+    REAL t_w(klon, klev), q_w(klon, klev) ! temperature and moisture profiles in the wake region
+    REAL t_x(klon, klev), q_x(klon, klev) ! temperature and moisture profiles in the off-wake region
+
+    REAL wake_dth(klon, klev)        ! wake : temp pot difference
+
+    REAL wake_omgbdth(klon, klev)    ! Wake : flux of Delta_Theta
     ! transported by LS omega
-    REAL wake_dp_omgb(klon,klev)    ! Wake : vertical gradient of
+    REAL wake_dp_omgb(klon, klev)    ! Wake : vertical gradient of
     ! large scale omega
-    REAL wake_dtKE(klon,klev)       ! Wake : differential heating
+    REAL wake_dtKE(klon, klev)       ! Wake : differential heating
     ! (wake - unpertubed) CONV
-    REAL wake_dqKE(klon,klev)       ! Wake : differential moistening
+    REAL wake_dqKE(klon, klev)       ! Wake : differential moistening
     ! (wake - unpertubed) CONV
-    REAL wake_dp_deltomg(klon,klev) ! Wake : gradient vertical de wake_omg
-    REAL wake_spread(klon,klev)     ! spreading term in wake_delt
-    !
+    REAL wake_dp_deltomg(klon, klev) ! Wake : gradient vertical de wake_omg
+    REAL wake_spread(klon, klev)     ! spreading term in wake_delt
+
     !pourquoi y'a pas de save??
-    !
-!!!    INTEGER, SAVE, DIMENSION(klon)   :: wake_k
-!!!    !$OMP THREADPRIVATE(wake_k) 
-    !
+
+    !!!    INTEGER, SAVE, DIMENSION(klon)   :: wake_k
+    !!!    !$OMP THREADPRIVATE(wake_k)
+
     !jyg<
-    !cc      REAL wake_pe(klon)              ! Wake potential energy - WAPE 
+    !cc      REAL wake_pe(klon)              ! Wake potential energy - WAPE
     !>jyg
 
     REAL wake_fip_0(klon)           ! Average Front Incoming Power (unconditionned)
     REAL wake_gfl(klon)             ! Gust Front Length
-!!!    REAL wake_dens(klon)         ! moved to phys_state_var_mod
-    !
-    !
-    REAL dt_dwn(klon,klev)
-    REAL dq_dwn(klon,klev)
-    REAL M_dwn(klon,klev)
-    REAL M_up(klon,klev)
-    REAL dt_a(klon,klev)
-    REAL dq_a(klon,klev)
-    REAL d_t_adjwk(klon,klev)                !jyg
-    REAL d_q_adjwk(klon,klev)                !jyg
-    LOGICAL,SAVE :: ok_adjwk=.FALSE.
-    !$OMP THREADPRIVATE(ok_adjwk) 
-    INTEGER,SAVE :: iflag_adjwk=0            !jyg
+    !!!    REAL wake_dens(klon)         ! moved to phys_state_var_mod
+
+
+    REAL dt_dwn(klon, klev)
+    REAL dq_dwn(klon, klev)
+    REAL M_dwn(klon, klev)
+    REAL M_up(klon, klev)
+    REAL dt_a(klon, klev)
+    REAL dq_a(klon, klev)
+    REAL d_t_adjwk(klon, klev)                !jyg
+    REAL d_q_adjwk(klon, klev)                !jyg
+    LOGICAL, SAVE :: ok_adjwk = .FALSE.
+    !$OMP THREADPRIVATE(ok_adjwk)
+    INTEGER, SAVE :: iflag_adjwk = 0            !jyg
     !$OMP THREADPRIVATE(iflag_adjwk)         !jyg
-    REAL,SAVE :: oliqmax=999.,oicemax=999.
-    !$OMP THREADPRIVATE(oliqmax,oicemax) 
+    REAL, SAVE :: oliqmax = 999., oicemax = 999.
+    !$OMP THREADPRIVATE(oliqmax,oicemax)
     REAL, SAVE :: alp_offset
     !$OMP THREADPRIVATE(alp_offset)
-    REAL, SAVE :: dtcon_multistep_max=1.e6
+    REAL, SAVE :: dtcon_multistep_max = 1.e6
     !$OMP THREADPRIVATE(dtcon_multistep_max)
-    REAL, SAVE :: dqcon_multistep_max=1.e6
+    REAL, SAVE :: dqcon_multistep_max = 1.e6
     !$OMP THREADPRIVATE(dqcon_multistep_max)
 
-  
-    !
     !RR:fin declarations poches froides
     !==========================================================================
 
-    REAL ztv(klon,klev),ztva(klon,klev)
-    REAL zpspsk(klon,klev)
-    REAL ztla(klon,klev),zqla(klon,klev) 
-    REAL zthl(klon,klev)
+    REAL ztv(klon, klev), ztva(klon, klev)
+    REAL zpspsk(klon, klev)
+    REAL ztla(klon, klev), zqla(klon, klev)
+    REAL zthl(klon, klev)
 
     !cc nrlmd le 10/04/2012
 
     !--------Stochastic Boundary Layer Triggering: ALE_BL--------
-    !---Propri\'et\'es du thermiques au LCL 
-!    real zlcl_th(klon)          ! Altitude du LCL calcul\'e
+    !---Propri\'et\'es du thermiques au LCL
+    !    real zlcl_th(klon)          ! Altitude du LCL calcul\'e
     ! continument (pcon dans
     ! thermcell_main.F90)
@@ -747,28 +733,28 @@
     real w0(klon)               ! Vitesse des thermiques au LCL
     real w_conv(klon)           ! Vitesse verticale de grande \'echelle au LCL
-    real tke0(klon,klev+1)      ! TKE au d\'ebut du pas de temps
-    real therm_tke_max0(klon)   ! TKE dans les thermiques au LCL 
-    real env_tke_max0(klon)     ! TKE dans l'environnement au LCL 
+    real tke0(klon, klev + 1)      ! TKE au d\'ebut du pas de temps
+    real therm_tke_max0(klon)   ! TKE dans les thermiques au LCL
+    real env_tke_max0(klon)     ! TKE dans l'environnement au LCL
     INTEGER, SAVE :: iflag_thermcell_tke ! transtport TKE by thermals
     !$OMP THREADPRIVATE(iflag_thermcell_tke)
 
-!JLD    !---D\'eclenchement stochastique
-!JLD    integer :: tau_trig(klon)
-
-    REAL,SAVE :: random_notrig_max=1.
-    !$OMP THREADPRIVATE(random_notrig_max) 
+    !JLD    !---D\'eclenchement stochastique
+    !JLD    integer :: tau_trig(klon)
+
+    REAL, SAVE :: random_notrig_max = 1.
+    !$OMP THREADPRIVATE(random_notrig_max)
 
     !--------Statistical Boundary Layer Closure: ALP_BL--------
     !---Profils de TKE dans et hors du thermique
-    real therm_tke_max(klon,klev)   ! Profil de TKE dans les thermiques
-    real env_tke_max(klon,klev)     ! Profil de TKE dans l'environnement
+    real therm_tke_max(klon, klev)   ! Profil de TKE dans les thermiques
+    real env_tke_max(klon, klev)     ! Profil de TKE dans l'environnement
 
     !-------Activer les tendances de TKE due a l'orograp??ie---------
-     INTEGER, SAVE :: addtkeoro
-    !$OMP THREADPRIVATE(addtkeoro) 
-     REAL, SAVE :: alphatkeoro
-    !$OMP THREADPRIVATE(alphatkeoro) 
-     LOGICAL, SAVE :: smallscales_tkeoro
-    !$OMP THREADPRIVATE(smallscales_tkeoro) 
+    INTEGER, SAVE :: addtkeoro
+    !$OMP THREADPRIVATE(addtkeoro)
+    REAL, SAVE :: alphatkeoro
+    !$OMP THREADPRIVATE(alphatkeoro)
+    LOGICAL, SAVE :: smallscales_tkeoro
+    !$OMP THREADPRIVATE(smallscales_tkeoro)
 
 
@@ -777,13 +763,13 @@
 
     ! Variables locales pour la couche limite (al1):
-    !
+
     !Al1      REAL pblh(klon)           ! Hauteur de couche limite
     !Al1      SAVE pblh
     !34EK
-    !
+
     ! Variables locales:
-    !
+
     !AA
-    !AA  Pour phytrac 
+    !AA  Pour phytrac
     REAL u1(klon)             ! vents dans la premiere couche U
     REAL v1(klon)             ! vents dans la premiere couche V
@@ -792,46 +778,44 @@
     !@$$      PARAMETER (offline=.false.)
     !@$$      INTEGER physid
-    REAL frac_impa(klon,klev) ! fractions d'aerosols lessivees (impaction)
-    REAL frac_nucl(klon,klev) ! idem (nucleation)
-    ! RomP >>> 
-    REAL beta_prec_fisrt(klon,klev) ! taux de conv de l'eau cond (fisrt)
+    REAL frac_impa(klon, klev) ! fractions d'aerosols lessivees (impaction)
+    REAL frac_nucl(klon, klev) ! idem (nucleation)
+    ! RomP >>>
+    REAL beta_prec_fisrt(klon, klev) ! taux de conv de l'eau cond (fisrt)
     ! RomP <<<
 
     !IM cf FH pour Tiedtke 080604
-    REAL rain_tiedtke(klon),snow_tiedtke(klon)
-    !
+    REAL rain_tiedtke(klon), snow_tiedtke(klon)
+
     !IM 050204 END
     REAL devap(klon) ! evaporation et sa derivee
     REAL dsens(klon) ! chaleur sensible et sa derivee
 
-    !
     ! Conditions aux limites
-    !
-    !
+
+
     REAL :: day_since_equinox
     ! Date de l'equinoxe de printemps
-    INTEGER, parameter :: mth_eq=3, day_eq=21
+    INTEGER, parameter :: mth_eq = 3, day_eq = 21
     REAL :: jD_eq
 
     LOGICAL, parameter :: new_orbit = .TRUE.
 
-    !
     INTEGER lmt_pas
     SAVE lmt_pas                ! frequence de mise a jour
-    !$OMP THREADPRIVATE(lmt_pas) 
-    real zmasse(klon, nbp_lev),exner(klon, nbp_lev) 
+    !$OMP THREADPRIVATE(lmt_pas)
+    real zmasse(klon, nbp_lev), exner(klon, nbp_lev)
     !     (column-density of mass of air in a cell, in kg m-2)
-    real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
+    real, parameter :: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
 
     !IM sorties
     REAL un_jour
-    PARAMETER(un_jour=86400.)
+    PARAMETER(un_jour = 86400.)
     INTEGER itapm1 !pas de temps de la physique du(es) mois precedents
     SAVE itapm1    !mis a jour le dernier pas de temps du mois en cours
     !$OMP THREADPRIVATE(itapm1)
     !======================================================================
-    !
+
     ! Declaration des procedures appelees
-    !
+
     EXTERNAL angle     ! calculer angle zenithal du soleil
     EXTERNAL alboc     ! calculer l'albedo sur ocean
@@ -854,22 +838,22 @@
     ! moyenne globale d'1 var ponderee par l'aire de la maille (moyglo_pondaire)
     ! par la masse/airetot (moyglo_pondaima) et la vraie masse (moyglo_pondmass)
-    !
-    !
+
+
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     ! Local variables
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !
-!    REAL rhcl(klon,klev)    ! humiditi relative ciel clair
-    REAL dialiq(klon,klev)  ! eau liquide nuageuse
-    REAL diafra(klon,klev)  ! fraction nuageuse
-    REAL radocond(klon,klev)  ! eau condensee nuageuse
-    !
-    !XXX PB 
-    REAL fluxq(klon,klev, nbsrf)   ! flux turbulent d'humidite
-    REAL fluxqbs(klon,klev, nbsrf)   ! flux turbulent de neige soufflee
-    !
+
+    !    REAL rhcl(klon,klev)    ! humiditi relative ciel clair
+    REAL dialiq(klon, klev)  ! eau liquide nuageuse
+    REAL diafra(klon, klev)  ! fraction nuageuse
+    REAL radocond(klon, klev)  ! eau condensee nuageuse
+
+    !XXX PB
+    REAL fluxq(klon, klev, nbsrf)   ! flux turbulent d'humidite
+    REAL fluxqbs(klon, klev, nbsrf)   ! flux turbulent de neige soufflee
+
     !FC    REAL zxfluxt(klon, klev)
     !FC    REAL zxfluxq(klon, klev)
-    REAL zxfluxqbs(klon,klev)
+    REAL zxfluxqbs(klon, klev)
     REAL zxfluxu(klon, klev)
     REAL zxfluxv(klon, klev)
@@ -880,34 +864,34 @@
     !ym      SAVE  sollwdownclr, toplwdown, toplwdownclr
     !ym      SAVE  topsw0,toplw0,solsw0,sollw0, heat0, cool0
-    !
+
     INTEGER itaprad
     SAVE itaprad
     !$OMP THREADPRIVATE(itaprad)
-    !
-    REAL conv_q(klon,klev) ! convergence de l'humidite (kg/kg/s)
-    REAL conv_t(klon,klev) ! convergence de la temperature(K/s)
-    !
+
+    REAL conv_q(klon, klev) ! convergence de l'humidite (kg/kg/s)
+    REAL conv_t(klon, klev) ! convergence de la temperature(K/s)
+
     REAL zsav_tsol(klon)
-    !
+
     REAL dist, rmu0(klon), fract(klon)
     REAL zrmu0(klon), zfract(klon)
     REAL zdtime, zdtime1, zdtime2, zlongi
-    !
+
     REAL z_avant(klon), z_apres(klon), z_factor(klon)
     LOGICAL zx_ajustq
-    !
+
     REAL za
     REAL zx_t, zx_qs, zdelta, zcor
-    real zqsat(klon,klev)
-    !
+    real zqsat(klon, klev)
+
     INTEGER i, k, iq, nsrf, l, itr
-    !
+
     REAL t_coup
-    PARAMETER (t_coup=234.0)
+    PARAMETER (t_coup = 234.0)
 
     !ym A voir plus tard !!
     !ym      REAL zx_relief(iim,jjmp1)
     !ym      REAL zx_aire(iim,jjmp1)
-    !
+
     ! Grandeurs de sorties
     REAL s_capCL(klon)
@@ -918,8 +902,8 @@
     ! La convection n'est pas calculee tous les pas, il faut donc
     !                      sauvegarder les sorties de la convection
-    !ym      SAVE  
-    !ym      SAVE  
-    !ym      SAVE  
-    !
+    !ym      SAVE
+    !ym      SAVE
+    !ym      SAVE
+
     INTEGER itapcv, itapwk
     SAVE itapcv, itapwk
@@ -929,5 +913,5 @@
     ! Variables locales pour la convection de K. Emanuel (sb):
 
-    REAL tvp(klon,klev)       ! virtual temp of lifted parcel
+    REAL tvp(klon, klev)       ! virtual temp of lifted parcel
     CHARACTER*40 capemaxcels  !max(CAPE)
 
@@ -937,5 +921,5 @@
     ! -- convect43:
     INTEGER ntra              ! nb traceurs pour convect4.3
-    REAL dtvpdt1(klon,klev), dtvpdq1(klon,klev)
+    REAL dtvpdt1(klon, klev), dtvpdq1(klon, klev)
     REAL dplcldt(klon), dplcldr(klon)
     !?     .     condm_con(klon,klev),conda_con(klon,klev),
@@ -944,7 +928,7 @@
     ! --
     !34EK
-    !
+
     ! Variables du changement
-    !
+
     ! con: convection
     ! lsc: condensation a grande echelle (Large-Scale-Condensation)
@@ -952,26 +936,26 @@
     ! eva: evaporation de l'eau liquide nuageuse
     ! vdf: couche limite (Vertical DiFfusion)
-    !
+
     ! tendance nulles
-    REAL, dimension(klon,klev):: du0, dv0, dt0, dq0, dql0, dqi0, dqbs0
-    REAL, dimension(klon)     :: dsig0, ddens0
-    INTEGER, dimension(klon)  :: wkoccur1
+    REAL, dimension(klon, klev) :: du0, dv0, dt0, dq0, dql0, dqi0, dqbs0
+    REAL, dimension(klon) :: dsig0, ddens0
+    INTEGER, dimension(klon) :: wkoccur1
     ! tendance buffer pour appel de add_phys_tend
-    REAL, DIMENSION(klon,klev)  :: d_q_ch4_dtime
-    !
-    ! Flag pour pouvoir ne pas ajouter les tendances. 
+    REAL, DIMENSION(klon, klev) :: d_q_ch4_dtime
+
+    ! Flag pour pouvoir ne pas ajouter les tendances.
     ! Par defaut, les tendances doivente etre ajoutees et
     ! flag_inhib_tend = 0
-    ! flag_inhib_tend > 0 : tendances non ajoutees, avec un nombre 
+    ! flag_inhib_tend > 0 : tendances non ajoutees, avec un nombre
     ! croissant de print quand la valeur du flag augmente
     !!! attention, ce flag doit etre change avec prudence !!!
     INTEGER :: flag_inhib_tend = 0 !  0 is the default value
-!!    INTEGER :: flag_inhib_tend = 2
-    !
-    ! Logical switch to a bug : reseting to 0 convective variables at the 
+    !!    INTEGER :: flag_inhib_tend = 2
+
+    ! Logical switch to a bug : reseting to 0 convective variables at the
     ! begining of physiq.
     LOGICAL, SAVE :: ok_bug_cv_trac = .TRUE.
     !$OMP THREADPRIVATE(ok_bug_cv_trac)
-    !
+
     ! Logical switch to a bug : changing wake_deltat when thermals are active
     ! even when there are no wakes.
@@ -979,10 +963,9 @@
     !$OMP THREADPRIVATE(ok_bug_split_th)
 
-    ! Logical switch to a bug : modifying directly wake_deltat  by adding 
+    ! Logical switch to a bug : modifying directly wake_deltat  by adding
     ! the (w) dry adjustment tendency to wake_deltat
     LOGICAL, SAVE :: ok_bug_ajs_cv = .TRUE.
     !$OMP THREADPRIVATE(ok_bug_ajs_cv)
 
-    !
     !********************************************************
     !     declarations
@@ -990,13 +973,13 @@
     !********************************************************
     !IM 081204 END
-    !
-    REAL pen_u(klon,klev), pen_d(klon,klev)
-    REAL pde_u(klon,klev), pde_d(klon,klev)
+
+    REAL pen_u(klon, klev), pen_d(klon, klev)
+    REAL pde_u(klon, klev), pde_d(klon, klev)
     INTEGER kcbot(klon), kctop(klon), kdtop(klon)
-    !
-    REAL ratqsbas,ratqshaut,tau_ratqs
-    SAVE ratqsbas,ratqshaut,tau_ratqs
+
+    REAL ratqsbas, ratqshaut, tau_ratqs
+    SAVE ratqsbas, ratqshaut, tau_ratqs
     !$OMP THREADPRIVATE(ratqsbas,ratqshaut,tau_ratqs)
-    REAL, SAVE :: ratqsp0=50000., ratqsdp=20000.
+    REAL, SAVE :: ratqsp0 = 50000., ratqsdp = 20000.
     !$OMP THREADPRIVATE(ratqsp0, ratqsdp)
 
@@ -1010,34 +993,34 @@
     INTEGER, SAVE :: iflag_cld_th
     !$OMP THREADPRIVATE(iflag_cld_th)
-!IM logical ptconv(klon,klev)  !passe dans phys_local_var_mod
+    !IM logical ptconv(klon,klev)  !passe dans phys_local_var_mod
     !IM cf. AM 081204 BEG
-    LOGICAL ptconvth(klon,klev)
-
-    REAL picefra(klon,klev)
+    LOGICAL ptconvth(klon, klev)
+
+    REAL picefra(klon, klev)
     REAL zrel_oro(klon)
     !IM cf. AM 081204 END
-    !
+
     ! Variables liees a l'ecriture de la bande histoire physique
-    !
+
     !======================================================================
-    !
-    !
-!JLD    integer itau_w   ! pas de temps ecriture = itap + itau_phy
-    !
-    !
+
+
+    !JLD    integer itau_w   ! pas de temps ecriture = itap + itau_phy
+
+
     ! Variables locales pour effectuer les appels en serie
-    !
+
     !IM RH a 2m (la surface)
     REAL Lheat
 
     INTEGER        length
-    PARAMETER    ( length = 100 )
-    REAL tabcntr0( length       )
-    !
-!JLD    INTEGER ndex2d(nbp_lon*nbp_lat)
+    PARAMETER    (length = 100)
+    REAL tabcntr0(length)
+
+    !JLD    INTEGER ndex2d(nbp_lon*nbp_lat)
     !IM
-    !
+
     !IM AMIP2 BEG
-!JLD    REAL moyglo, mountor
+    !JLD    REAL moyglo, mountor
     !IM 141004 BEG
     REAL zustrdr(klon), zvstrdr(klon)
@@ -1053,41 +1036,41 @@
     !  REAL airedyn(nbp_lon+1,nbp_lat)
     !IM 190504 END
-!JLD    LOGICAL ok_msk
-!JLD    REAL msk(klon)
+    !JLD    LOGICAL ok_msk
+    !JLD    REAL msk(klon)
     !ym A voir plus tard
     !ym      REAL zm_wo(jjmp1, klev)
     !IM AMIP2 END
-    !
+
     REAL zx_tmp_fi2d(klon)      ! variable temporaire grille physique
-    REAL zx_tmp_fi3d(klon,klev) ! variable temporaire pour champs 3D 
-!JLD    REAL zx_tmp_2d(nbp_lon,nbp_lat)
-!JLD    REAL zx_lon(nbp_lon,nbp_lat)
-!JLD    REAL zx_lat(nbp_lon,nbp_lat)
-    !
+    REAL zx_tmp_fi3d(klon, klev) ! variable temporaire pour champs 3D
+    !JLD    REAL zx_tmp_2d(nbp_lon,nbp_lat)
+    !JLD    REAL zx_lon(nbp_lon,nbp_lat)
+    !JLD    REAL zx_lat(nbp_lon,nbp_lat)
+
     INTEGER nid_ctesGCM
     SAVE nid_ctesGCM
     !$OMP THREADPRIVATE(nid_ctesGCM)
-    !
+
     !IM 280405 BEG
     !  INTEGER nid_bilKPins, nid_bilKPave
     !  SAVE nid_bilKPins, nid_bilKPave
     !  !$OMP THREADPRIVATE(nid_bilKPins, nid_bilKPave)
-    !
-    REAL ve_lay(klon,klev) ! transport meri. de l'energie a chaque niveau vert.
-    REAL vq_lay(klon,klev) ! transport meri. de l'eau a chaque niveau vert.
-    REAL ue_lay(klon,klev) ! transport zonal de l'energie a chaque niveau vert.
-    REAL uq_lay(klon,klev) ! transport zonal de l'eau a chaque niveau vert.
-    !
-!JLD    REAL zjulian
-!JLD    SAVE zjulian
-!JLD!$OMP THREADPRIVATE(zjulian)
-
-!JLD    INTEGER nhori, nvert
-!JLD    REAL zsto
-!JLD    REAL zstophy, zout
-
-    CHARACTER (LEN=20) :: modname='physiq_mod'
+
+    REAL ve_lay(klon, klev) ! transport meri. de l'energie a chaque niveau vert.
+    REAL vq_lay(klon, klev) ! transport meri. de l'eau a chaque niveau vert.
+    REAL ue_lay(klon, klev) ! transport zonal de l'energie a chaque niveau vert.
+    REAL uq_lay(klon, klev) ! transport zonal de l'eau a chaque niveau vert.
+
+    !JLD    REAL zjulian
+    !JLD    SAVE zjulian
+    !JLD!$OMP THREADPRIVATE(zjulian)
+
+    !JLD    INTEGER nhori, nvert
+    !JLD    REAL zsto
+    !JLD    REAL zstophy, zout
+
+    CHARACTER (LEN = 20) :: modname = 'physiq_mod'
     CHARACTER*80 abort_message
-    LOGICAL, SAVE ::  ok_sync, ok_sync_omp
+    LOGICAL, SAVE :: ok_sync, ok_sync_omp
     !$OMP THREADPRIVATE(ok_sync)
     REAL date0
@@ -1095,27 +1078,27 @@
     ! essai writephys
     INTEGER fid_day, fid_mth, fid_ins
-    PARAMETER (fid_ins = 1, fid_day = 2, fid_mth = 3) 
+    PARAMETER (fid_ins = 1, fid_day = 2, fid_mth = 3)
     INTEGER prof2d_on, prof3d_on, prof2d_av, prof3d_av
     PARAMETER (prof2d_on = 1, prof3d_on = 2, prof2d_av = 3, prof3d_av = 4)
     REAL ztsol(klon)
-    REAL q2m(klon,nbsrf)  ! humidite a 2m
-    REAL fsnowerosion(klon,nbsrf) ! blowing snow flux at surface
+    REAL q2m(klon, nbsrf)  ! humidite a 2m
+    REAL fsnowerosion(klon, nbsrf) ! blowing snow flux at surface
     REAL qbsfra  ! blowing snow fraction
     !IM: t2m, q2m, ustar, u10m, v10m et t2mincels, t2maxcels
     CHARACTER*40 t2mincels, t2maxcels       !t2m min., t2m max
     CHARACTER*40 tinst, tave
-    REAL cldtaupi(klon,klev) ! Cloud optical thickness for
+    REAL cldtaupi(klon, klev) ! Cloud optical thickness for
     ! pre-industrial (pi) aerosols
 
     INTEGER :: naero
     ! Aerosol optical properties
-    CHARACTER*4, DIMENSION(naero_grp) :: rfname 
-    REAL, DIMENSION(klon,klev)     :: mass_solu_aero ! total mass
+    CHARACTER*4, DIMENSION(naero_grp) :: rfname
+    REAL, DIMENSION(klon, klev) :: mass_solu_aero ! total mass
     ! concentration
     ! for all soluble
     ! aerosols[ug/m3]
-    REAL, DIMENSION(klon,klev)     :: mass_solu_aero_pi
+    REAL, DIMENSION(klon, klev) :: mass_solu_aero_pi
     ! - " - (pre-industrial value)
-    REAL, DIMENSION(klon,klev,naero_tot) :: m_allaer
+    REAL, DIMENSION(klon, klev, naero_tot) :: m_allaer
 
     ! Parameters
@@ -1128,17 +1111,17 @@
     LOGICAL, SAVE :: aerosol_couple ! true  : calcul des aerosols dans INCA
     ! false : lecture des aerosol dans un fichier
-    !$OMP THREADPRIVATE(aerosol_couple)    
-    LOGICAL, SAVE :: chemistry_couple ! true  : use INCA chemistry O3 
+    !$OMP THREADPRIVATE(aerosol_couple)
+    LOGICAL, SAVE :: chemistry_couple ! true  : use INCA chemistry O3
     ! false : use offline chemistry O3
-    !$OMP THREADPRIVATE(chemistry_couple)    
-    INTEGER, SAVE :: flag_aerosol 
-    !$OMP THREADPRIVATE(flag_aerosol) 
+    !$OMP THREADPRIVATE(chemistry_couple)
+    INTEGER, SAVE :: flag_aerosol
+    !$OMP THREADPRIVATE(flag_aerosol)
     LOGICAL, SAVE :: flag_bc_internal_mixture
     !$OMP THREADPRIVATE(flag_bc_internal_mixture)
-    !
+
     !--STRAT AEROSOL
     INTEGER, SAVE :: flag_aerosol_strat
     !$OMP THREADPRIVATE(flag_aerosol_strat)
-    !
+
     !--INTERACTIVE AEROSOL FEEDBACK ON RADIATION
     LOGICAL, SAVE :: flag_aer_feedback
@@ -1146,13 +1129,13 @@
 
     !c-fin STRAT AEROSOL
-    !
+
     ! Declaration des constantes et des fonctions thermodynamiques
-    !
-    LOGICAL,SAVE :: first=.TRUE.
+
+    LOGICAL, SAVE :: first = .TRUE.
     !$OMP THREADPRIVATE(first)
 
     ! VARIABLES RELATED TO OZONE CLIMATOLOGIES ; all are OpenMP shared
     ! Note that pressure vectors are in Pa and in stricly ascending order
-    INTEGER,SAVE :: read_climoz                ! Read ozone climatology
+    INTEGER, SAVE :: read_climoz                ! Read ozone climatology
     !     (let it keep the default OpenMP shared attribute)
     !     Allowed values are 0, 1 and 2
@@ -1161,14 +1144,14 @@
     !     2: read two ozone climatologies, the average day and night
     !     climatology and the daylight climatology
-    INTEGER,SAVE :: ncid_climoz                ! NetCDF file identifier
+    INTEGER, SAVE :: ncid_climoz                ! NetCDF file identifier
     REAL, ALLOCATABLE, SAVE :: press_cen_climoz(:) ! Pressure levels
     REAL, ALLOCATABLE, SAVE :: press_edg_climoz(:) ! Edges of pressure intervals
     REAL, ALLOCATABLE, SAVE :: time_climoz(:)      ! Time vector
-    CHARACTER(LEN=13), PARAMETER :: vars_climoz(2) &
-                                  = ["tro3         ","tro3_daylight"]
+    CHARACTER(LEN = 13), PARAMETER :: vars_climoz(2) &
+            = ["tro3         ", "tro3_daylight"]
     ! vars_climoz(1:read_climoz): variables names in climoz file.
     ! vars_climoz(1:read_climoz-2) if read_climoz>2 (temporary)
     REAL :: ro3i ! 0<=ro3i<=360 ; required time index in NetCDF file for
-                 ! the ozone fields, old method.
+    ! the ozone fields, old method.
 
     include "YOMCST.h"
@@ -1180,5 +1163,5 @@
     include "compbl.h"
     !IM 100106 END : pouvoir sortir les ctes de la physique
-    !
+
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     ! Declarations pour Simulateur COSP
@@ -1191,13 +1174,13 @@
     include "ini_COSP.h"
 #endif
-    real :: mr_ozone(klon,klev), phicosp(klon,klev)
+    real :: mr_ozone(klon, klev), phicosp(klon, klev)
 
     !IM stations CFMIP
     INTEGER, SAVE :: nCFMIP
     !$OMP THREADPRIVATE(nCFMIP)
-    INTEGER, PARAMETER :: npCFMIP=120
+    INTEGER, PARAMETER :: npCFMIP = 120
     INTEGER, ALLOCATABLE, SAVE :: tabCFMIP(:)
     REAL, ALLOCATABLE, SAVE :: lonCFMIP(:), latCFMIP(:)
-    !$OMP THREADPRIVATE(tabCFMIP, lonCFMIP, latCFMIP) 
+    !$OMP THREADPRIVATE(tabCFMIP, lonCFMIP, latCFMIP)
     INTEGER, ALLOCATABLE, SAVE :: tabijGCM(:)
     REAL, ALLOCATABLE, SAVE :: lonGCM(:), latGCM(:)
@@ -1205,11 +1188,11 @@
     INTEGER, ALLOCATABLE, SAVE :: iGCM(:), jGCM(:)
     !$OMP THREADPRIVATE(iGCM, jGCM)
-    logical, dimension(nfiles)            :: phys_out_filestations
-    logical, parameter :: lNMC=.FALSE.
+    logical, dimension(nfiles) :: phys_out_filestations
+    logical, parameter :: lNMC = .FALSE.
 
     !IM betaCRF
     REAL, SAVE :: pfree, beta_pbl, beta_free
     !$OMP THREADPRIVATE(pfree, beta_pbl, beta_free)
-    REAL, SAVE :: lon1_beta,  lon2_beta, lat1_beta, lat2_beta
+    REAL, SAVE :: lon1_beta, lon2_beta, lat1_beta, lat2_beta
     !$OMP THREADPRIVATE(lon1_beta,  lon2_beta, lat1_beta, lat2_beta)
     LOGICAL, SAVE :: mskocean_beta
@@ -1231,33 +1214,33 @@
     REAL :: calday, zxsnow_dummy(klon)
     ! set de variables utilisees pour l'initialisation des valeurs provenant de INCA
-    REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_tauinca
-    REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_pizinca
-    REAL, DIMENSION(klon,klev,naero_grp,nbands) :: init_cginca
-    REAL, DIMENSION(klon,klev,nbands) :: init_ccminca
-    REAL, DIMENSION(klon,nbtr) :: init_source
+    REAL, DIMENSION(klon, klev, naero_grp, nbands) :: init_tauinca
+    REAL, DIMENSION(klon, klev, naero_grp, nbands) :: init_pizinca
+    REAL, DIMENSION(klon, klev, naero_grp, nbands) :: init_cginca
+    REAL, DIMENSION(klon, klev, nbands) :: init_ccminca
+    REAL, DIMENSION(klon, nbtr) :: init_source
 
     !lwoff=y : offset LW CRE for radiation code and other schemes
-    REAL, SAVE :: betalwoff 
+    REAL, SAVE :: betalwoff
     !$OMP THREADPRIVATE(betalwoff)
-!
+
     INTEGER :: nbtr_tmp ! Number of tracer inside concvl
-    REAL, dimension(klon,klev) :: sh_in ! Specific humidity entering in phytrac
-    REAL, dimension(klon,klev) :: ch_in ! Condensed humidity entering in phytrac (eau liquide)
+    REAL, dimension(klon, klev) :: sh_in ! Specific humidity entering in phytrac
+    REAL, dimension(klon, klev) :: ch_in ! Condensed humidity entering in phytrac (eau liquide)
     integer iostat
 
-    REAL, dimension(klon,klev+1) :: l_mix_ave, wprime_ave
+    REAL, dimension(klon, klev + 1) :: l_mix_ave, wprime_ave
     REAL zzz
     !albedo SB >>>
-    REAL,DIMENSION(6), SAVE :: SFRWL
-!$OMP THREADPRIVATE(SFRWL)
+    REAL, DIMENSION(6), SAVE :: SFRWL
+    !$OMP THREADPRIVATE(SFRWL)
     !albedo SB <<<
 
     !--OB variables for mass fixer (hard coded for now)
-    REAL qql1(klon),qql2(klon),corrqql
+    REAL qql1(klon), qql2(klon), corrqql
 
     !--OB flag to activate better conservation of water tendency when convection is not called every timestep
-    LOGICAL, PARAMETER :: ok_conserv_d_q_con=.FALSE.
-
-    REAL, dimension(klon,klev) :: t_env,q_env
+    LOGICAL, PARAMETER :: ok_conserv_d_q_con = .FALSE.
+
+    REAL, dimension(klon, klev) :: t_env, q_env
 
     REAL, dimension(klon) :: pr_et
@@ -1269,5 +1252,5 @@
 
     !AI namelist pour gerer le double appel de Ecrad
-    CHARACTER(len=512) :: namelist_ecrad_file
+    CHARACTER(len = 512) :: namelist_ecrad_file
 
     !======================================================================!
@@ -1277,40 +1260,39 @@
     !======================================================================!
     if (debut) then                                                        !
-       iflag_physiq=0
-       call getin_p('iflag_physiq', iflag_physiq)                          !
+      iflag_physiq = 0
+      call getin_p('iflag_physiq', iflag_physiq)                          !
     endif                                                                  !
-    if ( iflag_physiq == 2 ) then                                          !
-       call physiqex (nlon,nlev, &                                         !
-       debut,lafin,pdtphys_, &                                             !
-       paprs,pplay,pphi,pphis,presnivs, &                                  !
-       u,v,rot,t,qx, &                                                     !
-       flxmass_w, &                                                        !
-       d_u, d_v, d_t, d_qx, d_ps)                                          !
-       return                                                              !
+    if (iflag_physiq == 2) then                                          !
+      call physiqex (nlon, nlev, &                                         !
+              debut, lafin, pdtphys_, &                                             !
+              paprs, pplay, pphi, pphis, presnivs, &                                  !
+              u, v, rot, t, qx, &                                                     !
+              flxmass_w, &                                                        !
+              d_u, d_v, d_t, d_qx, d_ps)                                          !
+      return                                                              !
     endif                                                                  !
     !======================================================================!
 
-
     pi = 4. * ATAN(1.)
 
     ! set-up call to alerte function
     call_alert = (alert_first_call .AND. is_master)
-    
+
     ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
-    jjmp1=nbp_lat
+    jjmp1 = nbp_lat
 
     !======================================================================
     ! Gestion calendrier : mise a jour du module phys_cal_mod
-    !
-    pdtphys=pdtphys_
+
+    pdtphys = pdtphys_
     CALL update_time(pdtphys)
-    phys_tstep=NINT(pdtphys)
-    IF (.NOT. using_xios) missing_val=nf90_fill_real
+    phys_tstep = NINT(pdtphys)
+    IF (.NOT. using_xios) missing_val = nf90_fill_real
 
     IF (using_xios) THEN
-      ! switch to XIOS LMDZ physics context 
+      ! switch to XIOS LMDZ physics context
       IF (.NOT. debut .AND. is_omp_master) THEN
         CALL wxios_set_context()
-        CALL xios_update_calendar(itap+1)
+        CALL xios_update_calendar(itap + 1)
       ENDIF
     ENDIF
@@ -1322,22 +1304,22 @@
     !======================================================================
     IF (prt_level>=1) THEN
-       igout=klon/2+1/klon
-       write(lunout,*) 'DEBUT DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
-       write(lunout,*) 'igout, lat, lon ',igout, latitude_deg(igout), &
-            longitude_deg(igout)
-       write(lunout,*) &
-            'nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur,pdtphys'
-       write(lunout,*) &
-            nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur,pdtphys 
-
-       write(lunout,*) 'paprs, play, phi, u, v, t'
-       DO k=1,klev
-          write(lunout,*) paprs(igout,k),pplay(igout,k),pphi(igout,k), &
-               u(igout,k),v(igout,k),t(igout,k)
-       ENDDO
-       write(lunout,*) 'ovap (g/kg),  oliq (g/kg)'
-       DO k=1,klev
-          write(lunout,*) qx(igout,k,1)*1000,qx(igout,k,2)*1000.
-       ENDDO
+      igout = klon / 2 + 1 / klon
+      write(lunout, *) 'DEBUT DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
+      write(lunout, *) 'igout, lat, lon ', igout, latitude_deg(igout), &
+              longitude_deg(igout)
+      write(lunout, *) &
+              'nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur,pdtphys'
+      write(lunout, *) &
+              nlon, klev, nqtot, debut, lafin, jD_cur, jH_cur, pdtphys
+
+      write(lunout, *) 'paprs, play, phi, u, v, t'
+      DO k = 1, klev
+        write(lunout, *) paprs(igout, k), pplay(igout, k), pphi(igout, k), &
+                u(igout, k), v(igout, k), t(igout, k)
+      ENDDO
+      write(lunout, *) 'ovap (g/kg),  oliq (g/kg)'
+      DO k = 1, klev
+        write(lunout, *) qx(igout, k, 1) * 1000, qx(igout, k, 2) * 1000.
+      ENDDO
     ENDIF
 
@@ -1346,190 +1328,189 @@
             "physiq_mod paprs bad order")
 
-    IF (first) THEN 
-       ivap = strIdx(tracers(:)%name, addPhase('H2O', 'g'))
-       iliq = strIdx(tracers(:)%name, addPhase('H2O', 'l'))
-       isol = strIdx(tracers(:)%name, addPhase('H2O', 's'))
-       irneb= strIdx(tracers(:)%name, addPhase('H2O', 'r'))
-       ibs  = strIdx(tracers(:)%name, addPhase('H2O', 'b'))
-!       CALL init_etat0_limit_unstruct
-!       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
-       !CR:nvelles variables convection/poches froides
-
-       WRITE(lunout,*) '================================================='
-       WRITE(lunout,*) 'Allocation des variables locales et sauvegardees'
-       WRITE(lunout,*) '================================================='
-       CALL phys_local_var_init
-       !
-       !     appel a la lecture du run.def physique
-       CALL conf_phys(ok_journe, ok_mensuel, &
-            ok_instan, ok_hf, &
-            ok_LES, &
-            callstats, &
-            solarlong0,seuil_inversion, &
-            fact_cldcon, facttemps,ok_newmicro,iflag_radia, &
-            iflag_cld_th,ratqsbas,ratqshaut,tau_ratqs, &
-            ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, &
-            chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-            flag_bc_internal_mixture, bl95_b0, bl95_b1, &
-                                ! nv flags pour la convection et les
-                                ! poches froides
-            read_climoz, &
-            alp_offset)
-       CALL init_etat0_limit_unstruct
-       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
-       CALL phys_state_var_init(read_climoz)
-       CALL phys_output_var_init
-       IF (read_climoz>=1 .AND. create_etat0_limit .AND. grid_type==unstructured) & 
-          CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)
-
-       print*, '================================================='
-       !
-       !CR: check sur le nb de traceurs de l eau
-       IF ((iflag_ice_thermo>0).and.(nqo==2)) THEN
-          WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers ', &
-               '(H2O_g, H2O_l, H2O_s) but nqo=', nqo, '. Might as well stop here.'
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_ice_sursat.AND.(iflag_ice_thermo==0)) THEN
-          WRITE (lunout, *) ' ok_ice_sursat=y requires iflag_ice_thermo=1 as well'
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_ice_sursat.AND.(nqo<4)) THEN
-          WRITE (lunout, *) ' ok_ice_sursat=y requires 4 H2O tracers ', &
-               '(H2O_g, H2O_l, H2O_s, H2O_r) but nqo=', nqo, '. Might as well stop here.'
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_plane_h2o.AND..NOT.ok_ice_sursat) THEN
-          WRITE (lunout, *) ' ok_plane_h2o=y requires ok_ice_sursat=y '
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-       IF (ok_plane_contrail.AND..NOT.ok_ice_sursat) THEN
-          WRITE (lunout, *) ' ok_plane_contrail=y requires ok_ice_sursat=y '
-          abort_message='see above'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-        IF (ok_bs) THEN
-         IF ((ok_ice_sursat.AND.nqo <5).OR.(.NOT.ok_ice_sursat.AND.nqo<4)) THEN
-             WRITE (lunout, *) 'activation of blowing snow needs a specific H2O tracer', &
-                               'but nqo=', nqo
-             abort_message='see above'
-             CALL abort_physic(modname,abort_message, 1)
-         ENDIF
+    IF (first) THEN
+      ivap = strIdx(tracers(:)%name, addPhase('H2O', 'g'))
+      iliq = strIdx(tracers(:)%name, addPhase('H2O', 'l'))
+      isol = strIdx(tracers(:)%name, addPhase('H2O', 's'))
+      irneb = strIdx(tracers(:)%name, addPhase('H2O', 'r'))
+      ibs = strIdx(tracers(:)%name, addPhase('H2O', 'b'))
+      !       CALL init_etat0_limit_unstruct
+      !       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
+      !CR:nvelles variables convection/poches froides
+
+      WRITE(lunout, *) '================================================='
+      WRITE(lunout, *) 'Allocation des variables locales et sauvegardees'
+      WRITE(lunout, *) '================================================='
+      CALL phys_local_var_init
+
+      !     appel a la lecture du run.def physique
+      CALL conf_phys(ok_journe, ok_mensuel, &
+              ok_instan, ok_hf, &
+              ok_LES, &
+              callstats, &
+              solarlong0, seuil_inversion, &
+              fact_cldcon, facttemps, ok_newmicro, iflag_radia, &
+              iflag_cld_th, ratqsbas, ratqshaut, tau_ratqs, &
+              ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, &
+              chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
+              flag_bc_internal_mixture, bl95_b0, bl95_b1, &
+              ! nv flags pour la convection et les
+              ! poches froides
+              read_climoz, &
+              alp_offset)
+      CALL init_etat0_limit_unstruct
+      IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
+      CALL phys_state_var_init(read_climoz)
+      CALL phys_output_var_init
+      IF (read_climoz>=1 .AND. create_etat0_limit .AND. grid_type==unstructured) &
+              CALL regr_horiz_time_climoz(read_climoz, ok_daily_climoz)
+
+      print*, '================================================='
+
+      !CR: check sur le nb de traceurs de l eau
+      IF ((iflag_ice_thermo>0).and.(nqo==2)) THEN
+        WRITE (lunout, *) ' iflag_ice_thermo==1 requires 3 H2O tracers ', &
+                '(H2O_g, H2O_l, H2O_s) but nqo=', nqo, '. Might as well stop here.'
+        abort_message = 'see above'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      IF (ok_ice_sursat.AND.(iflag_ice_thermo==0)) THEN
+        WRITE (lunout, *) ' ok_ice_sursat=y requires iflag_ice_thermo=1 as well'
+        abort_message = 'see above'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      IF (ok_ice_sursat.AND.(nqo<4)) THEN
+        WRITE (lunout, *) ' ok_ice_sursat=y requires 4 H2O tracers ', &
+                '(H2O_g, H2O_l, H2O_s, H2O_r) but nqo=', nqo, '. Might as well stop here.'
+        abort_message = 'see above'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      IF (ok_plane_h2o.AND..NOT.ok_ice_sursat) THEN
+        WRITE (lunout, *) ' ok_plane_h2o=y requires ok_ice_sursat=y '
+        abort_message = 'see above'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      IF (ok_plane_contrail.AND..NOT.ok_ice_sursat) THEN
+        WRITE (lunout, *) ' ok_plane_contrail=y requires ok_ice_sursat=y '
+        abort_message = 'see above'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      IF (ok_bs) THEN
+        IF ((ok_ice_sursat.AND.nqo <5).OR.(.NOT.ok_ice_sursat.AND.nqo<4)) THEN
+          WRITE (lunout, *) 'activation of blowing snow needs a specific H2O tracer', &
+                  'but nqo=', nqo
+          abort_message = 'see above'
+          CALL abort_physic(modname, abort_message, 1)
         ENDIF
-
-       Ncvpaseq1 = 0
-       dnwd0=0.0
-       ftd=0.0
-       fqd=0.0
-       cin=0.
-       !ym Attention pbase pas initialise dans concvl !!!!
-       pbase=0
-       !IM 180608
-
-       itau_con=0
-       first=.FALSE.
+      ENDIF
+
+      Ncvpaseq1 = 0
+      dnwd0 = 0.0
+      ftd = 0.0
+      fqd = 0.0
+      cin = 0.
+      !ym Attention pbase pas initialise dans concvl !!!!
+      pbase = 0
+      !IM 180608
+
+      itau_con = 0
+      first = .FALSE.
 
     ENDIF  ! first
 
-    !ym => necessaire pour iflag_con != 2    
-    pmfd(:,:) = 0.
-    pen_u(:,:) = 0.
-    pen_d(:,:) = 0.
-    pde_d(:,:) = 0.
-    pde_u(:,:) = 0.
-    aam=0.
-    d_t_adjwk(:,:)=0
-    d_q_adjwk(:,:)=0
-
-    alp_bl_conv(:)=0.
-
-    torsfc=0.
-    forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg
-
+    !ym => necessaire pour iflag_con != 2
+    pmfd(:, :) = 0.
+    pen_u(:, :) = 0.
+    pen_d(:, :) = 0.
+    pde_d(:, :) = 0.
+    pde_u(:, :) = 0.
+    aam = 0.
+    d_t_adjwk(:, :) = 0
+    d_q_adjwk(:, :) = 0
+
+    alp_bl_conv(:) = 0.
+
+    torsfc = 0.
+    forall (k = 1:nbp_lev) zmasse(:, k) = (paprs(:, k) - paprs(:, k + 1)) / rg
 
     IF (debut) THEN
-       CALL suphel ! initialiser constantes et parametres phys.
-! tau_gl : constante de rappel de la temperature a la surface de la glace - en
-       tau_gl=5.
-       CALL getin_p('tau_gl', tau_gl)
-! tau_gl : constante de rappel de la temperature a la surface de la glace - en
-! secondes
-       tau_gl=86400.*tau_gl
-       WRITE(lunout,*) 'debut physiq_mod tau_gl=',tau_gl
-       iflag_thermcell_tke=0
-       call getin_p('iflag_thermcell_tke', iflag_thermcell_tke)                          !
-
-       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond) 
-       CALL getin_p('random_notrig_max',random_notrig_max)
-       CALL getin_p('ok_adjwk',ok_adjwk) 
-       IF (ok_adjwk) iflag_adjwk=2  ! for compatibility with older versions
-       ! iflag_adjwk: ! 0 = Default: no convective adjustment of w-region
-                      ! 1 => convective adjustment but state variables are unchanged
-                      ! 2 => convective adjustment and state variables are changed
-       CALL getin_p('iflag_adjwk',iflag_adjwk)
-       CALL getin_p('dtcon_multistep_max',dtcon_multistep_max)
-       CALL getin_p('dqcon_multistep_max',dqcon_multistep_max)
-       CALL getin_p('oliqmax',oliqmax)
-       CALL getin_p('oicemax',oicemax)
-       CALL getin_p('ratqsp0',ratqsp0)
-       CALL getin_p('ratqsdp',ratqsdp)
-       iflag_wake_tend = 0
-       CALL getin_p('iflag_wake_tend',iflag_wake_tend)
-       ok_bad_ecmwf_thermo=.TRUE. ! By default thermodynamical constants are set 
-                                  ! in rrtm/suphec.F90 (and rvtmp2 is set to 0).
-       CALL getin_p('ok_bad_ecmwf_thermo',ok_bad_ecmwf_thermo)
-       CALL getin_p('ok_bug_cv_trac',ok_bug_cv_trac)
-       CALL getin_p('ok_bug_split_th',ok_bug_split_th)
-       CALL getin_p('ok_bug_ajs_cv',ok_bug_ajs_cv)
-       fl_ebil = 0 ! by default, conservation diagnostics are desactivated
-       CALL getin_p('fl_ebil',fl_ebil)
-       fl_cor_ebil = 0 ! by default, no correction to ensure energy conservation
-       CALL getin_p('fl_cor_ebil',fl_cor_ebil)
-       iflag_phytrac = 1 ! by default we do want to call phytrac
-       CALL getin_p('iflag_phytrac',iflag_phytrac)
-
-       ok_water_mass_fixer=.FALSE.  ! OB: by default we do not apply the mass fixer
-       CALL getin_p('ok_water_mass_fixer',ok_water_mass_fixer)
-#ifdef CPP_Dust
-       IF (iflag_phytrac.EQ.0) THEN 
-         WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1'
-         iflag_phytrac = 1
-       ENDIF
-#endif
-       nvm_lmdz = 13
-       CALL getin_p('NVM',nvm_lmdz)
-
-       WRITE(lunout,*) 'iflag_alp_wk_cond=',  iflag_alp_wk_cond
-       WRITE(lunout,*) 'random_ntrig_max=',   random_notrig_max
-       WRITE(lunout,*) 'ok_adjwk=',           ok_adjwk
-       WRITE(lunout,*) 'iflag_adjwk=',        iflag_adjwk
-       WRITE(lunout,*) 'qtcon_multistep_max=',dtcon_multistep_max 
-       WRITE(lunout,*) 'qdcon_multistep_max=',dqcon_multistep_max 
-       WRITE(lunout,*) 'ratqsp0=',            ratqsp0
-       WRITE(lunout,*) 'ratqsdp=',            ratqsdp 
-       WRITE(lunout,*) 'iflag_wake_tend=',    iflag_wake_tend
-       WRITE(lunout,*) 'ok_bad_ecmwf_thermo=',ok_bad_ecmwf_thermo 
-       WRITE(lunout,*) 'ok_bug_cv_trac=',     ok_bug_cv_trac 
-       WRITE(lunout,*) 'ok_bug_split_th=',    ok_bug_split_th
-       WRITE(lunout,*) 'fl_ebil=',            fl_ebil
-       WRITE(lunout,*) 'fl_cor_ebil=',        fl_cor_ebil
-       WRITE(lunout,*) 'iflag_phytrac=',      iflag_phytrac
-       WRITE(lunout,*) 'ok_water_mass_fixer=',ok_water_mass_fixer
-       WRITE(lunout,*) 'NVM=',                nvm_lmdz
-
-       !--PC: defining fields to be exchanged between LMDz, ORCHIDEE and NEMO
-       WRITE(lunout,*) 'Call to infocfields from physiq'
-       CALL infocfields_init
-
-       !AI 08 2023
+      CALL suphel ! initialiser constantes et parametres phys.
+      ! tau_gl : constante de rappel de la temperature a la surface de la glace - en
+      tau_gl = 5.
+      CALL getin_p('tau_gl', tau_gl)
+      ! tau_gl : constante de rappel de la temperature a la surface de la glace - en
+      ! secondes
+      tau_gl = 86400. * tau_gl
+      WRITE(lunout, *) 'debut physiq_mod tau_gl=', tau_gl
+      iflag_thermcell_tke = 0
+      call getin_p('iflag_thermcell_tke', iflag_thermcell_tke)                          !
+
+      CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond)
+      CALL getin_p('random_notrig_max', random_notrig_max)
+      CALL getin_p('ok_adjwk', ok_adjwk)
+      IF (ok_adjwk) iflag_adjwk = 2  ! for compatibility with older versions
+      ! iflag_adjwk: ! 0 = Default: no convective adjustment of w-region
+      ! 1 => convective adjustment but state variables are unchanged
+      ! 2 => convective adjustment and state variables are changed
+      CALL getin_p('iflag_adjwk', iflag_adjwk)
+      CALL getin_p('dtcon_multistep_max', dtcon_multistep_max)
+      CALL getin_p('dqcon_multistep_max', dqcon_multistep_max)
+      CALL getin_p('oliqmax', oliqmax)
+      CALL getin_p('oicemax', oicemax)
+      CALL getin_p('ratqsp0', ratqsp0)
+      CALL getin_p('ratqsdp', ratqsdp)
+      iflag_wake_tend = 0
+      CALL getin_p('iflag_wake_tend', iflag_wake_tend)
+      ok_bad_ecmwf_thermo = .TRUE. ! By default thermodynamical constants are set
+      ! in rrtm/suphec.F90 (and rvtmp2 is set to 0).
+      CALL getin_p('ok_bad_ecmwf_thermo', ok_bad_ecmwf_thermo)
+      CALL getin_p('ok_bug_cv_trac', ok_bug_cv_trac)
+      CALL getin_p('ok_bug_split_th', ok_bug_split_th)
+      CALL getin_p('ok_bug_ajs_cv', ok_bug_ajs_cv)
+      fl_ebil = 0 ! by default, conservation diagnostics are desactivated
+      CALL getin_p('fl_ebil', fl_ebil)
+      fl_cor_ebil = 0 ! by default, no correction to ensure energy conservation
+      CALL getin_p('fl_cor_ebil', fl_cor_ebil)
+      iflag_phytrac = 1 ! by default we do want to call phytrac
+      CALL getin_p('iflag_phytrac', iflag_phytrac)
+
+      ok_water_mass_fixer = .FALSE.  ! OB: by default we do not apply the mass fixer
+      CALL getin_p('ok_water_mass_fixer', ok_water_mass_fixer)
+      IF (CPPKEY_DUST) THEN
+        IF (iflag_phytrac.EQ.0) THEN
+          WRITE(lunout, *) 'In order to run with SPLA, iflag_phytrac will be forced to 1'
+          iflag_phytrac = 1
+        ENDIF
+      END IF
+      nvm_lmdz = 13
+      CALL getin_p('NVM', nvm_lmdz)
+
+      WRITE(lunout, *) 'iflag_alp_wk_cond=', iflag_alp_wk_cond
+      WRITE(lunout, *) 'random_ntrig_max=', random_notrig_max
+      WRITE(lunout, *) 'ok_adjwk=', ok_adjwk
+      WRITE(lunout, *) 'iflag_adjwk=', iflag_adjwk
+      WRITE(lunout, *) 'qtcon_multistep_max=', dtcon_multistep_max
+      WRITE(lunout, *) 'qdcon_multistep_max=', dqcon_multistep_max
+      WRITE(lunout, *) 'ratqsp0=', ratqsp0
+      WRITE(lunout, *) 'ratqsdp=', ratqsdp
+      WRITE(lunout, *) 'iflag_wake_tend=', iflag_wake_tend
+      WRITE(lunout, *) 'ok_bad_ecmwf_thermo=', ok_bad_ecmwf_thermo
+      WRITE(lunout, *) 'ok_bug_cv_trac=', ok_bug_cv_trac
+      WRITE(lunout, *) 'ok_bug_split_th=', ok_bug_split_th
+      WRITE(lunout, *) 'fl_ebil=', fl_ebil
+      WRITE(lunout, *) 'fl_cor_ebil=', fl_cor_ebil
+      WRITE(lunout, *) 'iflag_phytrac=', iflag_phytrac
+      WRITE(lunout, *) 'ok_water_mass_fixer=', ok_water_mass_fixer
+      WRITE(lunout, *) 'NVM=', nvm_lmdz
+
+      !--PC: defining fields to be exchanged between LMDz, ORCHIDEE and NEMO
+      WRITE(lunout, *) 'Call to infocfields from physiq'
+      CALL infocfields_init
+
+      !AI 08 2023
 #ifdef CPP_ECRAD
        ok_3Deffect=.false.
@@ -1540,193 +1521,190 @@
     ENDIF
 
-    IF (prt_level>=1) print *,'CONVERGENCE PHYSIQUE THERM 1 '
+    IF (prt_level>=1) print *, 'CONVERGENCE PHYSIQUE THERM 1 '
 
     !======================================================================
     ! Gestion calendrier : mise a jour du module phys_cal_mod
-    !
+
     !     CALL phys_cal_update(jD_cur,jH_cur)
 
-    !
     ! Si c'est le debut, il faut initialiser plusieurs choses
     !          ********
-    !
+
     IF (debut) THEN
-       !rv CRinitialisation de wght_th et lalim_conv pour la
-       !definition de la couche alimentation de la convection a partir
-       !des caracteristiques du thermique
-       wght_th(:,:)=1.
-       lalim_conv(:)=1 
-       !RC
-       ustar(:,:)=0.
-!       u10m(:,:)=0.
-!       v10m(:,:)=0.
-       rain_con(:)=0.
-       snow_con(:)=0.
-       topswai(:)=0.
-       topswad(:)=0.
-       solswai(:)=0.
-       solswad(:)=0.
-
-       wmax_th(:)=0.
-       tau_overturning_th(:)=0.
-
-       IF (ANY(type_trac == ['inca','inco'])) THEN
-          ! jg : initialisation jusqu'au ces variables sont dans restart
-          ccm(:,:,:) = 0.
-          tau_aero(:,:,:,:) = 0.
-          piz_aero(:,:,:,:) = 0.
-          cg_aero(:,:,:,:) = 0.
-          d_q_ch4(:,:) = 0.
-
-          config_inca='none' ! default
-          CALL getin_p('config_inca',config_inca)
-
-       ELSE 
-          config_inca='none' ! default
-       ENDIF
-
-       tau_aero(:,:,:,:) = 1.e-15
-       piz_aero(:,:,:,:) = 1.
-       cg_aero(:,:,:,:)  = 0.
-       d_q_ch4(:,:) = 0.
-
-       IF (aerosol_couple .AND. (config_inca /= "aero" &
-            .AND. config_inca /= "aeNP ")) THEN
-          abort_message &
-               = 'if aerosol_couple is activated, config_inca need to be ' &
-               // 'aero or aeNP'
-          CALL abort_physic (modname,abort_message,1)
-       ENDIF
-
-       rnebcon0(:,:) = 0.0
-       clwcon0(:,:) = 0.0
-       rnebcon(:,:) = 0.0
-       clwcon(:,:) = 0.0
-
-       !
-       print*,'iflag_coupl,iflag_clos,iflag_wake', &
-            iflag_coupl,iflag_clos,iflag_wake
-       print*,'iflag_cycle_diurne', iflag_cycle_diurne
-       !
-       IF (iflag_con==2.AND.iflag_cld_th>-1) THEN
-          abort_message = 'Tiedtke needs iflag_cld_th=-2 or -1'
-          CALL abort_physic (modname,abort_message,1)
-       ENDIF
-       !
-       !
-       ! Initialiser les compteurs:
-       !
-       itap    = 0
-       itaprad = 0
-       itapcv = 0
-       itapwk = 0
-
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       !! Un petit travail \`a faire ici.
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       IF (iflag_pbl>1) THEN
-          PRINT*, "Using method MELLOR&YAMADA" 
-       ENDIF
-
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! FH 2008/05/02 changement lie a la lecture de nbapp_rad dans
-       ! phylmd plutot que dyn3d
-       ! Attention : la version precedente n'etait pas tres propre.
-       ! Il se peut qu'il faille prendre une valeur differente de nbapp_rad
-       ! pour obtenir le meme resultat.
-!jyg for fh<
-       WRITE(lunout,*) 'Pas de temps phys_tstep pdtphys ',phys_tstep,pdtphys
-       IF (abs(phys_tstep-pdtphys)>1.e-10) THEN
-          abort_message='pas de temps doit etre entier en seconde pour orchidee et XIOS'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-!>jyg
-       IF (MOD(NINT(86400./phys_tstep),nbapp_rad)==0) THEN
-          radpas = NINT( 86400./phys_tstep)/nbapp_rad
-       ELSE 
-          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
-               'multiple de nbapp_rad'
-          WRITE(lunout,*) 'changer nbapp_rad ou alors commenter ce test ', &
-               'mais 1+1<>2'
-          abort_message='nbre de pas de temps physique n est pas multiple ' &
-               // 'de nbapp_rad'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       IF (nbapp_cv == 0) nbapp_cv=86400./phys_tstep
-       IF (nbapp_wk == 0) nbapp_wk=86400./phys_tstep
-       print *,'physiq, nbapp_cv, nbapp_wk ',nbapp_cv,nbapp_wk
-       IF (MOD(NINT(86400./phys_tstep),nbapp_cv)==0) THEN
-          cvpas_0 = NINT( 86400./phys_tstep)/nbapp_cv
-          cvpas = cvpas_0
-       print *,'physiq, cvpas ',cvpas
-       ELSE 
-          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
-               'multiple de nbapp_cv'
-          WRITE(lunout,*) 'changer nbapp_cv ou alors commenter ce test ', &
-               'mais 1+1<>2'
-          abort_message='nbre de pas de temps physique n est pas multiple ' &
-               // 'de nbapp_cv'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       IF (MOD(NINT(86400./phys_tstep),nbapp_wk)==0) THEN
-          wkpas = NINT( 86400./phys_tstep)/nbapp_wk
-!       print *,'physiq, wkpas ',wkpas
-       ELSE 
-          WRITE(lunout,*) 'le nombre de pas de temps physique doit etre un ', &
-               'multiple de nbapp_wk'
-          WRITE(lunout,*) 'changer nbapp_wk ou alors commenter ce test ', &
-               'mais 1+1<>2'
-          abort_message='nbre de pas de temps physique n est pas multiple ' &
-               // 'de nbapp_wk'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       CALL init_iophy_new(latitude_deg,longitude_deg)
-
-          !===================================================================
-          !IM stations CFMIP
-          nCFMIP=npCFMIP
-          OPEN(98,file='npCFMIP_param.data',status='old', &
-               form='formatted',iostat=iostat)
-          IF (iostat == 0) THEN
-             READ(98,*,end=998) nCFMIP
-998          CONTINUE
-             CLOSE(98)
-             IF(nCFMIP>npCFMIP) THEN
-                print*,'nCFMIP > npCFMIP : augmenter npCFMIP et recompiler'
-                CALL abort_physic("physiq", "", 1)
-             ELSE
-                print*,'physiq npCFMIP=',npCFMIP,'nCFMIP=',nCFMIP
-             ENDIF
-
-             !
-             ALLOCATE(tabCFMIP(nCFMIP))
-             ALLOCATE(lonCFMIP(nCFMIP), latCFMIP(nCFMIP))
-             ALLOCATE(tabijGCM(nCFMIP))
-             ALLOCATE(lonGCM(nCFMIP), latGCM(nCFMIP))
-             ALLOCATE(iGCM(nCFMIP), jGCM(nCFMIP))
-             !
-             ! lecture des nCFMIP stations CFMIP, de leur numero 
-             ! et des coordonnees geographiques lonCFMIP, latCFMIP
-             !
-             CALL read_CFMIP_point_locations(nCFMIP, tabCFMIP,  &
-                  lonCFMIP, latCFMIP)
-             !
-             ! identification des
-             ! 1) coordonnees lonGCM, latGCM des points CFMIP dans la
-             ! grille de LMDZ
-             ! 2) indices points tabijGCM de la grille physique 1d sur
-             ! klon points
-             ! 3) indices iGCM, jGCM de la grille physique 2d
-             !
-             CALL LMDZ_CFMIP_point_locations(nCFMIP, lonCFMIP, latCFMIP, &
-                  tabijGCM, lonGCM, latGCM, iGCM, jGCM)
-             !
-          ELSE
-             ALLOCATE(tabijGCM(0))
-             ALLOCATE(lonGCM(0), latGCM(0))
-             ALLOCATE(iGCM(0), jGCM(0))
-          ENDIF
+      !rv CRinitialisation de wght_th et lalim_conv pour la
+      !definition de la couche alimentation de la convection a partir
+      !des caracteristiques du thermique
+      wght_th(:, :) = 1.
+      lalim_conv(:) = 1
+      !RC
+      ustar(:, :) = 0.
+      !       u10m(:,:)=0.
+      !       v10m(:,:)=0.
+      rain_con(:) = 0.
+      snow_con(:) = 0.
+      topswai(:) = 0.
+      topswad(:) = 0.
+      solswai(:) = 0.
+      solswad(:) = 0.
+
+      wmax_th(:) = 0.
+      tau_overturning_th(:) = 0.
+
+      IF (ANY(type_trac == ['inca', 'inco'])) THEN
+        ! jg : initialisation jusqu'au ces variables sont dans restart
+        ccm(:, :, :) = 0.
+        tau_aero(:, :, :, :) = 0.
+        piz_aero(:, :, :, :) = 0.
+        cg_aero(:, :, :, :) = 0.
+        d_q_ch4(:, :) = 0.
+
+        config_inca = 'none' ! default
+        CALL getin_p('config_inca', config_inca)
+
+      ELSE
+        config_inca = 'none' ! default
+      ENDIF
+
+      tau_aero(:, :, :, :) = 1.e-15
+      piz_aero(:, :, :, :) = 1.
+      cg_aero(:, :, :, :) = 0.
+      d_q_ch4(:, :) = 0.
+
+      IF (aerosol_couple .AND. (config_inca /= "aero" &
+              .AND. config_inca /= "aeNP ")) THEN
+        abort_message &
+                = 'if aerosol_couple is activated, config_inca need to be ' &
+                // 'aero or aeNP'
+        CALL abort_physic (modname, abort_message, 1)
+      ENDIF
+
+      rnebcon0(:, :) = 0.0
+      clwcon0(:, :) = 0.0
+      rnebcon(:, :) = 0.0
+      clwcon(:, :) = 0.0
+
+      print*, 'iflag_coupl,iflag_clos,iflag_wake', &
+              iflag_coupl, iflag_clos, iflag_wake
+      print*, 'iflag_cycle_diurne', iflag_cycle_diurne
+
+      IF (iflag_con==2.AND.iflag_cld_th>-1) THEN
+        abort_message = 'Tiedtke needs iflag_cld_th=-2 or -1'
+        CALL abort_physic (modname, abort_message, 1)
+      ENDIF
+
+
+      ! Initialiser les compteurs:
+
+      itap = 0
+      itaprad = 0
+      itapcv = 0
+      itapwk = 0
+
+      ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      !! Un petit travail \`a faire ici.
+      ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      IF (iflag_pbl>1) THEN
+        PRINT*, "Using method MELLOR&YAMADA"
+      ENDIF
+
+      ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ! FH 2008/05/02 changement lie a la lecture de nbapp_rad dans
+      ! phylmd plutot que dyn3d
+      ! Attention : la version precedente n'etait pas tres propre.
+      ! Il se peut qu'il faille prendre une valeur differente de nbapp_rad
+      ! pour obtenir le meme resultat.
+      !jyg for fh<
+      WRITE(lunout, *) 'Pas de temps phys_tstep pdtphys ', phys_tstep, pdtphys
+      IF (abs(phys_tstep - pdtphys)>1.e-10) THEN
+        abort_message = 'pas de temps doit etre entier en seconde pour orchidee et XIOS'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+      !>jyg
+      IF (MOD(NINT(86400. / phys_tstep), nbapp_rad)==0) THEN
+        radpas = NINT(86400. / phys_tstep) / nbapp_rad
+      ELSE
+        WRITE(lunout, *) 'le nombre de pas de temps physique doit etre un ', &
+                'multiple de nbapp_rad'
+        WRITE(lunout, *) 'changer nbapp_rad ou alors commenter ce test ', &
+                'mais 1+1<>2'
+        abort_message = 'nbre de pas de temps physique n est pas multiple ' &
+                // 'de nbapp_rad'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+      IF (nbapp_cv == 0) nbapp_cv = 86400. / phys_tstep
+      IF (nbapp_wk == 0) nbapp_wk = 86400. / phys_tstep
+      print *, 'physiq, nbapp_cv, nbapp_wk ', nbapp_cv, nbapp_wk
+      IF (MOD(NINT(86400. / phys_tstep), nbapp_cv)==0) THEN
+        cvpas_0 = NINT(86400. / phys_tstep) / nbapp_cv
+        cvpas = cvpas_0
+        print *, 'physiq, cvpas ', cvpas
+      ELSE
+        WRITE(lunout, *) 'le nombre de pas de temps physique doit etre un ', &
+                'multiple de nbapp_cv'
+        WRITE(lunout, *) 'changer nbapp_cv ou alors commenter ce test ', &
+                'mais 1+1<>2'
+        abort_message = 'nbre de pas de temps physique n est pas multiple ' &
+                // 'de nbapp_cv'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+      IF (MOD(NINT(86400. / phys_tstep), nbapp_wk)==0) THEN
+        wkpas = NINT(86400. / phys_tstep) / nbapp_wk
+        !       print *,'physiq, wkpas ',wkpas
+      ELSE
+        WRITE(lunout, *) 'le nombre de pas de temps physique doit etre un ', &
+                'multiple de nbapp_wk'
+        WRITE(lunout, *) 'changer nbapp_wk ou alors commenter ce test ', &
+                'mais 1+1<>2'
+        abort_message = 'nbre de pas de temps physique n est pas multiple ' &
+                // 'de nbapp_wk'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+      ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      CALL init_iophy_new(latitude_deg, longitude_deg)
+
+      !===================================================================
+      !IM stations CFMIP
+      nCFMIP = npCFMIP
+      OPEN(98, file = 'npCFMIP_param.data', status = 'old', &
+              form = 'formatted', iostat = iostat)
+      IF (iostat == 0) THEN
+        READ(98, *, end = 998) nCFMIP
+        998          CONTINUE
+        CLOSE(98)
+        IF(nCFMIP>npCFMIP) THEN
+          print*, 'nCFMIP > npCFMIP : augmenter npCFMIP et recompiler'
+          CALL abort_physic("physiq", "", 1)
+        ELSE
+          print*, 'physiq npCFMIP=', npCFMIP, 'nCFMIP=', nCFMIP
+        ENDIF
+
+        ALLOCATE(tabCFMIP(nCFMIP))
+        ALLOCATE(lonCFMIP(nCFMIP), latCFMIP(nCFMIP))
+        ALLOCATE(tabijGCM(nCFMIP))
+        ALLOCATE(lonGCM(nCFMIP), latGCM(nCFMIP))
+        ALLOCATE(iGCM(nCFMIP), jGCM(nCFMIP))
+
+        ! lecture des nCFMIP stations CFMIP, de leur numero
+        ! et des coordonnees geographiques lonCFMIP, latCFMIP
+
+        CALL read_CFMIP_point_locations(nCFMIP, tabCFMIP, &
+                lonCFMIP, latCFMIP)
+
+        ! identification des
+        ! 1) coordonnees lonGCM, latGCM des points CFMIP dans la
+        ! grille de LMDZ
+        ! 2) indices points tabijGCM de la grille physique 1d sur
+        ! klon points
+        ! 3) indices iGCM, jGCM de la grille physique 2d
+
+        CALL LMDZ_CFMIP_point_locations(nCFMIP, lonCFMIP, latCFMIP, &
+                tabijGCM, lonGCM, latGCM, iGCM, jGCM)
+
+      ELSE
+        ALLOCATE(tabijGCM(0))
+        ALLOCATE(lonGCM(0), latGCM(0))
+        ALLOCATE(iGCM(0), jGCM(0))
+      ENDIF
 
 #ifdef CPP_IOIPSL
@@ -1763,13 +1741,12 @@
 
 #endif
-       ecrit_reg = ecrit_reg * un_jour
-       ecrit_tra = ecrit_tra * un_jour
-
-       !XXXPB Positionner date0 pour initialisation de ORCHIDEE
-       date0 = jD_ref 
-       WRITE(*,*) 'physiq date0 : ',date0
-       !
-
-!       CALL create_climoz(read_climoz)
+      ecrit_reg = ecrit_reg * un_jour
+      ecrit_tra = ecrit_tra * un_jour
+
+      !XXXPB Positionner date0 pour initialisation de ORCHIDEE
+      date0 = jD_ref
+      WRITE(*, *) 'physiq date0 : ', date0
+
+      !       CALL create_climoz(read_climoz)
       IF (.NOT. create_etat0_limit) CALL init_aero_fromfile(flag_aerosol, aerosol_couple)  !! initialise aero from file for XIOS interpolation (unstructured_grid)
       IF (.NOT. create_etat0_limit) CALL init_readaerosolstrato(flag_aerosol_strat)  !! initialise aero strato from file for XIOS interpolation (unstructured_grid)
@@ -1802,5 +1779,5 @@
                fiwc_cosp0,prfl_cosp0,psfl_cosp0,pmflxr_cosp0,pmflxs_cosp0, &
                mr_ozone_cosp0,cldtau_cosp0,cldemi_cosp0,JrNt_cosp0)
-     
+
         CALL phys_cosp2(itap,phys_tstep,freq_cosp, &
                ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
@@ -1831,53 +1808,51 @@
                mr_ozone,cldtau, cldemi)
 #endif
-      ENDIF 
-
-       !
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! Nouvelle initialisation pour le rayonnement RRTM
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       CALL iniradia(klon,klev,paprs(1,1:klev+1))
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       CALL wake_ini(rg,rd,rv,prt_level)
-       CALL yamada_ini(klon,lunout,prt_level)
-       viscom=1.46E-5
-       viscoh=2.06E-5
-       CALL atke_ini(RG, RD, RPI, RCPD, RV, viscom, viscoh)
-       CALL thermcell_ini(iflag_thermals,prt_level,tau_thermals,lunout, &
-      RG,RD,RCPD,RKAPPA,RLVTT,RETV)
-       CALL ratqs_ini(klon,klev,iflag_thermals,lunout,nbsrf,is_lic,is_ter,RG,RV,RD,RCPD,RLSTT,RLVTT,RTT)
-       CALL lscp_ini(pdtphys,lunout,prt_level,ok_ice_sursat,iflag_ratqs,fl_cor_ebil,RCPD,RLSTT,RLVTT,RLMLT,RVTMP2,RTT,RD,RG,RV,RPI)
-       CALL blowing_snow_ini(RCPD, RLSTT, RLVTT, RLMLT, &
-                             RVTMP2, RTT,RD,RG, RV, RPI)
-       ! Test de coherence sur oc_cdnc utilisé uniquement par cloud_optics_prop
-       IF (ok_newmicro) then
-          IF (iflag_rrtm==1) THEN
+      ENDIF
+
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ! Nouvelle initialisation pour le rayonnement RRTM
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      CALL iniradia(klon, klev, paprs(1, 1:klev + 1))
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      CALL wake_ini(rg, rd, rv, prt_level)
+      CALL yamada_ini(klon, lunout, prt_level)
+      viscom = 1.46E-5
+      viscoh = 2.06E-5
+      CALL atke_ini(RG, RD, RPI, RCPD, RV, viscom, viscoh)
+      CALL thermcell_ini(iflag_thermals, prt_level, tau_thermals, lunout, &
+              RG, RD, RCPD, RKAPPA, RLVTT, RETV)
+      CALL ratqs_ini(klon, klev, iflag_thermals, lunout, nbsrf, is_lic, is_ter, RG, RV, RD, RCPD, RLSTT, RLVTT, RTT)
+      CALL lscp_ini(pdtphys, lunout, prt_level, ok_ice_sursat, iflag_ratqs, fl_cor_ebil, RCPD, RLSTT, RLVTT, RLMLT, RVTMP2, RTT, RD, RG, RV, RPI)
+      CALL blowing_snow_ini(RCPD, RLSTT, RLVTT, RLMLT, &
+              RVTMP2, RTT, RD, RG, RV, RPI)
+      ! Test de coherence sur oc_cdnc utilisé uniquement par cloud_optics_prop
+      IF (ok_newmicro) then
+        IF (iflag_rrtm==1) THEN
 #ifdef CPP_RRTM
              IF (ok_cdnc.AND.NRADLP.NE.3) THEN
              abort_message='RRTM choix incoherent NRADLP doit etre egal a 3 ' &
-                  // 'pour ok_cdnc' 
+                  // 'pour ok_cdnc'
              CALL abort_physic(modname,abort_message,1)
              ENDIF
 #else
 
-             abort_message='You should compile with -rrtm if running with '//'iflag_rrtm=1'
-             CALL abort_physic(modname,abort_message,1)
+          abort_message = 'You should compile with -rrtm if running with ' // 'iflag_rrtm=1'
+          CALL abort_physic(modname, abort_message, 1)
 #endif
-          ENDIF
-       ENDIF   
-       CALL cloud_optics_prop_ini(klon, prt_level, lunout, flag_aerosol, &
-   ok_cdnc, bl95_b0, &
-   bl95_b1, latitude_deg, rpi, rg, rd, &
-   zepsec, novlp, iflag_ice_thermo, ok_new_lscp)
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write*
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        ENDIF
+      ENDIF
+      CALL cloud_optics_prop_ini(klon, prt_level, lunout, flag_aerosol, &
+              ok_cdnc, bl95_b0, &
+              bl95_b1, latitude_deg, rpi, rg, rd, &
+              zepsec, novlp, iflag_ice_thermo, ok_new_lscp)
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write*
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 #ifdef REPROBUS
        CALL strataer_init
@@ -1885,371 +1860,369 @@
 #endif
 
-IF (CPPKEY_STRATAER) THEN
-       CALL strataer_init
-       CALL strataer_nuc_init
-       CALL strataer_emiss_init
+      IF (CPPKEY_STRATAER) THEN
+        CALL strataer_init
+        CALL strataer_nuc_init
+        CALL strataer_emiss_init
+      END IF
+
+      IF (CPPKEY_DUST) THEN
+        ! Quand on utilise SPLA, on force iflag_phytrac=1
+        CALL phytracr_spl_out_init()
+        CALL phys_output_write_spl(itap, pdtphys, paprs, pphis, &
+                pplay, lmax_th, aerosol_couple, &
+                ok_ade, ok_aie, ivap, ok_sync, &
+                ptconv, read_climoz, clevSTD, &
+                ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse, &
+                flag_aerosol, flag_aerosol_strat, ok_cdnc)
+      ELSE
+      ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1
+      ! donc seulement dans ce cas on doit appeler phytrac_init()
+      IF (iflag_phytrac == 1) THEN
+        CALL phytrac_init()
+      ENDIF
+      CALL phys_output_write(itap, pdtphys, paprs, pphis, &
+              pplay, lmax_th, aerosol_couple, &
+              ok_ade, ok_aie, ok_volcan, ivap, iliq, isol, ibs, ok_sync, &
+              ptconv, read_climoz, clevSTD, &
+              ptconvth, d_u, d_t, qx, d_qx, zmasse, &
+              flag_aerosol, flag_aerosol_strat, ok_cdnc, t, u1, v1)
 END IF
 
-#ifdef CPP_Dust
-       ! Quand on utilise SPLA, on force iflag_phytrac=1
-       CALL phytracr_spl_out_init()
-       CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,                  &
-                                pplay, lmax_th, aerosol_couple,                 &
-                                ok_ade, ok_aie, ivap, ok_sync,                  &
-                                ptconv, read_climoz, clevSTD,                   &
-                                ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
-                                flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#else
-       ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1 
-       ! donc seulement dans ce cas on doit appeler phytrac_init()
-       IF (iflag_phytrac == 1 ) THEN
-          CALL phytrac_init()
-       ENDIF
-       CALL phys_output_write(itap, pdtphys, paprs, pphis,                    &
-                              pplay, lmax_th, aerosol_couple,                 &
-                              ok_ade, ok_aie, ok_volcan, ivap, iliq, isol, ibs,  ok_sync,&
-                              ptconv, read_climoz, clevSTD,                   &
-                              ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
-                              flag_aerosol, flag_aerosol_strat, ok_cdnc, t, u1, v1)
-#endif
-
-
-       IF (using_xios) THEN
-         IF (is_omp_master) CALL xios_update_calendar(1)
-       ENDIF
-       
-       IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)
-       CALL create_etat0_limit_unstruct
-       CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)
-
-!jyg<
-       IF (iflag_pbl<=1) THEN
-          ! No TKE for Standard Physics
-          pbl_tke(:,:,:)=0.
-
-       ELSE IF (klon_glo==1) THEN
-          pbl_tke(:,:,is_ave) = 0.
-          pbl_eps(:,:,is_ave) = 0.
-          DO nsrf=1,nbsrf
-            DO k = 1,klev+1
-                 pbl_tke(:,k,is_ave) = pbl_tke(:,k,is_ave) &
-                     +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
-                 pbl_eps(:,k,is_ave) = pbl_eps(:,k,is_ave) &
-                     +pctsrf(:,nsrf)*pbl_eps(:,k,nsrf)
-            ENDDO
+
+      IF (using_xios) THEN
+        IF (is_omp_master) CALL xios_update_calendar(1)
+      ENDIF
+
+      IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz, ok_daily_climoz)
+      CALL create_etat0_limit_unstruct
+      CALL phyetat0 ("startphy.nc", clesphy0, tabcntr0)
+
+      !jyg<
+      IF (iflag_pbl<=1) THEN
+        ! No TKE for Standard Physics
+        pbl_tke(:, :, :) = 0.
+
+      ELSE IF (klon_glo==1) THEN
+        pbl_tke(:, :, is_ave) = 0.
+        pbl_eps(:, :, is_ave) = 0.
+        DO nsrf = 1, nbsrf
+          DO k = 1, klev + 1
+            pbl_tke(:, k, is_ave) = pbl_tke(:, k, is_ave) &
+                    + pctsrf(:, nsrf) * pbl_tke(:, k, nsrf)
+            pbl_eps(:, k, is_ave) = pbl_eps(:, k, is_ave) &
+                    + pctsrf(:, nsrf) * pbl_eps(:, k, nsrf)
           ENDDO
-       ELSE
-          pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??
-!>jyg
-          pbl_eps(:,:,is_ave) = 0.
-       ENDIF
-       !IM begin
-       print*,'physiq: clwcon rnebcon ratqs',clwcon(1,1),rnebcon(1,1) &
-            ,ratqs(1,1)
-       !IM end
-
-
-       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       !
-       ! on remet le calendrier a zero
-       !
-       IF (raz_date == 1) THEN
-          itau_phy = 0
-       ENDIF
-
-!       IF (ABS(phys_tstep-pdtphys).GT.0.001) THEN
-!          WRITE(lunout,*) 'Pas physique n est pas correct',phys_tstep, &
-!               pdtphys
-!          abort_message='Pas physique n est pas correct '
-!          !           call abort_physic(modname,abort_message,1)
-!          phys_tstep=pdtphys
-!       ENDIF
-       IF (nlon /= klon) THEN
-          WRITE(lunout,*)'nlon et klon ne sont pas coherents', nlon,  &
-               klon
-          abort_message='nlon et klon ne sont pas coherents'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       IF (nlev /= klev) THEN
-          WRITE(lunout,*)'nlev et klev ne sont pas coherents', nlev, &
-               klev
-          abort_message='nlev et klev ne sont pas coherents'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-       !
-       IF (phys_tstep*REAL(radpas)>21600..AND.iflag_cycle_diurne>=1) THEN
-          WRITE(lunout,*)'Nbre d appels au rayonnement insuffisant'
-          WRITE(lunout,*)"Au minimum 4 appels par jour si cycle diurne"
-          abort_message='Nbre d appels au rayonnement insuffisant'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       ! Initialisation pour la convection de K.E. et pour les poches froides
-       !
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-       WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con
-       WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl
-       !
-       !KE43
-       ! Initialisation pour la convection de K.E. (sb):
-       IF (iflag_con>=3) THEN
-
-          WRITE(lunout,*)"*** Convection de Kerry Emanuel 4.3  "
-          WRITE(lunout,*) &
-               "On va utiliser le melange convectif des traceurs qui"
-          WRITE(lunout,*)"est calcule dans convect4.3"
-          WRITE(lunout,*)" !!! penser aux logical flags de phytrac"
-
-          DO i = 1, klon
-             ema_cbmf(i) = 0.
-             ema_pcb(i)  = 0.
-             ema_pct(i)  = 0.
-             !          ema_workcbmf(i) = 0.
+        ENDDO
+      ELSE
+        pbl_tke(:, :, is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??
+        !>jyg
+        pbl_eps(:, :, is_ave) = 0.
+      ENDIF
+      !IM begin
+      print*, 'physiq: clwcon rnebcon ratqs', clwcon(1, 1), rnebcon(1, 1) &
+              , ratqs(1, 1)
+      !IM end
+
+
+      ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      ! on remet le calendrier a zero
+
+      IF (raz_date == 1) THEN
+        itau_phy = 0
+      ENDIF
+
+      !       IF (ABS(phys_tstep-pdtphys).GT.0.001) THEN
+      !          WRITE(lunout,*) 'Pas physique n est pas correct',phys_tstep, &
+      !               pdtphys
+      !          abort_message='Pas physique n est pas correct '
+      !          !           call abort_physic(modname,abort_message,1)
+      !          phys_tstep=pdtphys
+      !       ENDIF
+      IF (nlon /= klon) THEN
+        WRITE(lunout, *)'nlon et klon ne sont pas coherents', nlon, &
+                klon
+        abort_message = 'nlon et klon ne sont pas coherents'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+      IF (nlev /= klev) THEN
+        WRITE(lunout, *)'nlev et klev ne sont pas coherents', nlev, &
+                klev
+        abort_message = 'nlev et klev ne sont pas coherents'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      IF (phys_tstep * REAL(radpas)>21600..AND.iflag_cycle_diurne>=1) THEN
+        WRITE(lunout, *)'Nbre d appels au rayonnement insuffisant'
+        WRITE(lunout, *)"Au minimum 4 appels par jour si cycle diurne"
+        abort_message = 'Nbre d appels au rayonnement insuffisant'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+      ! Initialisation pour la convection de K.E. et pour les poches froides
+
+      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+      WRITE(lunout, *)"Clef pour la convection, iflag_con=", iflag_con
+      WRITE(lunout, *)"Clef pour le driver de la convection, ok_cvl=", ok_cvl
+
+      !KE43
+      ! Initialisation pour la convection de K.E. (sb):
+      IF (iflag_con>=3) THEN
+
+        WRITE(lunout, *)"*** Convection de Kerry Emanuel 4.3  "
+        WRITE(lunout, *) &
+                "On va utiliser le melange convectif des traceurs qui"
+        WRITE(lunout, *)"est calcule dans convect4.3"
+        WRITE(lunout, *)" !!! penser aux logical flags de phytrac"
+
+        DO i = 1, klon
+          ema_cbmf(i) = 0.
+          ema_pcb(i) = 0.
+          ema_pct(i) = 0.
+          !          ema_workcbmf(i) = 0.
+        ENDDO
+        !IM15/11/02 rajout initialisation ibas_con,itop_con cf. SB =>BEG
+        DO i = 1, klon
+          ibas_con(i) = 1
+          itop_con(i) = 1
+        ENDDO
+        !IM15/11/02 rajout initialisation ibas_con,itop_con cf. SB =>END
+        !================================================================
+        !CR:04.12.07: initialisations poches froides
+        ! Controle de ALE et ALP pour la fermeture convective (jyg)
+        IF (iflag_wake>=1) THEN
+          CALL ini_wake(0., 0., it_wape_prescr, wape_prescr, fip_prescr &
+                  , alp_bl_prescr, ale_bl_prescr)
+          ! 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU)
+          !        print*,'apres ini_wake iflag_cld_th=', iflag_cld_th
+
+          ! Initialize tendencies of wake state variables (for some flag values
+          ! they are not computed).
+          d_deltat_wk(:, :) = 0.
+          d_deltaq_wk(:, :) = 0.
+          d_deltat_wk_gw(:, :) = 0.
+          d_deltaq_wk_gw(:, :) = 0.
+          d_deltat_vdf(:, :) = 0.
+          d_deltaq_vdf(:, :) = 0.
+          d_deltat_the(:, :) = 0.
+          d_deltaq_the(:, :) = 0.
+          d_deltat_ajs_cv(:, :) = 0.
+          d_deltaq_ajs_cv(:, :) = 0.
+          d_s_wk(:) = 0.
+          d_s_a_wk(:) = 0.
+          d_dens_wk(:) = 0.
+          d_dens_a_wk(:) = 0.
+        ENDIF  !  (iflag_wake>=1)
+
+        !        do i = 1,klon
+        !           Ale_bl(i)=0.
+        !           Alp_bl(i)=0.
+        !        enddo
+
+        !ELSE
+        !   ALLOCATE(tabijGCM(0))
+        !   ALLOCATE(lonGCM(0), latGCM(0))
+        !   ALLOCATE(iGCM(0), jGCM(0))
+      ENDIF  !  (iflag_con.GE.3)
+
+      DO i = 1, klon
+        rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i) * zsig(i) / 2.0)
+      ENDDO
+
+      !34EK
+      IF (ok_orodr) THEN
+
+        ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        ! FH sans doute a enlever de finitivement ou, si on le
+        ! garde, l'activer justement quand ok_orodr = false.
+        ! ce rugoro est utilise par la couche limite et fait double emploi
+        ! avec les param\'etrisations sp\'ecifiques de Francois Lott.
+        !           DO i=1,klon
+        !             rugoro(i) = MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
+        !           ENDDO
+        ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+        IF (ok_strato) THEN
+          CALL SUGWD_strato(klon, klev, paprs, pplay)
+        ELSE
+          CALL SUGWD(klon, klev, paprs, pplay)
+        ENDIF
+
+        DO i = 1, klon
+          zuthe(i) = 0.
+          zvthe(i) = 0.
+          IF (zstd(i)>10.) THEN
+            zuthe(i) = (1. - zgam(i)) * cos(zthe(i))
+            zvthe(i) = (1. - zgam(i)) * sin(zthe(i))
+          ENDIF
+        ENDDO
+      ENDIF
+
+
+      lmt_pas = NINT(86400. / phys_tstep * 1.0)   ! tous les jours
+      WRITE(lunout, *)'La frequence de lecture surface est de ', &
+              lmt_pas
+
+      capemaxcels = 't_max(X)'
+      t2mincels = 't_min(X)'
+      t2maxcels = 't_max(X)'
+      tinst = 'inst(X)'
+      tave = 'ave(X)'
+      !IM cf. AM 081204 BEG
+      write(lunout, *)'AVANT HIST IFLAG_CON=', iflag_con
+      !IM cf. AM 081204 END
+
+      !=============================================================
+      !   Initialisation des sorties
+      !=============================================================
+
+      IF (using_xios) THEN
+        ! Get "missing_val" value from XML files (from temperature variable)
+        IF (is_omp_master) CALL xios_get_field_attr("temp", default_value = missing_val)
+        CALL bcast_omp(missing_val)
+      ENDIF
+
+      IF (using_xios) THEN
+        ! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only
+        ! initialised at that moment
+        ! Get "missing_val" value from XML files (from temperature variable)
+        IF (is_omp_master) CALL xios_get_field_attr("temp", default_value = missing_val)
+        CALL bcast_omp(missing_val)
+
+        ! Now we activate some double radiation call flags only if some
+        ! diagnostics are requested, otherwise there is no point in doing this
+        IF (is_master) THEN
+          !--setting up swaero_diag to TRUE in XIOS case
+          IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &
+                  xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &
+                  xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &
+                  (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &
+                          xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &
+                  !!!--for now these fields are not in the XML files so they are omitted
+                  !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &
+                  swaero_diag = .TRUE.
+
+          !--setting up swaerofree_diag to TRUE in XIOS case
+          IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
+                  xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
+                  xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
+                  xios_field_is_active("LWupTOAcleanclr")) &
+                  swaerofree_diag = .TRUE.
+
+          !--setting up dryaod_diag to TRUE in XIOS case
+          DO naero = 1, naero_tot - 1
+            IF (xios_field_is_active("dryod550_" // name_aero_tau(naero))) dryaod_diag = .TRUE.
           ENDDO
-          !IM15/11/02 rajout initialisation ibas_con,itop_con cf. SB =>BEG
-          DO i = 1, klon
-             ibas_con(i) = 1
-             itop_con(i) = 1
-          ENDDO
-          !IM15/11/02 rajout initialisation ibas_con,itop_con cf. SB =>END
-          !================================================================
-          !CR:04.12.07: initialisations poches froides
-          ! Controle de ALE et ALP pour la fermeture convective (jyg)
-          IF (iflag_wake>=1) THEN
-             CALL ini_wake(0.,0.,it_wape_prescr,wape_prescr,fip_prescr &
-                  ,alp_bl_prescr, ale_bl_prescr)
-             ! 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU)
-             !        print*,'apres ini_wake iflag_cld_th=', iflag_cld_th
-             !
-             ! Initialize tendencies of wake state variables (for some flag values
-             ! they are not computed).
-             d_deltat_wk(:,:) = 0.
-             d_deltaq_wk(:,:) = 0.
-             d_deltat_wk_gw(:,:) = 0.
-             d_deltaq_wk_gw(:,:) = 0.
-             d_deltat_vdf(:,:) = 0.
-             d_deltaq_vdf(:,:) = 0.
-             d_deltat_the(:,:) = 0.
-             d_deltaq_the(:,:) = 0.
-             d_deltat_ajs_cv(:,:) = 0.
-             d_deltaq_ajs_cv(:,:) = 0.
-             d_s_wk(:) = 0.
-             d_s_a_wk(:) = 0.
-             d_dens_wk(:) = 0.
-             d_dens_a_wk(:) = 0.
-          ENDIF  !  (iflag_wake>=1)
-
-          !        do i = 1,klon
-          !           Ale_bl(i)=0.
-          !           Alp_bl(i)=0.
-          !        enddo
-
-       !ELSE
-       !   ALLOCATE(tabijGCM(0))
-       !   ALLOCATE(lonGCM(0), latGCM(0))
-       !   ALLOCATE(iGCM(0), jGCM(0))
-       ENDIF  !  (iflag_con.GE.3)
-       !
-       DO i=1,klon
-          rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
-       ENDDO
-
-       !34EK
-       IF (ok_orodr) THEN
-
-          ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          ! FH sans doute a enlever de finitivement ou, si on le
-          ! garde, l'activer justement quand ok_orodr = false.
-          ! ce rugoro est utilise par la couche limite et fait double emploi
-          ! avec les param\'etrisations sp\'ecifiques de Francois Lott.
-          !           DO i=1,klon
-          !             rugoro(i) = MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
-          !           ENDDO
-          ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-          IF (ok_strato) THEN
-             CALL SUGWD_strato(klon,klev,paprs,pplay)
-          ELSE
-             CALL SUGWD(klon,klev,paprs,pplay)
-          ENDIF
-
-          DO i=1,klon
-             zuthe(i)=0.
-             zvthe(i)=0.
-             IF (zstd(i)>10.) THEN
-                zuthe(i)=(1.-zgam(i))*cos(zthe(i))
-                zvthe(i)=(1.-zgam(i))*sin(zthe(i))
-             ENDIF
-          ENDDO
-       ENDIF
-       !
-       !
-       lmt_pas = NINT(86400./phys_tstep * 1.0)   ! tous les jours
-       WRITE(lunout,*)'La frequence de lecture surface est de ',  &
-            lmt_pas
-       !
-       capemaxcels = 't_max(X)'
-       t2mincels = 't_min(X)'
-       t2maxcels = 't_max(X)'
-       tinst = 'inst(X)'
-       tave = 'ave(X)'
-       !IM cf. AM 081204 BEG
-       write(lunout,*)'AVANT HIST IFLAG_CON=',iflag_con
-       !IM cf. AM 081204 END
-       !
-       !=============================================================
-       !   Initialisation des sorties
-       !=============================================================
-
-       IF (using_xios) THEN    
-         ! Get "missing_val" value from XML files (from temperature variable)
-         IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val)
-         CALL bcast_omp(missing_val)
-       ENDIF
-
-       IF (using_xios) THEN    
-         ! Need to put this initialisation after phyetat0 as in the coupled model the XIOS context is only
-         ! initialised at that moment
-         ! Get "missing_val" value from XML files (from temperature variable)
-         IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val)
-         CALL bcast_omp(missing_val)
-       ! 
-       ! Now we activate some double radiation call flags only if some
-       ! diagnostics are requested, otherwise there is no point in doing this
-         IF (is_master) THEN
-           !--setting up swaero_diag to TRUE in XIOS case 
-           IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. & 
-              xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. & 
-              xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  & 
-                (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. & 
-                                    xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  & 
-              !!!--for now these fields are not in the XML files so they are omitted 
-              !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) & 
-              swaero_diag=.TRUE. 
- 
-           !--setting up swaerofree_diag to TRUE in XIOS case 
-           IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
-              xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
-              xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
-              xios_field_is_active("LWupTOAcleanclr")) &
-              swaerofree_diag=.TRUE. 
- 
-           !--setting up dryaod_diag to TRUE in XIOS case 
-           DO naero = 1, naero_tot-1
-             IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 
-           ENDDO
-           !
-          !--setting up ok_4xCO2atm to TRUE in XIOS case 
-           IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 
-              xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
-              xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
-              xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
-              xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
-              xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
-              ok_4xCO2atm=.TRUE. 
-           ENDIF
-           !$OMP BARRIER
-           CALL bcast(swaero_diag)
-           CALL bcast(swaerofree_diag)
-           CALL bcast(dryaod_diag)
-           CALL bcast(ok_4xCO2atm)
-         ENDIF !using_xios
-       !
-       CALL printflag( tabcntr0,radpas,ok_journe, &
-            ok_instan, ok_region )
-       !
-       !
-       ! Prescrire l'ozone dans l'atmosphere
-       !
-       !c         DO i = 1, klon
-       !c         DO k = 1, klev
-       !c            CALL o3cm (paprs(i,k)/100.,paprs(i,k+1)/100., wo(i,k),20)
-       !c         ENDDO
-       !c         ENDDO
-       !
-       IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL
-IF (CPPKEY_INCA) THEN
+
+          !--setting up ok_4xCO2atm to TRUE in XIOS case
+          IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &
+                  xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
+                  xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
+                  xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
+                  xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
+                  xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
+                  ok_4xCO2atm = .TRUE.
+        ENDIF
+        !$OMP BARRIER
+        CALL bcast(swaero_diag)
+        CALL bcast(swaerofree_diag)
+        CALL bcast(dryaod_diag)
+        CALL bcast(ok_4xCO2atm)
+      ENDIF !using_xios
+
+      CALL printflag(tabcntr0, radpas, ok_journe, &
+              ok_instan, ok_region)
+
+
+      ! Prescrire l'ozone dans l'atmosphere
+
+      !c         DO i = 1, klon
+      !c         DO k = 1, klev
+      !c            CALL o3cm (paprs(i,k)/100.,paprs(i,k+1)/100., wo(i,k),20)
+      !c         ENDDO
+      !c         ENDDO
+
+      IF (ANY(type_trac == ['inca', 'inco'])) THEN ! ModThL
+        IF (CPPKEY_INCA) THEN
           CALL VTe(VTphysiq)
           CALL VTb(VTinca)
           calday = REAL(days_elapsed) + jH_cur
-          WRITE(lunout,*) 'initial time chemini', days_elapsed, calday
-
-          call init_const_lmdz( &
-          ndays, nbsrf, is_oce,is_sic, is_ter,is_lic, calend, &
-          config_inca)
-
-          CALL init_inca_geometry( & 
-               longitude, latitude, &
-               boundslon, boundslat, &
-               cell_area, ind_cell_glo) 
-
-          if (grid_type==unstructured) THEN 
-             CALL chemini(  pplay, &
-                  nbp_lon, nbp_lat, &
-                  latitude_deg, &
-                  longitude_deg, &
-                  presnivs, &
-                  calday, &
-                  klon, &
-                  nqtot, &
-                  nqo+nqCO2, &
-                  pdtphys, &
-                  annee_ref, &
-                  year_cur, &
-                  day_ref,  &
-                  day_ini, &
-                  start_time, &
-                  itau_phy, &
-                  date0, &
-                  chemistry_couple, &
-                  init_source, &
-                  init_tauinca, &
-                  init_pizinca, &
-                  init_cginca, &
-                  init_ccminca)
+          WRITE(lunout, *) 'initial time chemini', days_elapsed, calday
+
+          call init_const_lmdz(&
+                  ndays, nbsrf, is_oce, is_sic, is_ter, is_lic, calend, &
+                  config_inca)
+
+          CALL init_inca_geometry(&
+                  longitude, latitude, &
+                  boundslon, boundslat, &
+                  cell_area, ind_cell_glo)
+
+          if (grid_type==unstructured) THEN
+            CALL chemini(pplay, &
+                    nbp_lon, nbp_lat, &
+                    latitude_deg, &
+                    longitude_deg, &
+                    presnivs, &
+                    calday, &
+                    klon, &
+                    nqtot, &
+                    nqo + nqCO2, &
+                    pdtphys, &
+                    annee_ref, &
+                    year_cur, &
+                    day_ref, &
+                    day_ini, &
+                    start_time, &
+                    itau_phy, &
+                    date0, &
+                    chemistry_couple, &
+                    init_source, &
+                    init_tauinca, &
+                    init_pizinca, &
+                    init_cginca, &
+                    init_ccminca)
           ELSE
-             CALL chemini(  pplay, &
-                  nbp_lon, nbp_lat, &
-                  latitude_deg, &
-                  longitude_deg, &
-                  presnivs, &
-                  calday, &
-                  klon, &
-                  nqtot, &
-                  nqo+nqCO2, &
-                  pdtphys, &
-                  annee_ref, &
-                  year_cur, &
-                  day_ref,  &
-                  day_ini, &
-                  start_time, &
-                  itau_phy, &
-                  date0, &
-                  chemistry_couple, &
-                  init_source, &
-                  init_tauinca, &
-                  init_pizinca, &
-                  init_cginca, &
-                  init_ccminca, &
-                  io_lon, &
-                  io_lat)
+            CALL chemini(pplay, &
+                    nbp_lon, nbp_lat, &
+                    latitude_deg, &
+                    longitude_deg, &
+                    presnivs, &
+                    calday, &
+                    klon, &
+                    nqtot, &
+                    nqo + nqCO2, &
+                    pdtphys, &
+                    annee_ref, &
+                    year_cur, &
+                    day_ref, &
+                    day_ini, &
+                    start_time, &
+                    itau_phy, &
+                    date0, &
+                    chemistry_couple, &
+                    init_source, &
+                    init_tauinca, &
+                    init_pizinca, &
+                    init_cginca, &
+                    init_ccminca, &
+                    io_lon, &
+                    io_lat)
           ENDIF
 
 
           ! initialisation des variables depuis le restart de inca
-          ccm(:,:,:) = init_ccminca
-          tau_aero(:,:,:,:) = init_tauinca
-          piz_aero(:,:,:,:) = init_pizinca
-          cg_aero(:,:,:,:) = init_cginca
-!          
-
+          ccm(:, :, :) = init_ccminca
+          tau_aero(:, :, :, :) = init_tauinca
+          piz_aero(:, :, :, :) = init_pizinca
+          cg_aero(:, :, :, :) = init_cginca
 
           CALL VTe(VTinca)
           CALL VTb(VTphysiq)
-END IF
-       ENDIF
-       !
-       IF (type_trac == 'repr') THEN
+        END IF
+      ENDIF
+
+      IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
           CALL chemini_rep(  &
@@ -2264,102 +2237,100 @@
                io_lat)
 #endif
-       ENDIF
-
-       !$omp single
-       IF (read_climoz >= 1) CALL open_climoz(ncid_climoz, press_cen_climoz,   &
-           press_edg_climoz, time_climoz, ok_daily_climoz, adjust_tropopause)
-       !$omp end single
-       !
-       !IM betaCRF
-       pfree=70000. !Pa
-       beta_pbl=1.
-       beta_free=1.
-       lon1_beta=-180.
-       lon2_beta=+180.
-       lat1_beta=90.
-       lat2_beta=-90.
-       mskocean_beta=.FALSE.
-
-       !albedo SB >>>
-       SELECT CASE(nsw)
-       CASE(2)
-          SFRWL(1)=0.45538747
-          SFRWL(2)=0.54461211
-       CASE(4)
-          SFRWL(1)=0.45538747
-          SFRWL(2)=0.32870591
-          SFRWL(3)=0.18568763
-          SFRWL(4)=3.02191470E-02
-       CASE(6)
-          SFRWL(1)=1.28432794E-03
-          SFRWL(2)=0.12304168
-          SFRWL(3)=0.33106142
-          SFRWL(4)=0.32870591
-          SFRWL(5)=0.18568763
-          SFRWL(6)=3.02191470E-02
-       END SELECT
-       !albedo SB <<<
-
-       OPEN(99,file='beta_crf.data',status='old', &
-            form='formatted',err=9999)
-       READ(99,*,end=9998) pfree
-       READ(99,*,end=9998) beta_pbl
-       READ(99,*,end=9998) beta_free
-       READ(99,*,end=9998) lon1_beta
-       READ(99,*,end=9998) lon2_beta
-       READ(99,*,end=9998) lat1_beta
-       READ(99,*,end=9998) lat2_beta
-       READ(99,*,end=9998) mskocean_beta
-9998   Continue
-       CLOSE(99)
-9999   Continue
-       WRITE(*,*)'pfree=',pfree
-       WRITE(*,*)'beta_pbl=',beta_pbl
-       WRITE(*,*)'beta_free=',beta_free
-       WRITE(*,*)'lon1_beta=',lon1_beta
-       WRITE(*,*)'lon2_beta=',lon2_beta
-       WRITE(*,*)'lat1_beta=',lat1_beta
-       WRITE(*,*)'lat2_beta=',lat2_beta
-       WRITE(*,*)'mskocean_beta=',mskocean_beta
+      ENDIF
+
+      !$omp single
+      IF (read_climoz >= 1) CALL open_climoz(ncid_climoz, press_cen_climoz, &
+              press_edg_climoz, time_climoz, ok_daily_climoz, adjust_tropopause)
+      !$omp end single
+
+      !IM betaCRF
+      pfree = 70000. !Pa
+      beta_pbl = 1.
+      beta_free = 1.
+      lon1_beta = -180.
+      lon2_beta = +180.
+      lat1_beta = 90.
+      lat2_beta = -90.
+      mskocean_beta = .FALSE.
+
+      !albedo SB >>>
+      SELECT CASE(nsw)
+      CASE(2)
+        SFRWL(1) = 0.45538747
+        SFRWL(2) = 0.54461211
+      CASE(4)
+        SFRWL(1) = 0.45538747
+        SFRWL(2) = 0.32870591
+        SFRWL(3) = 0.18568763
+        SFRWL(4) = 3.02191470E-02
+      CASE(6)
+        SFRWL(1) = 1.28432794E-03
+        SFRWL(2) = 0.12304168
+        SFRWL(3) = 0.33106142
+        SFRWL(4) = 0.32870591
+        SFRWL(5) = 0.18568763
+        SFRWL(6) = 3.02191470E-02
+      END SELECT
+      !albedo SB <<<
+
+      OPEN(99, file = 'beta_crf.data', status = 'old', &
+              form = 'formatted', err = 9999)
+      READ(99, *, end = 9998) pfree
+      READ(99, *, end = 9998) beta_pbl
+      READ(99, *, end = 9998) beta_free
+      READ(99, *, end = 9998) lon1_beta
+      READ(99, *, end = 9998) lon2_beta
+      READ(99, *, end = 9998) lat1_beta
+      READ(99, *, end = 9998) lat2_beta
+      READ(99, *, end = 9998) mskocean_beta
+      9998   Continue
+      CLOSE(99)
+      9999   Continue
+      WRITE(*, *)'pfree=', pfree
+      WRITE(*, *)'beta_pbl=', beta_pbl
+      WRITE(*, *)'beta_free=', beta_free
+      WRITE(*, *)'lon1_beta=', lon1_beta
+      WRITE(*, *)'lon2_beta=', lon2_beta
+      WRITE(*, *)'lat1_beta=', lat1_beta
+      WRITE(*, *)'lat2_beta=', lat2_beta
+      WRITE(*, *)'mskocean_beta=', mskocean_beta
 
       !lwoff=y : offset LW CRE for radiation code and other schemes
       !lwoff=y : betalwoff=1.
-      betalwoff=0.
+      betalwoff = 0.
       IF (ok_lwoff) THEN
-         betalwoff=1.
-      ENDIF
-      WRITE(*,*)'ok_lwoff=',ok_lwoff
-      ! 
+        betalwoff = 1.
+      ENDIF
+      WRITE(*, *)'ok_lwoff=', ok_lwoff
+
       !lwoff=y to begin only sollw and sollwdown are set up to CS values
       sollw = sollw + betalwoff * (sollw0 - sollw)
-      sollwdown(:)= sollwdown(:) + betalwoff *(-1.*ZFLDN0(:,1) - &
-                    sollwdown(:))
-
-
+      sollwdown(:) = sollwdown(:) + betalwoff * (-1. * ZFLDN0(:, 1) - &
+              sollwdown(:))
 
     ENDIF
-    !
+
     !   ****************     Fin  de   IF ( debut  )   ***************
-    !
-    !
+
+
     ! Incrementer le compteur de la physique
-    !
-    itap   = itap + 1
+
+    itap = itap + 1
     IF (is_master .OR. prt_level > 9) THEN
-      IF (prt_level > 5 .or. MOD(itap,5) == 0) THEN
-         WRITE(LUNOUT,*)'Entering physics elapsed seconds since start ', current_time
-         WRITE(LUNOUT,100)year_cur,mth_cur,day_cur,hour/3600.
- 100     FORMAT('Date = ',i4.4,' / ',i2.2, ' / ',i2.2,' : ',f20.17)
+      IF (prt_level > 5 .or. MOD(itap, 5) == 0) THEN
+        WRITE(LUNOUT, *)'Entering physics elapsed seconds since start ', current_time
+        WRITE(LUNOUT, 100)year_cur, mth_cur, day_cur, hour / 3600.
+        100     FORMAT('Date = ', i4.4, ' / ', i2.2, ' / ', i2.2, ' : ', f20.17)
       ENDIF
     ENDIF
-    !
-    !
-    ! Update fraction of the sub-surfaces (pctsrf) and 
-    ! initialize, where a new fraction has appeared, all variables depending 
+
+
+    ! Update fraction of the sub-surfaces (pctsrf) and
+    ! initialize, where a new fraction has appeared, all variables depending
     ! on the surface fraction.
-    !
-    CALL change_srf_frac(itap, phys_tstep, days_elapsed+1,  &
-         pctsrf, fevap, z0m, z0h, agesno,              &
-         falb_dir, falb_dif, ftsol, ustar, u10m, v10m, pbl_tke)
+
+    CALL change_srf_frac(itap, phys_tstep, days_elapsed + 1, &
+            pctsrf, fevap, z0m, z0h, agesno, &
+            falb_dir, falb_dif, ftsol, ustar, u10m, v10m, pbl_tke)
 
     ! Update time and other variables in Reprobus
@@ -2374,136 +2345,136 @@
     ! Tendances bidons pour les processus qui n'affectent pas certaines
     ! variables.
-    du0(:,:)=0.
-    dv0(:,:)=0.
+    du0(:, :) = 0.
+    dv0(:, :) = 0.
     dt0 = 0.
-    dq0(:,:)=0.
-    dql0(:,:)=0.
-    dqi0(:,:)=0.
-    dqbs0(:,:)=0.
+    dq0(:, :) = 0.
+    dql0(:, :) = 0.
+    dqi0(:, :) = 0.
+    dqbs0(:, :) = 0.
     dsig0(:) = 0.
     ddens0(:) = 0.
-    wkoccur1(:)=1
-    !
+    wkoccur1(:) = 1
+
     ! Mettre a zero des variables de sortie (pour securite)
-    !
+
     DO i = 1, klon
-       d_ps(i) = 0.0
+      d_ps(i) = 0.0
     ENDDO
     DO k = 1, klev
-       DO i = 1, klon
-          d_t(i,k) = 0.0
-          d_u(i,k) = 0.0
-          d_v(i,k) = 0.0
-       ENDDO
+      DO i = 1, klon
+        d_t(i, k) = 0.0
+        d_u(i, k) = 0.0
+        d_v(i, k) = 0.0
+      ENDDO
     ENDDO
     DO iq = 1, nqtot
-       DO k = 1, klev
-          DO i = 1, klon
-             d_qx(i,k,iq) = 0.0
-          ENDDO
-       ENDDO
+      DO k = 1, klev
+        DO i = 1, klon
+          d_qx(i, k, iq) = 0.0
+        ENDDO
+      ENDDO
     ENDDO
-    beta_prec_fisrt(:,:)=0.
-    beta_prec(:,:)=0.
-    !
-    !   Output variables from the convective scheme should not be set to 0 
+    beta_prec_fisrt(:, :) = 0.
+    beta_prec(:, :) = 0.
+
+    !   Output variables from the convective scheme should not be set to 0
     !   since convection is not always called at every time step.
     IF (ok_bug_cv_trac) THEN
-      da(:,:)=0.
-      mp(:,:)=0.
-      phi(:,:,:)=0.
+      da(:, :) = 0.
+      mp(:, :) = 0.
+      phi(:, :, :) = 0.
       ! RomP >>>
-      phi2(:,:,:)=0.
-      epmlmMm(:,:,:)=0.
-      eplaMm(:,:)=0.
-      d1a(:,:)=0.
-      dam(:,:)=0.
-      pmflxr(:,:)=0.
-      pmflxs(:,:)=0.
+      phi2(:, :, :) = 0.
+      epmlmMm(:, :, :) = 0.
+      eplaMm(:, :) = 0.
+      d1a(:, :) = 0.
+      dam(:, :) = 0.
+      pmflxr(:, :) = 0.
+      pmflxs(:, :) = 0.
       ! RomP <<<
     ENDIF
-    !
+
     ! Ne pas affecter les valeurs entrees de u, v, h, et q
-    !
+
     DO k = 1, klev
-       DO i = 1, klon
-          t_seri(i,k)  = t(i,k)
-          u_seri(i,k)  = u(i,k)
-          v_seri(i,k)  = v(i,k)
-          q_seri(i,k)  = qx(i,k,ivap)
-          ql_seri(i,k) = qx(i,k,iliq)
-          qbs_seri(i,k) = 0.
-          !CR: ATTENTION, on rajoute la variable glace
-          IF (nqo==2) THEN             !--vapour and liquid only
-             qs_seri(i,k) = 0.
-             rneb_seri(i,k) = 0.
-          ELSE IF (nqo==3) THEN        !--vapour, liquid and ice
-             qs_seri(i,k) = qx(i,k,isol)
-             rneb_seri(i,k) = 0.
-          ELSE IF (nqo>=4) THEN        !--vapour, liquid, ice and rneb and blowing snow
-             qs_seri(i,k) = qx(i,k,isol)
-             IF (ok_ice_sursat) THEN
-               rneb_seri(i,k) = qx(i,k,irneb)
-             ENDIF
-             IF (ok_bs) THEN
-               qbs_seri(i,k)= qx(i,k,ibs)
-             ENDIF
+      DO i = 1, klon
+        t_seri(i, k) = t(i, k)
+        u_seri(i, k) = u(i, k)
+        v_seri(i, k) = v(i, k)
+        q_seri(i, k) = qx(i, k, ivap)
+        ql_seri(i, k) = qx(i, k, iliq)
+        qbs_seri(i, k) = 0.
+        !CR: ATTENTION, on rajoute la variable glace
+        IF (nqo==2) THEN             !--vapour and liquid only
+          qs_seri(i, k) = 0.
+          rneb_seri(i, k) = 0.
+        ELSE IF (nqo==3) THEN        !--vapour, liquid and ice
+          qs_seri(i, k) = qx(i, k, isol)
+          rneb_seri(i, k) = 0.
+        ELSE IF (nqo>=4) THEN        !--vapour, liquid, ice and rneb and blowing snow
+          qs_seri(i, k) = qx(i, k, isol)
+          IF (ok_ice_sursat) THEN
+            rneb_seri(i, k) = qx(i, k, irneb)
           ENDIF
-       ENDDO
+          IF (ok_bs) THEN
+            qbs_seri(i, k) = qx(i, k, ibs)
+          ENDIF
+        ENDIF
+      ENDDO
     ENDDO
-    !
-    !--OB water mass fixer 
+
+    !--OB water mass fixer
     IF (ok_water_mass_fixer) THEN
-    !--store initial water burden
-    qql1(:)=0.0
-    DO k = 1, klev
-      qql1(:)=qql1(:)+(q_seri(:,k)+ql_seri(:,k))*zmasse(:,k)
-      IF (nqo >= 3) THEN
-        qql1(:)=qql1(:)+qs_seri(:,k)*zmasse(:,k)
-      ENDIF
-      IF (ok_bs) THEN
-        qql1(:)=qql1(:)+qbs_seri(:,k)*zmasse(:,k)
-      ENDIF
-    ENDDO
+      !--store initial water burden
+      qql1(:) = 0.0
+      DO k = 1, klev
+        qql1(:) = qql1(:) + (q_seri(:, k) + ql_seri(:, k)) * zmasse(:, k)
+        IF (nqo >= 3) THEN
+          qql1(:) = qql1(:) + qs_seri(:, k) * zmasse(:, k)
+        ENDIF
+        IF (ok_bs) THEN
+          qql1(:) = qql1(:) + qbs_seri(:, k) * zmasse(:, k)
+        ENDIF
+      ENDDO
     ENDIF
     !--fin mass fixer
 
-    tke0(:,:)=pbl_tke(:,:,is_ave)
+    tke0(:, :) = pbl_tke(:, :, is_ave)
     IF (nqtot > nqo) THEN
-       ! water isotopes are not included in tr_seri
-       itr = 0
-       DO iq = 1, nqtot
-         IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-         itr = itr+1
-          DO  k = 1, klev
-             DO  i = 1, klon
-                tr_seri(i,k,itr) = qx(i,k,iq)
-             ENDDO
+      ! water isotopes are not included in tr_seri
+      itr = 0
+      DO iq = 1, nqtot
+        IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+        itr = itr + 1
+        DO  k = 1, klev
+          DO  i = 1, klon
+            tr_seri(i, k, itr) = qx(i, k, iq)
           ENDDO
-       ENDDO
+        ENDDO
+      ENDDO
     ELSE
-! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!!
-       tr_seri(:,:,strIdx(tracers(:)%name,addPhase('H2O','g'))) = 0.0
+      ! DC: make sure the final "1" index was meant for 1st H2O phase (vapor) !!!
+      tr_seri(:, :, strIdx(tracers(:)%name, addPhase('H2O', 'g'))) = 0.0
     ENDIF
-!
-! Temporary solutions adressing ticket #104 and the non initialisation of tr_ancien
-! LF
+
+    ! Temporary solutions adressing ticket #104 and the non initialisation of tr_ancien
+    ! LF
     IF (debut) THEN
-      WRITE(lunout,*)' WARNING: tr_ancien initialised to tr_seri'
-       itr = 0
-       do iq = 1, nqtot
-         IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-         itr = itr+1
-         tr_ancien(:,:,itr)=tr_seri(:,:,itr)       
-       enddo
+      WRITE(lunout, *)' WARNING: tr_ancien initialised to tr_seri'
+      itr = 0
+      do iq = 1, nqtot
+        IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+        itr = itr + 1
+        tr_ancien(:, :, itr) = tr_seri(:, :, itr)
+      enddo
     ENDIF
-    !
+
     DO i = 1, klon
-       ztsol(i) = 0.
+      ztsol(i) = 0.
     ENDDO
     DO nsrf = 1, nbsrf
-       DO i = 1, klon
-          ztsol(i) = ztsol(i) + ftsol(i,nsrf)*pctsrf(i,nsrf)
-       ENDDO
+      DO i = 1, klon
+        ztsol(i) = ztsol(i) + ftsol(i, nsrf) * pctsrf(i, nsrf)
+      ENDDO
     ENDDO
     ! Initialize variables used for diagnostic purpose
@@ -2511,110 +2482,109 @@
 
     ! Diagnostiquer la tendance dynamique
-    !
+
     IF (ancien_ok) THEN
-    !
-       d_u_dyn(:,:)  = (u_seri(:,:)-u_ancien(:,:))/phys_tstep
-       d_v_dyn(:,:)  = (v_seri(:,:)-v_ancien(:,:))/phys_tstep
-       d_t_dyn(:,:)  = (t_seri(:,:)-t_ancien(:,:))/phys_tstep
-       d_q_dyn(:,:)  = (q_seri(:,:)-q_ancien(:,:))/phys_tstep
-       d_ql_dyn(:,:) = (ql_seri(:,:)-ql_ancien(:,:))/phys_tstep
-       d_qs_dyn(:,:) = (qs_seri(:,:)-qs_ancien(:,:))/phys_tstep
-       d_qbs_dyn(:,:) = (qbs_seri(:,:)-qbs_ancien(:,:))/phys_tstep
-       CALL water_int(klon,klev,q_seri,zmasse,zx_tmp_fi2d)
-       d_q_dyn2d(:)=(zx_tmp_fi2d(:)-prw_ancien(:))/phys_tstep
-       CALL water_int(klon,klev,ql_seri,zmasse,zx_tmp_fi2d)
-       d_ql_dyn2d(:)=(zx_tmp_fi2d(:)-prlw_ancien(:))/phys_tstep
-       CALL water_int(klon,klev,qs_seri,zmasse,zx_tmp_fi2d)
-       d_qs_dyn2d(:)=(zx_tmp_fi2d(:)-prsw_ancien(:))/phys_tstep
-       CALL water_int(klon,klev,qbs_seri,zmasse,zx_tmp_fi2d)
-       d_qbs_dyn2d(:)=(zx_tmp_fi2d(:)-prbsw_ancien(:))/phys_tstep
-       ! !! RomP >>>   td dyn traceur
-       IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep
-       ! !! RomP <<<
-       !!d_rneb_dyn(:,:)=(rneb_seri(:,:)-rneb_ancien(:,:))/phys_tstep
-       d_rneb_dyn(:,:)=0.0
+
+      d_u_dyn(:, :) = (u_seri(:, :) - u_ancien(:, :)) / phys_tstep
+      d_v_dyn(:, :) = (v_seri(:, :) - v_ancien(:, :)) / phys_tstep
+      d_t_dyn(:, :) = (t_seri(:, :) - t_ancien(:, :)) / phys_tstep
+      d_q_dyn(:, :) = (q_seri(:, :) - q_ancien(:, :)) / phys_tstep
+      d_ql_dyn(:, :) = (ql_seri(:, :) - ql_ancien(:, :)) / phys_tstep
+      d_qs_dyn(:, :) = (qs_seri(:, :) - qs_ancien(:, :)) / phys_tstep
+      d_qbs_dyn(:, :) = (qbs_seri(:, :) - qbs_ancien(:, :)) / phys_tstep
+      CALL water_int(klon, klev, q_seri, zmasse, zx_tmp_fi2d)
+      d_q_dyn2d(:) = (zx_tmp_fi2d(:) - prw_ancien(:)) / phys_tstep
+      CALL water_int(klon, klev, ql_seri, zmasse, zx_tmp_fi2d)
+      d_ql_dyn2d(:) = (zx_tmp_fi2d(:) - prlw_ancien(:)) / phys_tstep
+      CALL water_int(klon, klev, qs_seri, zmasse, zx_tmp_fi2d)
+      d_qs_dyn2d(:) = (zx_tmp_fi2d(:) - prsw_ancien(:)) / phys_tstep
+      CALL water_int(klon, klev, qbs_seri, zmasse, zx_tmp_fi2d)
+      d_qbs_dyn2d(:) = (zx_tmp_fi2d(:) - prbsw_ancien(:)) / phys_tstep
+      ! !! RomP >>>   td dyn traceur
+      IF (nqtot > nqo) d_tr_dyn(:, :, :) = (tr_seri(:, :, :) - tr_ancien(:, :, :)) / phys_tstep
+      ! !! RomP <<<
+      !!d_rneb_dyn(:,:)=(rneb_seri(:,:)-rneb_ancien(:,:))/phys_tstep
+      d_rneb_dyn(:, :) = 0.0
     ELSE
-       d_u_dyn(:,:)  = 0.0
-       d_v_dyn(:,:)  = 0.0
-       d_t_dyn(:,:)  = 0.0
-       d_q_dyn(:,:)  = 0.0
-       d_ql_dyn(:,:) = 0.0
-       d_qs_dyn(:,:) = 0.0
-       d_q_dyn2d(:)  = 0.0
-       d_ql_dyn2d(:) = 0.0
-       d_qs_dyn2d(:) = 0.0
-       d_qbs_dyn2d(:)= 0.0
-       ! !! RomP >>>   td dyn traceur
-       IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0
-       ! !! RomP <<<
-       d_rneb_dyn(:,:)=0.0
-       d_qbs_dyn(:,:)=0.0
-       ancien_ok = .TRUE.
+      d_u_dyn(:, :) = 0.0
+      d_v_dyn(:, :) = 0.0
+      d_t_dyn(:, :) = 0.0
+      d_q_dyn(:, :) = 0.0
+      d_ql_dyn(:, :) = 0.0
+      d_qs_dyn(:, :) = 0.0
+      d_q_dyn2d(:) = 0.0
+      d_ql_dyn2d(:) = 0.0
+      d_qs_dyn2d(:) = 0.0
+      d_qbs_dyn2d(:) = 0.0
+      ! !! RomP >>>   td dyn traceur
+      IF (nqtot > nqo) d_tr_dyn(:, :, :) = 0.0
+      ! !! RomP <<<
+      d_rneb_dyn(:, :) = 0.0
+      d_qbs_dyn(:, :) = 0.0
+      ancien_ok = .TRUE.
     ENDIF
-    !
+
     ! Ajouter le geopotentiel du sol:
-    !
+
     DO k = 1, klev
-       DO i = 1, klon
-          zphi(i,k) = pphi(i,k) + pphis(i)
-       ENDDO
+      DO i = 1, klon
+        zphi(i, k) = pphi(i, k) + pphis(i)
+      ENDDO
     ENDDO
-    !
+
     ! Verifier les temperatures
-    !
+
     !IM BEG
     IF (check) THEN
-       amn=MIN(ftsol(1,is_ter),1000.)
-       amx=MAX(ftsol(1,is_ter),-1000.)
-       DO i=2, klon
-          amn=MIN(ftsol(i,is_ter),amn)
-          amx=MAX(ftsol(i,is_ter),amx)
-       ENDDO
-       !
-       PRINT*,' debut avant hgardfou min max ftsol',itap,amn,amx
+      amn = MIN(ftsol(1, is_ter), 1000.)
+      amx = MAX(ftsol(1, is_ter), -1000.)
+      DO i = 2, klon
+        amn = MIN(ftsol(i, is_ter), amn)
+        amx = MAX(ftsol(i, is_ter), amx)
+      ENDDO
+
+      PRINT*, ' debut avant hgardfou min max ftsol', itap, amn, amx
     ENDIF !(check) THEN
     !IM END
-    !
-    CALL hgardfou(t_seri,ftsol,'debutphy',abortphy)
-    IF (abortphy==1) Print*,'ERROR ABORT hgardfou debutphy'
-
-    !
+
+    CALL hgardfou(t_seri, ftsol, 'debutphy', abortphy)
+    IF (abortphy==1) Print*, 'ERROR ABORT hgardfou debutphy'
+
     !IM BEG
     IF (check) THEN
-       amn=MIN(ftsol(1,is_ter),1000.)
-       amx=MAX(ftsol(1,is_ter),-1000.)
-       DO i=2, klon
-          amn=MIN(ftsol(i,is_ter),amn)
-          amx=MAX(ftsol(i,is_ter),amx)
-       ENDDO
-       !
-       PRINT*,' debut apres hgardfou min max ftsol',itap,amn,amx
+      amn = MIN(ftsol(1, is_ter), 1000.)
+      amx = MAX(ftsol(1, is_ter), -1000.)
+      DO i = 2, klon
+        amn = MIN(ftsol(i, is_ter), amn)
+        amx = MAX(ftsol(i, is_ter), amx)
+      ENDDO
+
+      PRINT*, ' debut apres hgardfou min max ftsol', itap, amn, amx
     ENDIF !(check) THEN
     !IM END
-    !
+
     ! Mettre en action les conditions aux limites (albedo, sst, etc.).
     ! Prescrire l'ozone et calculer l'albedo sur l'ocean.
-    !
+
     ! Update ozone if day change
-    IF (MOD(itap-1,lmt_pas) == 0) THEN
-       IF (read_climoz <= 0) THEN
-          ! Once per day, update ozone from Royer:
-          IF (solarlong0<-999.) then
-             ! Generic case with evolvoing season
-             zzz=real(days_elapsed+1)
-          ELSE IF (abs(solarlong0-1000.)<1.e-4) then
-             ! Particular case with annual mean insolation
-             zzz=real(90) ! could be revisited
-             IF (read_climoz/=-1) THEN
-                abort_message ='read_climoz=-1 is recommended when ' &
-                     // 'solarlong0=1000.'
-                CALL abort_physic (modname,abort_message,1)
-             ENDIF
-          ELSE
-             ! Case where the season is imposed with solarlong0
-             zzz=real(90) ! could be revisited
+    IF (MOD(itap - 1, lmt_pas) == 0) THEN
+      IF (read_climoz <= 0) THEN
+        ! Once per day, update ozone from Royer:
+        IF (solarlong0<-999.) then
+          ! Generic case with evolvoing season
+          zzz = real(days_elapsed + 1)
+        ELSE IF (abs(solarlong0 - 1000.)<1.e-4) then
+          ! Particular case with annual mean insolation
+          zzz = real(90) ! could be revisited
+          IF (read_climoz/=-1) THEN
+            abort_message = 'read_climoz=-1 is recommended when ' &
+                    // 'solarlong0=1000.'
+            CALL abort_physic (modname, abort_message, 1)
           ENDIF
-
-          wo(:,:,1)=ozonecm(latitude_deg, paprs,read_climoz,rjour=zzz)
+        ELSE
+          ! Case where the season is imposed with solarlong0
+          zzz = real(90) ! could be revisited
+        ENDIF
+
+        wo(:, :, 1) = ozonecm(latitude_deg, paprs, read_climoz, rjour = zzz)
 #ifdef REPROBUS
           ptrop=dyn_tropopause(t_seri, ztsol, paprs, pplay, rot)/100.
@@ -2625,5 +2595,5 @@
              B=Z2-fac*alog(pplay(i,itroprep(i)))
              ttrop(i)= fac*alog(ptrop(i))+B
-!
+
              Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit
              Z2= 1.e-3 * ( pphi(i,itroprep(i))  +pphis(i) ) / gravit
@@ -2633,39 +2603,39 @@
           ENDDO
 #endif
-       ELSE
-          !--- ro3i = elapsed days number since current year 1st january, 0h
-          ro3i=days_elapsed+jh_cur-jh_1jan
-          !--- scaling for old style files (360 records)
-          IF(SIZE(time_climoz)==360.AND..NOT.ok_daily_climoz) ro3i=ro3i*360./year_len
-          IF(adjust_tropopause) THEN
-             CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz),   &
-                      ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:,1),    &
-                      time_climoz ,  longitude_deg,   latitude_deg,          &
-                      dyn_tropopause(t_seri, ztsol, paprs, pplay, rot))
-          ELSE
-             CALL regr_pr_time_av(ncid_climoz,  vars_climoz(1:read_climoz),  &
-                      ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:,1),    &
-                      time_climoz )
-          ENDIF
-          ! Convert from mole fraction of ozone to column density of ozone in a
-          ! cell, in kDU:
-          FORALL (l = 1: read_climoz) wo(:, :, l) = wo(:, :, l) * rmo3 / rmd &
-               * zmasse / dobson_u / 1e3
-          ! (By regridding ozone values for LMDZ only once a day, we
-          ! have already neglected the variation of pressure in one
-          ! day. So do not recompute "wo" at each time step even if
-          ! "zmasse" changes a little.)
-       ENDIF
+      ELSE
+        !--- ro3i = elapsed days number since current year 1st january, 0h
+        ro3i = days_elapsed + jh_cur - jh_1jan
+        !--- scaling for old style files (360 records)
+        IF(SIZE(time_climoz)==360.AND..NOT.ok_daily_climoz) ro3i = ro3i * 360. / year_len
+        IF(adjust_tropopause) THEN
+          CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz), &
+                  ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:, 1), &
+                  time_climoz, longitude_deg, latitude_deg, &
+                  dyn_tropopause(t_seri, ztsol, paprs, pplay, rot))
+        ELSE
+          CALL regr_pr_time_av(ncid_climoz, vars_climoz(1:read_climoz), &
+                  ro3i, 'C', press_cen_climoz, pplay, wo, paprs(:, 1), &
+                  time_climoz)
+        ENDIF
+        ! Convert from mole fraction of ozone to column density of ozone in a
+        ! cell, in kDU:
+        FORALL (l = 1:read_climoz) wo(:, :, l) = wo(:, :, l) * rmo3 / rmd &
+                * zmasse / dobson_u / 1e3
+        ! (By regridding ozone values for LMDZ only once a day, we
+        ! have already neglected the variation of pressure in one
+        ! day. So do not recompute "wo" at each time step even if
+        ! "zmasse" changes a little.)
+      ENDIF
     ENDIF
-    !
+
     ! Re-evaporer l'eau liquide nuageuse
-    !
-     CALL reevap (klon,klev,iflag_ice_thermo,t_seri,q_seri,ql_seri,qs_seri, &
-           d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
-
-     CALL add_phys_tend &
-            (du0,dv0,d_t_eva,d_q_eva,d_ql_eva,d_qi_eva,dqbs0,paprs,&
-               'eva',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('eva',itap)
+
+    CALL reevap (klon, klev, iflag_ice_thermo, t_seri, q_seri, ql_seri, qs_seri, &
+            d_t_eva, d_q_eva, d_ql_eva, d_qi_eva)
+
+    CALL add_phys_tend &
+            (du0, dv0, d_t_eva, d_q_eva, d_ql_eva, d_qi_eva, dqbs0, paprs, &
+            'eva', abortphy, flag_inhib_tend, itap, 0)
+    CALL prt_enerbil('eva', itap)
 
     !=========================================================================
@@ -2675,23 +2645,23 @@
 
     ! !!   jyg 17 Sep 2010 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    CALL ymds2ju(year_cur, mth_eq, day_eq,0., jD_eq)
+    CALL ymds2ju(year_cur, mth_eq, day_eq, 0., jD_eq)
     day_since_equinox = (jD_cur + jH_cur) - jD_eq
-    !
-    !   choix entre calcul de la longitude solaire vraie ou valeur fixee a 
+
+    !   choix entre calcul de la longitude solaire vraie ou valeur fixee a
     !   solarlong0
     IF (solarlong0<-999.) THEN
-       IF (new_orbit) THEN
-          ! calcul selon la routine utilisee pour les planetes
-          CALL solarlong(day_since_equinox, zlongi, dist)
-       ELSE
-          ! calcul selon la routine utilisee pour l'AR4
-          CALL orbite(REAL(days_elapsed+1),zlongi,dist)
-       ENDIF
+      IF (new_orbit) THEN
+        ! calcul selon la routine utilisee pour les planetes
+        CALL solarlong(day_since_equinox, zlongi, dist)
+      ELSE
+        ! calcul selon la routine utilisee pour l'AR4
+        CALL orbite(REAL(days_elapsed + 1), zlongi, dist)
+      ENDIF
     ELSE
-       zlongi=solarlong0  ! longitude solaire vraie
-       dist=1.            ! distance au soleil / moyenne 
+      zlongi = solarlong0  ! longitude solaire vraie
+      dist = 1.            ! distance au soleil / moyenne
     ENDIF
 
-    IF (prt_level>=1) write(lunout,*)'Longitude solaire ',zlongi,solarlong0,dist
+    IF (prt_level>=1) write(lunout, *)'Longitude solaire ', zlongi, solarlong0, dist
 
 
@@ -2703,66 +2673,66 @@
     ! Cet ensoleillement est sym\'etrique autour de l'\'equateur et
     ! non nul aux poles.
-    IF (abs(solarlong0-1000.)<1.e-4) THEN
-       CALL zenang_an(iflag_cycle_diurne>=1,jH_cur, &
-            latitude_deg,longitude_deg,rmu0,fract)
-       swradcorr(:) = 1.0
-       JrNt(:) = 1.0
-       zrmu0(:) = rmu0(:)
+    IF (abs(solarlong0 - 1000.)<1.e-4) THEN
+      CALL zenang_an(iflag_cycle_diurne>=1, jH_cur, &
+              latitude_deg, longitude_deg, rmu0, fract)
+      swradcorr(:) = 1.0
+      JrNt(:) = 1.0
+      zrmu0(:) = rmu0(:)
     ELSE
-       ! recode par Olivier Boucher en sept 2015
-       SELECT CASE (iflag_cycle_diurne)
-       CASE(0)  
-          !  Sans cycle diurne
-          CALL angle(zlongi, latitude_deg, fract, rmu0)
-          swradcorr = 1.0
-          JrNt = 1.0
-          zrmu0 = rmu0
-       CASE(1)  
-          !  Avec cycle diurne sans application des poids
-          !  bit comparable a l ancienne formulation cycle_diurne=true
-          !  on integre entre gmtime et gmtime+radpas
-          zdtime=phys_tstep*REAL(radpas) ! pas de temps du rayonnement (s)
-          CALL zenang(zlongi,jH_cur,0.0,zdtime, &
-               latitude_deg,longitude_deg,rmu0,fract)
-          zrmu0 = rmu0
-          swradcorr = 1.0
-          ! Calcul du flag jour-nuit
-          JrNt = 0.0
-          WHERE (fract>0.0) JrNt = 1.0
-       CASE(2)  
-          !  Avec cycle diurne sans application des poids
-          !  On integre entre gmtime-pdtphys et gmtime+pdtphys*(radpas-1)
-          !  Comme cette routine est appele a tous les pas de temps de
-          !  la physique meme si le rayonnement n'est pas appele je
-          !  remonte en arriere les radpas-1 pas de temps
-          !  suivant. Petite ruse avec MOD pour prendre en compte le
-          !  premier pas de temps de la physique pendant lequel
-          !  itaprad=0
-          zdtime1=phys_tstep*REAL(-MOD(itaprad,radpas)-1)      
-          zdtime2=phys_tstep*REAL(radpas-MOD(itaprad,radpas)-1) 
-          CALL zenang(zlongi,jH_cur,zdtime1,zdtime2, &
-               latitude_deg,longitude_deg,rmu0,fract)
-          !
-          ! Calcul des poids
-          !
-          zdtime1=-phys_tstep !--on corrige le rayonnement pour representer le
-          zdtime2=0.0    !--pas de temps de la physique qui se termine
-          CALL zenang(zlongi,jH_cur,zdtime1,zdtime2, &
-               latitude_deg,longitude_deg,zrmu0,zfract)
-          swradcorr = 0.0
-          WHERE (rmu0>=1.e-10 .OR. fract>=1.e-10) &
-               swradcorr=zfract/fract*zrmu0/rmu0
-          ! Calcul du flag jour-nuit
-          JrNt = 0.0
-          WHERE (zfract>0.0) JrNt = 1.0
-       END SELECT
+      ! recode par Olivier Boucher en sept 2015
+      SELECT CASE (iflag_cycle_diurne)
+      CASE(0)
+        !  Sans cycle diurne
+        CALL angle(zlongi, latitude_deg, fract, rmu0)
+        swradcorr = 1.0
+        JrNt = 1.0
+        zrmu0 = rmu0
+      CASE(1)
+        !  Avec cycle diurne sans application des poids
+        !  bit comparable a l ancienne formulation cycle_diurne=true
+        !  on integre entre gmtime et gmtime+radpas
+        zdtime = phys_tstep * REAL(radpas) ! pas de temps du rayonnement (s)
+        CALL zenang(zlongi, jH_cur, 0.0, zdtime, &
+                latitude_deg, longitude_deg, rmu0, fract)
+        zrmu0 = rmu0
+        swradcorr = 1.0
+        ! Calcul du flag jour-nuit
+        JrNt = 0.0
+        WHERE (fract>0.0) JrNt = 1.0
+      CASE(2)
+        !  Avec cycle diurne sans application des poids
+        !  On integre entre gmtime-pdtphys et gmtime+pdtphys*(radpas-1)
+        !  Comme cette routine est appele a tous les pas de temps de
+        !  la physique meme si le rayonnement n'est pas appele je
+        !  remonte en arriere les radpas-1 pas de temps
+        !  suivant. Petite ruse avec MOD pour prendre en compte le
+        !  premier pas de temps de la physique pendant lequel
+        !  itaprad=0
+        zdtime1 = phys_tstep * REAL(-MOD(itaprad, radpas) - 1)
+        zdtime2 = phys_tstep * REAL(radpas - MOD(itaprad, radpas) - 1)
+        CALL zenang(zlongi, jH_cur, zdtime1, zdtime2, &
+                latitude_deg, longitude_deg, rmu0, fract)
+
+        ! Calcul des poids
+
+        zdtime1 = -phys_tstep !--on corrige le rayonnement pour representer le
+        zdtime2 = 0.0    !--pas de temps de la physique qui se termine
+        CALL zenang(zlongi, jH_cur, zdtime1, zdtime2, &
+                latitude_deg, longitude_deg, zrmu0, zfract)
+        swradcorr = 0.0
+        WHERE (rmu0>=1.e-10 .OR. fract>=1.e-10) &
+                swradcorr = zfract / fract * zrmu0 / rmu0
+        ! Calcul du flag jour-nuit
+        JrNt = 0.0
+        WHERE (zfract>0.0) JrNt = 1.0
+      END SELECT
     ENDIF
-    sza_o = ACOS (rmu0) *180./pi
+    sza_o = ACOS (rmu0) * 180. / pi
 
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
@@ -2771,6 +2741,6 @@
     ! Cela implique tous les interactions des sous-surfaces et la
     ! partie diffusion turbulent du couche limit.
-    ! 
-    ! Certains varibales de sorties de pbl_surface sont utiliser que pour 
+
+    ! Certains varibales de sorties de pbl_surface sont utiliser que pour
     ! ecriture des fihiers hist_XXXX.nc, ces sont :
     !   qsol,      zq2m,      s_pblh,  s_lcl,
@@ -2783,205 +2753,202 @@
     !   d_ts,      fevap,     fluxlat, t2m,
     !   wfbils,    fluxt,   fluxu, fluxv,
-    !
-    ! Certains ne sont pas utiliser du tout : 
+
+    ! Certains ne sont pas utiliser du tout :
     !   dsens, devap, zxsnow, zxfluxt, zxfluxq, q2m, fluxq
-    !
 
     ! Calcul de l'humidite de saturation au niveau du sol
 
-! Tests Fredho, instensibilite au pas de temps -------------------------------
-! A detruire en 2024 une fois les tests documentes et les choix faits        !
-! Conservation des variables avant l'appel à l a diffusion pour les tehrmic  !
-    if (iflag_thermals_tenv / 10 == 1 ) then                                 !
-        do k=1,klev                                                          !
-           do i=1,klon                                                       !
-              t_env(i,k)=t_seri(i,k)                                         !
-              q_env(i,k)=q_seri(i,k)                                         !
-           enddo                                                             !
-        enddo                                                                !
-    else if (iflag_thermals_tenv / 10 == 2 ) then                            !
-        do k=1,klev                                                          !
-           do i=1,klon                                                       !
-              t_env(i,k)=t_seri(i,k)                                         !
-           enddo                                                             !
-        enddo                                                                !
+    ! Tests Fredho, instensibilite au pas de temps -------------------------------
+    ! A detruire en 2024 une fois les tests documentes et les choix faits        !
+    ! Conservation des variables avant l'appel à l a diffusion pour les tehrmic  !
+    if (iflag_thermals_tenv / 10 == 1) then                                 !
+      do k = 1, klev                                                          !
+        do i = 1, klon                                                       !
+          t_env(i, k) = t_seri(i, k)                                         !
+          q_env(i, k) = q_seri(i, k)                                         !
+        enddo                                                             !
+      enddo                                                                !
+    else if (iflag_thermals_tenv / 10 == 2) then                            !
+      do k = 1, klev                                                          !
+        do i = 1, klon                                                       !
+          t_env(i, k) = t_seri(i, k)                                         !
+        enddo                                                             !
+      enddo                                                                !
     endif                                                                    !
-! Tests Fredho, instensibilite au pas de temps -------------------------------
-
+    ! Tests Fredho, instensibilite au pas de temps -------------------------------
 
     IF (iflag_pbl/=0) THEN
 
-       !jyg+nrlmd<
-!!jyg       IF (prt_level .ge. 2 .and. mod(iflag_pbl_split,2) .eq. 1) THEN
-       IF (prt_level >= 2 .and. mod(iflag_pbl_split,10) >= 1) THEN
-          print *,'debut du splitting de la PBL, wake_s = ', wake_s(:)
-          print *,'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:,1)
-          print *,'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:,1)
-       ENDIF
-       ! !!
-       !>jyg+nrlmd
-       !
-       !-------gustiness calculation-------!
-       !ym : Warning gustiness non inialized for iflag_gusts=2 & iflag_gusts=3
-       gustiness=0  !ym missing init
-       
-       IF (iflag_gusts==0) THEN
-          gustiness(1:klon)=0
-       ELSE IF (iflag_gusts==1) THEN
-          gustiness(1:klon)=f_gust_bl*ale_bl(1:klon)+f_gust_wk*ale_wake(1:klon)
-       ELSE IF (iflag_gusts==2) THEN
-          gustiness(1:klon)=f_gust_bl*ale_bl_stat(1:klon)+f_gust_wk*ale_wake(1:klon)
-       !!!! modif olivier torres
-       ELSE IF (iflag_gusts==3) THEN
-          w_et=wstar(1,3)
-          jlr_g_s=(0.65*w_et)**2
-          pr_et=rain_con*8640
-          jlr_g_c = (((19.8*(pr_et(1:klon)**2))/(1.5+pr_et(1:klon)+pr_et(1:klon)**2))**(0.4))**2
-          gustiness(1:klon)=jlr_g_c+jlr_g_s
-!!       write(*,*) "rain ",pr_et
-!!       write(*,*) "jlr_g_c",jlr_g_c
-!!       write(*,*) "wstar",wstar(1,3)
-!!       write(*,*) "jlr_g_s",jlr_g_s
-          ! ELSE IF (iflag_gusts==2) THEN
-          !    do i = 1, klon
-          !       gustiness(i)=f_gust_bl*ale_bl(i)+sigma_wk(i)*f_gust_wk&
-          !           *ale_wake(i) !! need to make sigma_wk accessible here
-          !    enddo
-          ! ELSE IF (iflag_gusts==3) THEN
-          !    do i = 1, klon
-          !       gustiness(i)=f_gust_bl*alp_bl(i)+f_gust_wk*alp_wake(i)
-          !    enddo
-       ENDIF
-
-       CALL pbl_surface(  &
-            phys_tstep,     date0,     itap,    days_elapsed+1, &
-            debut,     lafin, &
-            longitude_deg, latitude_deg, rugoro,  zrmu0,      &
-            sollwdown,    cldt,      &
-            rain_fall, snow_fall, bs_fall, solsw,   solswfdiff, sollw,     &
-            gustiness,                                &
-            t_seri,    q_seri,   qbs_seri,  u_seri,  v_seri,    &
-                                !nrlmd+jyg<
-            wake_deltat, wake_deltaq, wake_cstar, wake_s, &
-                                !>nrlmd+jyg
-            pplay,     paprs,     pctsrf,             &
-            ftsol,SFRWL,falb_dir,falb_dif,ustar,u10m,v10m,wstar, &
-                                !albedo SB <<<
-            cdragh,    cdragm,  u1,    v1,            &
-            beta_aridity, &
-                                !albedo SB >>>
-                                ! albsol1,   albsol2,   sens,    evap,      &
-            albsol_dir,   albsol_dif,   sens,    evap, snowerosion, &  
-                                !albedo SB <<<
-            albsol3_lic,runoff,   snowhgt,   qsnow, to_ice, sissnow, &
-            zxtsol,    zxfluxlat, zt2m,    qsat2m,  zn2mout, &
-            d_t_vdf,   d_q_vdf, d_qbs_vdf,  d_u_vdf, d_v_vdf, d_t_diss, &
-                                !nrlmd<
-                                !jyg<
-            d_t_vdf_w, d_q_vdf_w, &
-            d_t_vdf_x, d_q_vdf_x, &
-            sens_x, zxfluxlat_x, sens_w, zxfluxlat_w, &
-                                !>jyg
-            delta_tsurf,wake_dens, &
-            cdragh_x,cdragh_w,cdragm_x,cdragm_w, &
-            kh,kh_x,kh_w, &
-                                !>nrlmd
-            coefh(1:klon,1:klev,1:nbsrf+1), coefm(1:klon,1:klev,1:nbsrf+1), &
-            slab_wfbils,                 &
-            qsol,      zq2m,      s_pblh,  s_lcl, &
-                                !jyg<
-            s_pblh_x, s_lcl_x, s_pblh_w, s_lcl_w, &
-                                !>jyg
-            s_capCL,   s_oliqCL,  s_cteiCL,s_pblT, &
-            s_therm,   s_trmb1,   s_trmb2, s_trmb3, &
-            zustar, zu10m,     zv10m,   fder, &
-            zxqsurf, delta_qsurf,   rh2m,      zxfluxu, zxfluxv, &
-            z0m, z0h,     agesno,    fsollw,  fsolsw, &
-            d_ts,      fevap,     fluxlat, t2m, &
-            wfbils, wfevap, & 
-            fluxt,   fluxu,  fluxv, &
-            dsens,     devap,     zxsnow, &
-            zxfluxt,   zxfluxq,  zxfluxqbs,  q2m, fluxq, fluxqbs, pbl_tke, pbl_eps,  &
-                                !nrlmd+jyg<
-            wake_delta_pbl_TKE, &
-                                !>nrlmd+jyg
-             treedrg )
-!FC
-       !
-       !  Add turbulent diffusion tendency to the wake difference variables
-!!jyg       IF (mod(iflag_pbl_split,2) .NE. 0) THEN
-       IF (mod(iflag_pbl_split,10) /= 0) THEN
-!jyg<
-          d_deltat_vdf(:,:) = d_t_vdf_w(:,:)-d_t_vdf_x(:,:)
-          d_deltaq_vdf(:,:) = d_q_vdf_w(:,:)-d_q_vdf_x(:,:)
-          CALL add_wake_tend &
-             (d_deltat_vdf, d_deltaq_vdf, dsig0, dsig0, ddens0, ddens0, wkoccur1, 'vdf', abortphy) 
-       ELSE
-          d_deltat_vdf(:,:) = 0.
-          d_deltaq_vdf(:,:) = 0.
-!>jyg
-       ENDIF
-
-       !---------------------------------------------------------------------
-       ! ajout des tendances de la diffusion turbulente
-       IF (klon_glo==1) THEN
-          CALL add_pbl_tend &
-               (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,d_qbs_vdf,paprs,&
-               'vdf',abortphy,flag_inhib_tend,itap)
-       ELSE
-          CALL add_phys_tend &
-               (d_u_vdf,d_v_vdf,d_t_vdf+d_t_diss,d_q_vdf,dql0,dqi0,d_qbs_vdf,paprs,&
-               'vdf',abortphy,flag_inhib_tend,itap,0)
-       ENDIF
-       CALL prt_enerbil('vdf',itap)
-
-       !--------------------------------------------------------------------
-
-       IF (mydebug) THEN
-          CALL writefield_phy('u_seri',u_seri,nbp_lev)
-          CALL writefield_phy('v_seri',v_seri,nbp_lev)
-          CALL writefield_phy('t_seri',t_seri,nbp_lev)
-          CALL writefield_phy('q_seri',q_seri,nbp_lev)
-       ENDIF
-
-       !albedo SB >>>
-       albsol1=0.
-       albsol2=0.
-       falb1=0.
-       falb2=0.
-       SELECT CASE(nsw)
-       CASE(2)
-          albsol1=albsol_dir(:,1)
-          albsol2=albsol_dir(:,2)
-          falb1=falb_dir(:,1,:)
-          falb2=falb_dir(:,2,:)
-       CASE(4)
-          albsol1=albsol_dir(:,1)
-          albsol2=albsol_dir(:,2)*SFRWL(2)+albsol_dir(:,3)*SFRWL(3) &
-               +albsol_dir(:,4)*SFRWL(4)
-          albsol2=albsol2/(SFRWL(2)+SFRWL(3)+SFRWL(4))
-          falb1=falb_dir(:,1,:)
-          falb2=falb_dir(:,2,:)*SFRWL(2)+falb_dir(:,3,:)*SFRWL(3) &
-               +falb_dir(:,4,:)*SFRWL(4)
-          falb2=falb2/(SFRWL(2)+SFRWL(3)+SFRWL(4))
-       CASE(6)
-          albsol1=albsol_dir(:,1)*SFRWL(1)+albsol_dir(:,2)*SFRWL(2) &
-               +albsol_dir(:,3)*SFRWL(3)
-          albsol1=albsol1/(SFRWL(1)+SFRWL(2)+SFRWL(3))
-          albsol2=albsol_dir(:,4)*SFRWL(4)+albsol_dir(:,5)*SFRWL(5) &
-               +albsol_dir(:,6)*SFRWL(6)
-          albsol2=albsol2/(SFRWL(4)+SFRWL(5)+SFRWL(6))
-          falb1=falb_dir(:,1,:)*SFRWL(1)+falb_dir(:,2,:)*SFRWL(2) &
-               +falb_dir(:,3,:)*SFRWL(3)
-          falb1=falb1/(SFRWL(1)+SFRWL(2)+SFRWL(3))
-          falb2=falb_dir(:,4,:)*SFRWL(4)+falb_dir(:,5,:)*SFRWL(5) &
-               +falb_dir(:,6,:)*SFRWL(6)
-          falb2=falb2/(SFRWL(4)+SFRWL(5)+SFRWL(6))
-       END SELECt
-       !albedo SB <<<
-
-
-       CALL evappot(klon,nbsrf,ftsol,pplay(:,1),cdragh, &
-            t_seri(:,1),q_seri(:,1),u_seri(:,1),v_seri(:,1),evap_pot)
+      !jyg+nrlmd<
+      !!jyg       IF (prt_level .ge. 2 .and. mod(iflag_pbl_split,2) .eq. 1) THEN
+      IF (prt_level >= 2 .and. mod(iflag_pbl_split, 10) >= 1) THEN
+        print *, 'debut du splitting de la PBL, wake_s = ', wake_s(:)
+        print *, 'debut du splitting de la PBL, wake_deltat = ', wake_deltat(:, 1)
+        print *, 'debut du splitting de la PBL, wake_deltaq = ', wake_deltaq(:, 1)
+      ENDIF
+      ! !!
+      !>jyg+nrlmd
+
+      !-------gustiness calculation-------!
+      !ym : Warning gustiness non inialized for iflag_gusts=2 & iflag_gusts=3
+      gustiness = 0  !ym missing init
+
+      IF (iflag_gusts==0) THEN
+        gustiness(1:klon) = 0
+      ELSE IF (iflag_gusts==1) THEN
+        gustiness(1:klon) = f_gust_bl * ale_bl(1:klon) + f_gust_wk * ale_wake(1:klon)
+      ELSE IF (iflag_gusts==2) THEN
+        gustiness(1:klon) = f_gust_bl * ale_bl_stat(1:klon) + f_gust_wk * ale_wake(1:klon)
+        !!!! modif olivier torres
+      ELSE IF (iflag_gusts==3) THEN
+        w_et = wstar(1, 3)
+        jlr_g_s = (0.65 * w_et)**2
+        pr_et = rain_con * 8640
+        jlr_g_c = (((19.8 * (pr_et(1:klon)**2)) / (1.5 + pr_et(1:klon) + pr_et(1:klon)**2))**(0.4))**2
+        gustiness(1:klon) = jlr_g_c + jlr_g_s
+        !!       write(*,*) "rain ",pr_et
+        !!       write(*,*) "jlr_g_c",jlr_g_c
+        !!       write(*,*) "wstar",wstar(1,3)
+        !!       write(*,*) "jlr_g_s",jlr_g_s
+        ! ELSE IF (iflag_gusts==2) THEN
+        !    do i = 1, klon
+        !       gustiness(i)=f_gust_bl*ale_bl(i)+sigma_wk(i)*f_gust_wk&
+        !           *ale_wake(i) !! need to make sigma_wk accessible here
+        !    enddo
+        ! ELSE IF (iflag_gusts==3) THEN
+        !    do i = 1, klon
+        !       gustiness(i)=f_gust_bl*alp_bl(i)+f_gust_wk*alp_wake(i)
+        !    enddo
+      ENDIF
+
+      CALL pbl_surface(&
+              phys_tstep, date0, itap, days_elapsed + 1, &
+              debut, lafin, &
+              longitude_deg, latitude_deg, rugoro, zrmu0, &
+              sollwdown, cldt, &
+              rain_fall, snow_fall, bs_fall, solsw, solswfdiff, sollw, &
+              gustiness, &
+              t_seri, q_seri, qbs_seri, u_seri, v_seri, &
+              !nrlmd+jyg<
+              wake_deltat, wake_deltaq, wake_cstar, wake_s, &
+              !>nrlmd+jyg
+              pplay, paprs, pctsrf, &
+              ftsol, SFRWL, falb_dir, falb_dif, ustar, u10m, v10m, wstar, &
+              !albedo SB <<<
+              cdragh, cdragm, u1, v1, &
+              beta_aridity, &
+              !albedo SB >>>
+              ! albsol1,   albsol2,   sens,    evap,      &
+              albsol_dir, albsol_dif, sens, evap, snowerosion, &
+              !albedo SB <<<
+              albsol3_lic, runoff, snowhgt, qsnow, to_ice, sissnow, &
+              zxtsol, zxfluxlat, zt2m, qsat2m, zn2mout, &
+              d_t_vdf, d_q_vdf, d_qbs_vdf, d_u_vdf, d_v_vdf, d_t_diss, &
+              !nrlmd<
+              !jyg<
+              d_t_vdf_w, d_q_vdf_w, &
+              d_t_vdf_x, d_q_vdf_x, &
+              sens_x, zxfluxlat_x, sens_w, zxfluxlat_w, &
+              !>jyg
+              delta_tsurf, wake_dens, &
+              cdragh_x, cdragh_w, cdragm_x, cdragm_w, &
+              kh, kh_x, kh_w, &
+              !>nrlmd
+              coefh(1:klon, 1:klev, 1:nbsrf + 1), coefm(1:klon, 1:klev, 1:nbsrf + 1), &
+              slab_wfbils, &
+              qsol, zq2m, s_pblh, s_lcl, &
+              !jyg<
+              s_pblh_x, s_lcl_x, s_pblh_w, s_lcl_w, &
+              !>jyg
+              s_capCL, s_oliqCL, s_cteiCL, s_pblT, &
+              s_therm, s_trmb1, s_trmb2, s_trmb3, &
+              zustar, zu10m, zv10m, fder, &
+              zxqsurf, delta_qsurf, rh2m, zxfluxu, zxfluxv, &
+              z0m, z0h, agesno, fsollw, fsolsw, &
+              d_ts, fevap, fluxlat, t2m, &
+              wfbils, wfevap, &
+              fluxt, fluxu, fluxv, &
+              dsens, devap, zxsnow, &
+              zxfluxt, zxfluxq, zxfluxqbs, q2m, fluxq, fluxqbs, pbl_tke, pbl_eps, &
+              !nrlmd+jyg<
+              wake_delta_pbl_TKE, &
+              !>nrlmd+jyg
+              treedrg)
+      !FC
+
+      !  Add turbulent diffusion tendency to the wake difference variables
+      !!jyg       IF (mod(iflag_pbl_split,2) .NE. 0) THEN
+      IF (mod(iflag_pbl_split, 10) /= 0) THEN
+        !jyg<
+        d_deltat_vdf(:, :) = d_t_vdf_w(:, :) - d_t_vdf_x(:, :)
+        d_deltaq_vdf(:, :) = d_q_vdf_w(:, :) - d_q_vdf_x(:, :)
+        CALL add_wake_tend &
+                (d_deltat_vdf, d_deltaq_vdf, dsig0, dsig0, ddens0, ddens0, wkoccur1, 'vdf', abortphy)
+      ELSE
+        d_deltat_vdf(:, :) = 0.
+        d_deltaq_vdf(:, :) = 0.
+        !>jyg
+      ENDIF
+
+      !---------------------------------------------------------------------
+      ! ajout des tendances de la diffusion turbulente
+      IF (klon_glo==1) THEN
+        CALL add_pbl_tend &
+                (d_u_vdf, d_v_vdf, d_t_vdf + d_t_diss, d_q_vdf, dql0, dqi0, d_qbs_vdf, paprs, &
+                'vdf', abortphy, flag_inhib_tend, itap)
+      ELSE
+        CALL add_phys_tend &
+                (d_u_vdf, d_v_vdf, d_t_vdf + d_t_diss, d_q_vdf, dql0, dqi0, d_qbs_vdf, paprs, &
+                'vdf', abortphy, flag_inhib_tend, itap, 0)
+      ENDIF
+      CALL prt_enerbil('vdf', itap)
+
+      !--------------------------------------------------------------------
+
+      IF (mydebug) THEN
+        CALL writefield_phy('u_seri', u_seri, nbp_lev)
+        CALL writefield_phy('v_seri', v_seri, nbp_lev)
+        CALL writefield_phy('t_seri', t_seri, nbp_lev)
+        CALL writefield_phy('q_seri', q_seri, nbp_lev)
+      ENDIF
+
+      !albedo SB >>>
+      albsol1 = 0.
+      albsol2 = 0.
+      falb1 = 0.
+      falb2 = 0.
+      SELECT CASE(nsw)
+      CASE(2)
+        albsol1 = albsol_dir(:, 1)
+        albsol2 = albsol_dir(:, 2)
+        falb1 = falb_dir(:, 1, :)
+        falb2 = falb_dir(:, 2, :)
+      CASE(4)
+        albsol1 = albsol_dir(:, 1)
+        albsol2 = albsol_dir(:, 2) * SFRWL(2) + albsol_dir(:, 3) * SFRWL(3) &
+                + albsol_dir(:, 4) * SFRWL(4)
+        albsol2 = albsol2 / (SFRWL(2) + SFRWL(3) + SFRWL(4))
+        falb1 = falb_dir(:, 1, :)
+        falb2 = falb_dir(:, 2, :) * SFRWL(2) + falb_dir(:, 3, :) * SFRWL(3) &
+                + falb_dir(:, 4, :) * SFRWL(4)
+        falb2 = falb2 / (SFRWL(2) + SFRWL(3) + SFRWL(4))
+      CASE(6)
+        albsol1 = albsol_dir(:, 1) * SFRWL(1) + albsol_dir(:, 2) * SFRWL(2) &
+                + albsol_dir(:, 3) * SFRWL(3)
+        albsol1 = albsol1 / (SFRWL(1) + SFRWL(2) + SFRWL(3))
+        albsol2 = albsol_dir(:, 4) * SFRWL(4) + albsol_dir(:, 5) * SFRWL(5) &
+                + albsol_dir(:, 6) * SFRWL(6)
+        albsol2 = albsol2 / (SFRWL(4) + SFRWL(5) + SFRWL(6))
+        falb1 = falb_dir(:, 1, :) * SFRWL(1) + falb_dir(:, 2, :) * SFRWL(2) &
+                + falb_dir(:, 3, :) * SFRWL(3)
+        falb1 = falb1 / (SFRWL(1) + SFRWL(2) + SFRWL(3))
+        falb2 = falb_dir(:, 4, :) * SFRWL(4) + falb_dir(:, 5, :) * SFRWL(5) &
+                + falb_dir(:, 6, :) * SFRWL(6)
+        falb2 = falb2 / (SFRWL(4) + SFRWL(5) + SFRWL(6))
+      END SELECt
+      !albedo SB <<<
+
+      CALL evappot(klon, nbsrf, ftsol, pplay(:, 1), cdragh, &
+              t_seri(:, 1), q_seri(:, 1), u_seri(:, 1), v_seri(:, 1), evap_pot)
 
     ENDIF
@@ -2990,17 +2957,17 @@
     ! Blowing snow sublimation and sedimentation
 
-    d_t_bsss(:,:)=0.
-    d_q_bsss(:,:)=0.
-    d_qbs_bsss(:,:)=0.
-    bsfl(:,:)=0.
-    bs_fall(:)=0.
+    d_t_bsss(:, :) = 0.
+    d_q_bsss(:, :) = 0.
+    d_qbs_bsss(:, :) = 0.
+    bsfl(:, :) = 0.
+    bs_fall(:) = 0.
     IF (ok_bs) THEN
 
-     CALL call_blowing_snow_sublim_sedim(klon,klev,phys_tstep,t_seri,q_seri,qbs_seri,pplay,paprs, &
-                                        d_t_bsss,d_q_bsss,d_qbs_bsss,bsfl,bs_fall)
-
-     CALL add_phys_tend &
-               (du0,dv0,d_t_bsss,d_q_bsss,dql0,dqi0,d_qbs_bsss,paprs,&
-               'bsss',abortphy,flag_inhib_tend,itap,0)
+      CALL call_blowing_snow_sublim_sedim(klon, klev, phys_tstep, t_seri, q_seri, qbs_seri, pplay, paprs, &
+              d_t_bsss, d_q_bsss, d_qbs_bsss, bsfl, bs_fall)
+
+      CALL add_phys_tend &
+              (du0, dv0, d_t_bsss, d_q_bsss, dql0, dqi0, d_qbs_bsss, paprs, &
+              'bsss', abortphy, flag_inhib_tend, itap, 0)
 
     ENDIF
@@ -3010,180 +2977,178 @@
 
     DO k = 1, klev
-       DO i = 1, klon
-          zx_t = t_seri(i,k)
-          IF (thermcep) THEN
-             zdelta = MAX(0.,SIGN(1.,rtt-zx_t))
-             zx_qs  = r2es * FOEEW(zx_t,zdelta)/pplay(i,k)
-             zx_qs  = MIN(0.5,zx_qs)
-             zcor   = 1./(1.-retv*zx_qs)
-             zx_qs  = zx_qs*zcor
+      DO i = 1, klon
+        zx_t = t_seri(i, k)
+        IF (thermcep) THEN
+          zdelta = MAX(0., SIGN(1., rtt - zx_t))
+          zx_qs = r2es * FOEEW(zx_t, zdelta) / pplay(i, k)
+          zx_qs = MIN(0.5, zx_qs)
+          zcor = 1. / (1. - retv * zx_qs)
+          zx_qs = zx_qs * zcor
+        ELSE
+          !!           IF (zx_t.LT.t_coup) THEN             !jyg
+          IF (zx_t<rtt) THEN                  !jyg
+            zx_qs = qsats(zx_t) / pplay(i, k)
           ELSE
-             !!           IF (zx_t.LT.t_coup) THEN             !jyg
-             IF (zx_t<rtt) THEN                  !jyg
-                zx_qs = qsats(zx_t)/pplay(i,k)
-             ELSE
-                zx_qs = qsatl(zx_t)/pplay(i,k)
-             ENDIF
+            zx_qs = qsatl(zx_t) / pplay(i, k)
           ENDIF
-          zqsat(i,k)=zx_qs
-       ENDDO
+        ENDIF
+        zqsat(i, k) = zx_qs
+      ENDDO
     ENDDO
 
     IF (prt_level>=1) THEN
-       write(lunout,*) 'L   qsat (g/kg) avant clouds_gno'
-       write(lunout,'(i4,f15.4)') (k,1000.*zqsat(igout,k),k=1,klev)
+      write(lunout, *) 'L   qsat (g/kg) avant clouds_gno'
+      write(lunout, '(i4,f15.4)') (k, 1000. * zqsat(igout, k), k = 1, klev)
     ENDIF
-    !
+
     ! Appeler la convection (au choix)
-    !
+
     DO k = 1, klev
-       DO i = 1, klon
-          conv_q(i,k) = d_q_dyn(i,k)  &
-               + d_q_vdf(i,k)/phys_tstep
-          conv_t(i,k) = d_t_dyn(i,k)  &
-               + d_t_vdf(i,k)/phys_tstep
-       ENDDO
+      DO i = 1, klon
+        conv_q(i, k) = d_q_dyn(i, k)  &
+                + d_q_vdf(i, k) / phys_tstep
+        conv_t(i, k) = d_t_dyn(i, k)  &
+                + d_t_vdf(i, k) / phys_tstep
+      ENDDO
     ENDDO
 
     ! Calcule de vitesse verticale a partir de flux de masse verticale
     DO k = 1, klev
-       DO i = 1, klon
-          omega(i,k) = RG*flxmass_w(i,k) / cell_area(i)
-       ENDDO
+      DO i = 1, klon
+        omega(i, k) = RG * flxmass_w(i, k) / cell_area(i)
+      ENDDO
     ENDDO
 
-    IF (prt_level>=1) write(lunout,*) 'omega(igout, :) = ', &
-         omega(igout, :)
-    !
+    IF (prt_level>=1) write(lunout, *) 'omega(igout, :) = ', &
+            omega(igout, :)
+
     ! Appel de la convection tous les "cvpas"
-    !
-!!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
-!!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
-!!                       itapcv, cvpas, itap-1, cvpas_0
-    IF (MOD(itapcv,cvpas)==0 .OR. MOD(itap-1,cvpas_0)==0) THEN
-
-    !
-    ! Mettre a zero des variables de sortie (pour securite)
-    !
-    pmflxr(:,:) = 0.
-    pmflxs(:,:) = 0.
-    wdtrainA(:,:) = 0.
-    wdtrainS(:,:) = 0.
-    wdtrainM(:,:) = 0.
-    upwd(:,:) = 0.
-    dnwd(:,:) = 0.
-    ep(:,:) = 0.
-    da(:,:)=0.
-    mp(:,:)=0.
-    wght_cvfd(:,:)=0.
-    phi(:,:,:)=0.
-    phi2(:,:,:)=0.
-    epmlmMm(:,:,:)=0.
-    eplaMm(:,:)=0.
-    d1a(:,:)=0.
-    dam(:,:)=0.
-    elij(:,:,:)=0.
-    ev(:,:)=0.
-    qtaa(:,:)=0.
-    clw(:,:)=0.
-    sij(:,:,:)=0.
-    !
-    IF (iflag_con==1) THEN
-       abort_message ='reactiver le call conlmd dans physiq.F'
-       CALL abort_physic (modname,abort_message,1)
-       !     CALL conlmd (phys_tstep, paprs, pplay, t_seri, q_seri, conv_q,
-       !    .             d_t_con, d_q_con,
-       !    .             rain_con, snow_con, ibas_con, itop_con)
-    ELSE IF (iflag_con==2) THEN
-       CALL conflx(phys_tstep, paprs, pplay, t_seri, q_seri, &
-            conv_t, conv_q, -evap, omega, &
-            d_t_con, d_q_con, rain_con, snow_con, &
-            pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
-            kcbot, kctop, kdtop, pmflxr, pmflxs)
-       d_u_con = 0.
-       d_v_con = 0.
-
-       WHERE (rain_con < 0.) rain_con = 0.
-       WHERE (snow_con < 0.) snow_con = 0.
-       DO i = 1, klon
-          ibas_con(i) = klev+1 - kcbot(i)
-          itop_con(i) = klev+1 - kctop(i)
-       ENDDO
-    ELSE IF (iflag_con>=3) THEN
-       ! nb of tracers for the KE convection:
-       ! MAF la partie traceurs est faite dans phytrac
-       ! on met ntra=1 pour limiter les appels mais on peut
-       ! supprimer les calculs / ftra.
-       ntra = 1
-
-       !=======================================================================
-       !ajout pour la parametrisation des poches froides: calcul de
-       !t_w et t_x: si pas de poches froides, t_w=t_x=t_seri
-       IF (iflag_wake>=1) THEN
-         DO k=1,klev
-            DO i=1,klon
-                t_w(i,k) = t_seri(i,k) + (1-wake_s(i))*wake_deltat(i,k)
-                q_w(i,k) = q_seri(i,k) + (1-wake_s(i))*wake_deltaq(i,k)
-                t_x(i,k) = t_seri(i,k) - wake_s(i)*wake_deltat(i,k)
-                q_x(i,k) = q_seri(i,k) - wake_s(i)*wake_deltaq(i,k)
+
+    !!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
+    !!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
+    !!                       itapcv, cvpas, itap-1, cvpas_0
+    IF (MOD(itapcv, cvpas)==0 .OR. MOD(itap - 1, cvpas_0)==0) THEN
+
+      ! Mettre a zero des variables de sortie (pour securite)
+
+      pmflxr(:, :) = 0.
+      pmflxs(:, :) = 0.
+      wdtrainA(:, :) = 0.
+      wdtrainS(:, :) = 0.
+      wdtrainM(:, :) = 0.
+      upwd(:, :) = 0.
+      dnwd(:, :) = 0.
+      ep(:, :) = 0.
+      da(:, :) = 0.
+      mp(:, :) = 0.
+      wght_cvfd(:, :) = 0.
+      phi(:, :, :) = 0.
+      phi2(:, :, :) = 0.
+      epmlmMm(:, :, :) = 0.
+      eplaMm(:, :) = 0.
+      d1a(:, :) = 0.
+      dam(:, :) = 0.
+      elij(:, :, :) = 0.
+      ev(:, :) = 0.
+      qtaa(:, :) = 0.
+      clw(:, :) = 0.
+      sij(:, :, :) = 0.
+
+      IF (iflag_con==1) THEN
+        abort_message = 'reactiver le call conlmd dans physiq.F'
+        CALL abort_physic (modname, abort_message, 1)
+        !     CALL conlmd (phys_tstep, paprs, pplay, t_seri, q_seri, conv_q,
+        !    .             d_t_con, d_q_con,
+        !    .             rain_con, snow_con, ibas_con, itop_con)
+      ELSE IF (iflag_con==2) THEN
+        CALL conflx(phys_tstep, paprs, pplay, t_seri, q_seri, &
+                conv_t, conv_q, -evap, omega, &
+                d_t_con, d_q_con, rain_con, snow_con, &
+                pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
+                kcbot, kctop, kdtop, pmflxr, pmflxs)
+        d_u_con = 0.
+        d_v_con = 0.
+
+        WHERE (rain_con < 0.) rain_con = 0.
+        WHERE (snow_con < 0.) snow_con = 0.
+        DO i = 1, klon
+          ibas_con(i) = klev + 1 - kcbot(i)
+          itop_con(i) = klev + 1 - kctop(i)
+        ENDDO
+      ELSE IF (iflag_con>=3) THEN
+        ! nb of tracers for the KE convection:
+        ! MAF la partie traceurs est faite dans phytrac
+        ! on met ntra=1 pour limiter les appels mais on peut
+        ! supprimer les calculs / ftra.
+        ntra = 1
+
+        !=======================================================================
+        !ajout pour la parametrisation des poches froides: calcul de
+        !t_w et t_x: si pas de poches froides, t_w=t_x=t_seri
+        IF (iflag_wake>=1) THEN
+          DO k = 1, klev
+            DO i = 1, klon
+              t_w(i, k) = t_seri(i, k) + (1 - wake_s(i)) * wake_deltat(i, k)
+              q_w(i, k) = q_seri(i, k) + (1 - wake_s(i)) * wake_deltaq(i, k)
+              t_x(i, k) = t_seri(i, k) - wake_s(i) * wake_deltat(i, k)
+              q_x(i, k) = q_seri(i, k) - wake_s(i) * wake_deltaq(i, k)
             ENDDO
-         ENDDO
-       ELSE
-                t_w(:,:) = t_seri(:,:)
-                q_w(:,:) = q_seri(:,:)
-                t_x(:,:) = t_seri(:,:)
-                q_x(:,:) = q_seri(:,:)
-       ENDIF
-       !
-       !jyg<
-       ! Perform dry adiabatic adjustment on wake profile
-       ! The corresponding tendencies are added to the convective tendencies
-       ! after the call to the convective scheme.
-       IF (iflag_wake>=1) then
+          ENDDO
+        ELSE
+          t_w(:, :) = t_seri(:, :)
+          q_w(:, :) = q_seri(:, :)
+          t_x(:, :) = t_seri(:, :)
+          q_x(:, :) = q_seri(:, :)
+        ENDIF
+
+        !jyg<
+        ! Perform dry adiabatic adjustment on wake profile
+        ! The corresponding tendencies are added to the convective tendencies
+        ! after the call to the convective scheme.
+        IF (iflag_wake>=1) then
           IF (iflag_adjwk >= 1) THEN
-             limbas(:) = 1
-             CALL ajsec(paprs, pplay, t_w, q_w, limbas, &
-                  d_t_adjwk, d_q_adjwk)
-             !
-             DO k=1,klev
-                DO i=1,klon
-                   IF (wake_s(i) > 1.e-3) THEN
-                      t_w(i,k) = t_w(i,k) + d_t_adjwk(i,k)
-                      q_w(i,k) = q_w(i,k) + d_q_adjwk(i,k)
-                      d_deltat_ajs_cv(i,k) = d_t_adjwk(i,k)
-                      d_deltaq_ajs_cv(i,k) = d_q_adjwk(i,k)
-                   ELSE
-                      d_deltat_ajs_cv(i,k) = 0.
-                      d_deltaq_ajs_cv(i,k) = 0.
-                   ENDIF
-                ENDDO
-             ENDDO
-             IF (iflag_adjwk == 2 .AND. OK_bug_ajs_cv) THEN
-               CALL add_wake_tend &
-                 (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, dsig0, ddens0, ddens0, wkoccur1, 'ajs_cv', abortphy) 
-             ENDIF  ! (iflag_adjwk == 2 .AND. OK_bug_ajs_cv)
+            limbas(:) = 1
+            CALL ajsec(paprs, pplay, t_w, q_w, limbas, &
+                    d_t_adjwk, d_q_adjwk)
+
+            DO k = 1, klev
+              DO i = 1, klon
+                IF (wake_s(i) > 1.e-3) THEN
+                  t_w(i, k) = t_w(i, k) + d_t_adjwk(i, k)
+                  q_w(i, k) = q_w(i, k) + d_q_adjwk(i, k)
+                  d_deltat_ajs_cv(i, k) = d_t_adjwk(i, k)
+                  d_deltaq_ajs_cv(i, k) = d_q_adjwk(i, k)
+                ELSE
+                  d_deltat_ajs_cv(i, k) = 0.
+                  d_deltaq_ajs_cv(i, k) = 0.
+                ENDIF
+              ENDDO
+            ENDDO
+            IF (iflag_adjwk == 2 .AND. OK_bug_ajs_cv) THEN
+              CALL add_wake_tend &
+                      (d_deltat_ajs_cv, d_deltaq_ajs_cv, dsig0, dsig0, ddens0, ddens0, wkoccur1, 'ajs_cv', abortphy)
+            ENDIF  ! (iflag_adjwk == 2 .AND. OK_bug_ajs_cv)
           ENDIF  ! (iflag_adjwk >= 1)
-       ENDIF ! (iflag_wake>=1)
-       !>jyg
-       !
-        
-!!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
-!!             (k, q_w(1,k), q_x(1,k),k=1,25)
-
-!jyg<
-       CALL alpale( debut, itap, phys_tstep, paprs, omega, t_seri,   &
-                    alp_offset, it_wape_prescr,  wape_prescr, fip_prescr, &
-                    ale_bl_prescr, alp_bl_prescr, &
-                    wake_pe, wake_fip,  &
-                    Ale_bl, Ale_bl_trig, Alp_bl, &
-                    Ale, Alp , Ale_wake, Alp_wake)
-!>jyg
-!
-       ! sb, oct02:
-       ! Schema de convection modularise et vectorise:
-       ! (driver commun aux versions 3 et 4)
-       !
-       IF (ok_cvl) THEN ! new driver for convectL
-          !
+        ENDIF ! (iflag_wake>=1)
+        !>jyg
+
+        !!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
+        !!             (k, q_w(1,k), q_x(1,k),k=1,25)
+
+        !jyg<
+        CALL alpale(debut, itap, phys_tstep, paprs, omega, t_seri, &
+                alp_offset, it_wape_prescr, wape_prescr, fip_prescr, &
+                ale_bl_prescr, alp_bl_prescr, &
+                wake_pe, wake_fip, &
+                Ale_bl, Ale_bl_trig, Alp_bl, &
+                Ale, Alp, Ale_wake, Alp_wake)
+        !>jyg
+
+        ! sb, oct02:
+        ! Schema de convection modularise et vectorise:
+        ! (driver commun aux versions 3 et 4)
+
+        IF (ok_cvl) THEN ! new driver for convectL
+
           !jyg<
           ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -3197,39 +3162,39 @@
           ! FH : nouveau calcul base sur un profil global sans quoi
           ! le modele etait sensible au decoupage de domaines
-          DO k = klev,1,-1
-             IF (-7*log(presnivs(k)/presnivs(1)) > 25.) k_upper_cv = k
+          DO k = klev, 1, -1
+            IF (-7 * log(presnivs(k) / presnivs(1)) > 25.) k_upper_cv = k
           ENDDO
           IF (prt_level >= 5) THEN
-             Print *, 'upmost level of deep convection loops: k_upper_cv = ', &
-                  k_upper_cv
+            Print *, 'upmost level of deep convection loops: k_upper_cv = ', &
+                    k_upper_cv
           ENDIF
-          !
+
           !>jyg
           IF (type_trac == 'repr') THEN
-             nbtr_tmp=ntra
+            nbtr_tmp = ntra
           ELSE
-             nbtr_tmp=nbtr
+            nbtr_tmp = nbtr
           ENDIF
           !jyg   iflag_con est dans clesphys
           !c          CALL concvl (iflag_con,iflag_clos,
           CALL concvl (iflag_clos, &
-               phys_tstep, paprs, pplay, k_upper_cv, t_x,q_x, &
-               t_w,q_w,wake_s, &
-               u_seri,v_seri,tr_seri,nbtr_tmp, &
-               ALE,ALP, &
-               sig1,w01, &
-               d_t_con,d_q_con,fqcomp,d_u_con,d_v_con,d_tr, &
-               rain_con, snow_con, ibas_con, itop_con, sigd, &
-               ema_cbmf,plcl,plfc,wbeff,convoccur,upwd,dnwd,dnwd0, &
-               Ma,mipsh,Vprecip,cape,cin,tvp,Tconv,iflagctrl, &
-               pbase,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr,qcondc,wd, &
-                                ! RomP >>>
-                                !!     .        pmflxr,pmflxs,da,phi,mp,
-                                !!     .        ftd,fqd,lalim_conv,wght_th)
-               pmflxr,pmflxs,da,phi,mp,phi2,d1a,dam,sij,qtaa,clw,elij, &
-               ftd,fqd,lalim_conv,wght_th, &
-               ev, ep,epmlmMm,eplaMm, &
-               wdtrainA, wdtrainS, wdtrainM,wght_cvfd,qtc_cv,sigt_cv,detrain_cv, &
-               tau_cld_cv,coefw_cld_cv,epmax_diag)
+                  phys_tstep, paprs, pplay, k_upper_cv, t_x, q_x, &
+                  t_w, q_w, wake_s, &
+                  u_seri, v_seri, tr_seri, nbtr_tmp, &
+                  ALE, ALP, &
+                  sig1, w01, &
+                  d_t_con, d_q_con, fqcomp, d_u_con, d_v_con, d_tr, &
+                  rain_con, snow_con, ibas_con, itop_con, sigd, &
+                  ema_cbmf, plcl, plfc, wbeff, convoccur, upwd, dnwd, dnwd0, &
+                  Ma, mipsh, Vprecip, cape, cin, tvp, Tconv, iflagctrl, &
+                  pbase, bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr, qcondc, wd, &
+                  ! RomP >>>
+                  !!     .        pmflxr,pmflxs,da,phi,mp,
+                  !!     .        ftd,fqd,lalim_conv,wght_th)
+                  pmflxr, pmflxs, da, phi, mp, phi2, d1a, dam, sij, qtaa, clw, elij, &
+                  ftd, fqd, lalim_conv, wght_th, &
+                  ev, ep, epmlmMm, eplaMm, &
+                  wdtrainA, wdtrainS, wdtrainM, wght_cvfd, qtc_cv, sigt_cv, detrain_cv, &
+                  tau_cld_cv, coefw_cld_cv, epmax_diag)
 
           ! RomP <<<
@@ -3240,668 +3205,656 @@
           !IM end
           !IM cf. FH
-          clwcon0=qcondc
-          pmfu(:,:)=upwd(:,:)+dnwd(:,:)
-          fm_cv(:,:)=upwd(:,:)+dnwd(:,:)+dnwd0(:,:)
-          !
+          clwcon0 = qcondc
+          pmfu(:, :) = upwd(:, :) + dnwd(:, :)
+          fm_cv(:, :) = upwd(:, :) + dnwd(:, :) + dnwd0(:, :)
+
           !jyg<
-          ! If convective tendencies are too large, then call convection 
+          ! If convective tendencies are too large, then call convection
           !  every time step
           cvpas = cvpas_0
-          DO k=1,k_upper_cv
-             DO i=1,klon
-               IF (d_t_con(i,k) > 6.721 .AND. d_t_con(i,k) < 6.722 .AND.&
-                   d_q_con(i,k) > -.0002171 .AND. d_q_con(i,k) < -.0002170) THEN
-                     dtcon_multistep_max = 3.
-                     dqcon_multistep_max = 0.02
-               ENDIF
-             ENDDO
+          DO k = 1, k_upper_cv
+            DO i = 1, klon
+              IF (d_t_con(i, k) > 6.721 .AND. d_t_con(i, k) < 6.722 .AND.&
+                      d_q_con(i, k) > -.0002171 .AND. d_q_con(i, k) < -.0002170) THEN
+                dtcon_multistep_max = 3.
+                dqcon_multistep_max = 0.02
+              ENDIF
+            ENDDO
           ENDDO
-!
-          DO k=1,k_upper_cv
-             DO i=1,klon
-!!               IF (abs(d_t_con(i,k)) > 0.24 .OR. &
-!!                   abs(d_q_con(i,k)) > 2.e-2) THEN
-               IF (abs(d_t_con(i,k)) > dtcon_multistep_max .OR. &
-                   abs(d_q_con(i,k)) > dqcon_multistep_max) THEN
-                 cvpas = 1
-!!                 print *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
-!!                                   i,k,d_t_con(i,k),d_q_con(i,k)
-               ENDIF
-             ENDDO
+
+          DO k = 1, k_upper_cv
+            DO i = 1, klon
+              !!               IF (abs(d_t_con(i,k)) > 0.24 .OR. &
+              !!                   abs(d_q_con(i,k)) > 2.e-2) THEN
+              IF (abs(d_t_con(i, k)) > dtcon_multistep_max .OR. &
+                      abs(d_q_con(i, k)) > dqcon_multistep_max) THEN
+                cvpas = 1
+                !!                 print *,'physiq1, i,k,d_t_con(i,k),d_q_con(i,k) ', &
+                !!                                   i,k,d_t_con(i,k),d_q_con(i,k)
+              ENDIF
+            ENDDO
           ENDDO
-!!!   Ligne a ne surtout pas remettre sans avoir murement reflechi (jyg)
-!!!          call bcast(cvpas)
-!!!   ------------------------------------------------------------
+          !!!   Ligne a ne surtout pas remettre sans avoir murement reflechi (jyg)
+          !!!          call bcast(cvpas)
+          !!!   ------------------------------------------------------------
           !>jyg
-          !
+
           DO i = 1, klon
-             IF (iflagctrl(i)<=1) itau_con(i)=itau_con(i)+cvpas
+            IF (iflagctrl(i)<=1) itau_con(i) = itau_con(i) + cvpas
           ENDDO
-          !
+
           !jyg<
           !    Add the tendency due to the dry adjustment of the wake profile
           IF (iflag_wake>=1) THEN
             IF (iflag_adjwk == 2) THEN
-              DO k=1,klev
-                 DO i=1,klon
-                    ftd(i,k) = ftd(i,k) + wake_s(i)*d_t_adjwk(i,k)/phys_tstep
-                    fqd(i,k) = fqd(i,k) + wake_s(i)*d_q_adjwk(i,k)/phys_tstep
-                    d_t_con(i,k) = d_t_con(i,k) + wake_s(i)*d_t_adjwk(i,k)
-                    d_q_con(i,k) = d_q_con(i,k) + wake_s(i)*d_q_adjwk(i,k)
-                 ENDDO
+              DO k = 1, klev
+                DO i = 1, klon
+                  ftd(i, k) = ftd(i, k) + wake_s(i) * d_t_adjwk(i, k) / phys_tstep
+                  fqd(i, k) = fqd(i, k) + wake_s(i) * d_q_adjwk(i, k) / phys_tstep
+                  d_t_con(i, k) = d_t_con(i, k) + wake_s(i) * d_t_adjwk(i, k)
+                  d_q_con(i, k) = d_q_con(i, k) + wake_s(i) * d_q_adjwk(i, k)
+                ENDDO
               ENDDO
             ENDIF  ! (iflag_adjwk = 2)
           ENDIF   ! (iflag_wake>=1)
           !>jyg
-          !
-       ELSE ! ok_cvl
+
+        ELSE ! ok_cvl
 
           ! MAF conema3 ne contient pas les traceurs
           CALL conema3 (phys_tstep, &
-               paprs,pplay,t_seri,q_seri, &
-               u_seri,v_seri,tr_seri,ntra, &
-               sig1,w01, &
-               d_t_con,d_q_con,d_u_con,d_v_con,d_tr, &
-               rain_con, snow_con, ibas_con, itop_con, &
-               upwd,dnwd,dnwd0,bas,top, &
-               Ma,cape,tvp,rflag, &
-               pbase &
-               ,bbase,dtvpdt1,dtvpdq1,dplcldt,dplcldr &
-               ,clwcon0)
-
-       ENDIF ! ok_cvl
-
-       !
-       ! Correction precip
-       rain_con = rain_con * cvl_corr
-       snow_con = snow_con * cvl_corr
-       !
-
-       IF (.NOT. ok_gust) THEN
+                  paprs, pplay, t_seri, q_seri, &
+                  u_seri, v_seri, tr_seri, ntra, &
+                  sig1, w01, &
+                  d_t_con, d_q_con, d_u_con, d_v_con, d_tr, &
+                  rain_con, snow_con, ibas_con, itop_con, &
+                  upwd, dnwd, dnwd0, bas, top, &
+                  Ma, cape, tvp, rflag, &
+                  pbase &
+                  , bbase, dtvpdt1, dtvpdq1, dplcldt, dplcldr &
+                  , clwcon0)
+
+        ENDIF ! ok_cvl
+
+        ! Correction precip
+        rain_con = rain_con * cvl_corr
+        snow_con = snow_con * cvl_corr
+
+        IF (.NOT. ok_gust) THEN
           do i = 1, klon
-             wd(i)=0.0
+            wd(i) = 0.0
           enddo
-       ENDIF
-
-       ! =================================================================== c
-       ! Calcul des proprietes des nuages convectifs
-       !
-
-       !   calcul des proprietes des nuages convectifs
-       clwcon0(:,:)=fact_cldcon*clwcon0(:,:)
-       IF (iflag_cld_cv == 0) THEN
+        ENDIF
+
+        ! =================================================================== c
+        ! Calcul des proprietes des nuages convectifs
+
+        !   calcul des proprietes des nuages convectifs
+        clwcon0(:, :) = fact_cldcon * clwcon0(:, :)
+        IF (iflag_cld_cv == 0) THEN
           CALL clouds_gno &
-               (klon,klev,q_seri,zqsat,clwcon0,ptconv,ratqsc,rnebcon0)
-       ELSE
+                  (klon, klev, q_seri, zqsat, clwcon0, ptconv, ratqsc, rnebcon0)
+        ELSE
           CALL clouds_bigauss &
-               (klon,klev,q_seri,zqsat,qtc_cv,sigt_cv,ptconv,ratqsc,rnebcon0)
-       ENDIF
-
-
-       ! =================================================================== c
-
-       DO i = 1, klon
-          itop_con(i) = min(max(itop_con(i),1),klev)
-          ibas_con(i) = min(max(ibas_con(i),1),itop_con(i))
-       ENDDO
-
-       DO i = 1, klon
+                  (klon, klev, q_seri, zqsat, qtc_cv, sigt_cv, ptconv, ratqsc, rnebcon0)
+        ENDIF
+
+
+        ! =================================================================== c
+
+        DO i = 1, klon
+          itop_con(i) = min(max(itop_con(i), 1), klev)
+          ibas_con(i) = min(max(ibas_con(i), 1), itop_con(i))
+        ENDDO
+
+        DO i = 1, klon
           ! C Risi modif: pour éviter pb de dépassement d'indice dans les cas
           ! où i n'est pas un point convectif et donc ibas_con(i)=0
           ! c'est un pb indépendant des isotopes
           if (ibas_con(i) > 0) then
-             ema_pcb(i)  = paprs(i,ibas_con(i))
+            ema_pcb(i) = paprs(i, ibas_con(i))
           else
-             ema_pcb(i)  = 0.0
+            ema_pcb(i) = 0.0
           endif
-       ENDDO
-       DO i = 1, klon
+        ENDDO
+        DO i = 1, klon
           ! L'idicage de itop_con peut cacher un pb potentiel
           ! FH sous la dictee de JYG, CR
-          ema_pct(i)  = paprs(i,itop_con(i)+1)
-
-          IF (itop_con(i)>klev-3) THEN
-             IF (prt_level >= 9) THEN
-                write(lunout,*)'La convection monte trop haut '
-                write(lunout,*)'itop_con(,',i,',)=',itop_con(i)
-             ENDIF
+          ema_pct(i) = paprs(i, itop_con(i) + 1)
+
+          IF (itop_con(i)>klev - 3) THEN
+            IF (prt_level >= 9) THEN
+              write(lunout, *)'La convection monte trop haut '
+              write(lunout, *)'itop_con(,', i, ',)=', itop_con(i)
+            ENDIF
           ENDIF
-       ENDDO
-    ELSE IF (iflag_con==0) THEN
-       write(lunout,*) 'On n appelle pas la convection'
-       clwcon0=0.
-       rnebcon0=0.
-       d_t_con=0.
-       d_q_con=0.
-       d_u_con=0.
-       d_v_con=0.
-       rain_con=0.
-       snow_con=0.
-       bas=1
-       top=1
-    ELSE
-       WRITE(lunout,*) "iflag_con non-prevu", iflag_con
-       CALL abort_physic("physiq", "", 1)
-    ENDIF
-
-    !--saving d_q_con * zmass for next timestep if convection is not called every timestep
-    IF (ok_conserv_d_q_con) THEN
-      d_q_con_zmasse(:,:) = d_q_con(:,:) * zmasse(:,:)
-    ENDIF
-
-    !     CALL homogene(paprs, q_seri, d_q_con, u_seri,v_seri,
-    !    .              d_u_con, d_v_con)
-
-!jyg    Reinitialize proba_notrig and itapcv when convection has been called
-    proba_notrig(:) = 1.
-    itapcv = 0
+        ENDDO
+      ELSE IF (iflag_con==0) THEN
+        write(lunout, *) 'On n appelle pas la convection'
+        clwcon0 = 0.
+        rnebcon0 = 0.
+        d_t_con = 0.
+        d_q_con = 0.
+        d_u_con = 0.
+        d_v_con = 0.
+        rain_con = 0.
+        snow_con = 0.
+        bas = 1
+        top = 1
+      ELSE
+        WRITE(lunout, *) "iflag_con non-prevu", iflag_con
+        CALL abort_physic("physiq", "", 1)
+      ENDIF
+
+      !--saving d_q_con * zmass for next timestep if convection is not called every timestep
+      IF (ok_conserv_d_q_con) THEN
+        d_q_con_zmasse(:, :) = d_q_con(:, :) * zmasse(:, :)
+      ENDIF
+
+      !     CALL homogene(paprs, q_seri, d_q_con, u_seri,v_seri,
+      !    .              d_u_con, d_v_con)
+
+      !jyg    Reinitialize proba_notrig and itapcv when convection has been called
+      proba_notrig(:) = 1.
+      itapcv = 0
     ENDIF !  (MOD(itapcv,cvpas).EQ.0 .OR. MOD(itapcv,cvpas_0).EQ.0)
-!
-    itapcv = itapcv+1
-    !
+
+    itapcv = itapcv + 1
+
     ! Compter les steps ou cvpas=1
     IF (cvpas == 1) THEN
-      Ncvpaseq1 = Ncvpaseq1+1
+      Ncvpaseq1 = Ncvpaseq1 + 1
     ENDIF
-    IF (mod(itap,1000) == 0) THEN
-      print *,' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
+    IF (mod(itap, 1000) == 0) THEN
+      print *, ' physiq, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
     ENDIF
 
-!!!jyg  Appel diagnostique a add_phys_tend pour tester la conservation de 
-!!!     l'energie dans les courants satures.
-!!    d_t_con_sat(:,:) = d_t_con(:,:) - ftd(:,:)*dtime
-!!    d_q_con_sat(:,:) = d_q_con(:,:) - fqd(:,:)*dtime
-!!    dql_sat(:,:) = (wdtrainA(:,:)+wdtrainM(:,:))*dtime/zmasse(:,:)
-!!    CALL add_phys_tend(d_u_con, d_v_con, d_t_con_sat, d_q_con_sat, dql_sat,   &
-!!                     dqi0, paprs, 'convection_sat', abortphy, flag_inhib_tend,&  
-!!                     itap, 1)
-!!    call prt_enerbil('convection_sat',itap)
-!!
-!!
+    !!!jyg  Appel diagnostique a add_phys_tend pour tester la conservation de
+    !!!     l'energie dans les courants satures.
+    !!    d_t_con_sat(:,:) = d_t_con(:,:) - ftd(:,:)*dtime
+    !!    d_q_con_sat(:,:) = d_q_con(:,:) - fqd(:,:)*dtime
+    !!    dql_sat(:,:) = (wdtrainA(:,:)+wdtrainM(:,:))*dtime/zmasse(:,:)
+    !!    CALL add_phys_tend(d_u_con, d_v_con, d_t_con_sat, d_q_con_sat, dql_sat,   &
+    !!                     dqi0, paprs, 'convection_sat', abortphy, flag_inhib_tend,&
+    !!                     itap, 1)
+    !!    call prt_enerbil('convection_sat',itap)
+    !!
+    !!
 
     !--recompute d_q_con with zmasse from new timestep
     IF (ok_conserv_d_q_con) THEN
-      d_q_con(:,:)=d_q_con_zmasse(:,:)/zmasse(:,:)
+      d_q_con(:, :) = d_q_con_zmasse(:, :) / zmasse(:, :)
     ENDIF
 
     CALL add_phys_tend(d_u_con, d_v_con, d_t_con, d_q_con, dql0, dqi0, dqbs0, paprs, &
-         'convection',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('convection',itap)
+            'convection', abortphy, flag_inhib_tend, itap, 0)
+    CALL prt_enerbil('convection', itap)
 
     !-------------------------------------------------------------------------
 
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
-    !
     !==========================================================================
-    !RR:Evolution de la poche froide: on ne fait pas de separation wake/env 
+    !RR:Evolution de la poche froide: on ne fait pas de separation wake/env
     !pour la couche limite diffuse pour l instant
-    !
-    !
+
+
     ! nrlmd le 22/03/2011---Si on met les poches hors des thermiques
     ! il faut rajouter cette tendance calcul\'ee hors des poches
     ! froides
-    !
+
     IF (iflag_wake>=1) THEN
-       !
-       !
-       ! Call wakes every "wkpas" step
-       !
-       IF (MOD(itapwk,wkpas)==0) THEN
-          !
-          DO k=1,klev
-             DO i=1,klon
-                dt_dwn(i,k)  = ftd(i,k) 
-                dq_dwn(i,k)  = fqd(i,k) 
-                M_dwn(i,k)   = dnwd0(i,k)
-                M_up(i,k)    = upwd(i,k)
-                dt_a(i,k)    = d_t_con(i,k)/phys_tstep - ftd(i,k) 
-                dq_a(i,k)    = d_q_con(i,k)/phys_tstep - fqd(i,k)
-             ENDDO
+
+
+      ! Call wakes every "wkpas" step
+
+      IF (MOD(itapwk, wkpas)==0) THEN
+
+        DO k = 1, klev
+          DO i = 1, klon
+            dt_dwn(i, k) = ftd(i, k)
+            dq_dwn(i, k) = fqd(i, k)
+            M_dwn(i, k) = dnwd0(i, k)
+            M_up(i, k) = upwd(i, k)
+            dt_a(i, k) = d_t_con(i, k) / phys_tstep - ftd(i, k)
+            dq_a(i, k) = d_q_con(i, k) / phys_tstep - fqd(i, k)
           ENDDO
-         
-          IF (iflag_wake==2) THEN
-             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
-             DO k = 1,klev
-                dt_dwn(:,k)= dt_dwn(:,k)+ &
-                     ok_wk_lsp(:)*(d_t_eva(:,k)+d_t_lsc(:,k))/phys_tstep
-                dq_dwn(:,k)= dq_dwn(:,k)+ &
-                     ok_wk_lsp(:)*(d_q_eva(:,k)+d_q_lsc(:,k))/phys_tstep
-             ENDDO
-          ELSEIF (iflag_wake==3) THEN
-             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
-             DO k = 1,klev
-                DO i=1,klon
-                   IF (rneb(i,k)==0.) THEN
-                      ! On ne tient compte des tendances qu'en dehors des
-                      ! nuages (c'est-\`a-dire a priri dans une region ou
-                      ! l'eau se reevapore).
-                      dt_dwn(i,k)= dt_dwn(i,k)+ &
-                           ok_wk_lsp(i)*d_t_lsc(i,k)/phys_tstep
-                      dq_dwn(i,k)= dq_dwn(i,k)+ &
-                           ok_wk_lsp(i)*d_q_lsc(i,k)/phys_tstep
-                   ENDIF
-                ENDDO
-             ENDDO
-          ENDIF
-         
-          !
-          !calcul caracteristiques de la poche froide
-          CALL calWAKE (iflag_wake_tend, paprs, pplay, phys_tstep, &
-               t_seri, q_seri, omega,  &
-               dt_dwn, dq_dwn, M_dwn, M_up,  &
-               dt_a, dq_a, cv_gen,  &
-               sigd, cin,  &
-               wake_deltat, wake_deltaq, wake_s, awake_s, wake_dens, awake_dens,  &
-               wake_dth, wake_h,  &
-!!               wake_pe, wake_fip, wake_gfl,  &
-               wake_pe, wake_fip_0, wake_gfl,  &   !! jyg
-               d_t_wake, d_q_wake,  &
-               wake_k, t_x, q_x,  &
-               wake_omgbdth, wake_dp_omgb,  &
-               wake_dtKE, wake_dqKE,  &
-               wake_omg, wake_dp_deltomg,  &
-               wake_spread, wake_Cstar, d_deltat_wk_gw,  &
-               d_deltat_wk, d_deltaq_wk, d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
-          !
-          !jyg    Reinitialize itapwk when wakes have been called
-          itapwk = 0
-       ENDIF !  (MOD(itapwk,wkpas).EQ.0)
-       !
-       itapwk = itapwk+1
-       !
-       !-----------------------------------------------------------------------
-       ! ajout des tendances des poches froides
-       CALL add_phys_tend(du0,dv0,d_t_wake,d_q_wake,dql0,dqi0,dqbs0,paprs,'wake', &
-            abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('wake',itap)
-       !------------------------------------------------------------------------
-
-       ! Increment Wake state variables
-       IF (iflag_wake_tend > 0.) THEN
-
-         CALL add_wake_tend &
-            (d_deltat_wk, d_deltaq_wk, d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk, wake_k, &
-             'wake', abortphy) 
-          CALL prt_enerbil('wake',itap)
-       ENDIF   ! (iflag_wake_tend .GT. 0.)
-       !
-       IF (prt_level >= 10) THEN
-         print *,' physiq, after calwake, wake_s: ',wake_s(:)
-         print *,' physiq, after calwake, wake_deltat: ',wake_deltat(:,1)
-         print *,' physiq, after calwake, wake_deltaq: ',wake_deltaq(:,1)
-       ENDIF
-
-       IF (iflag_alp_wk_cond > 0.) THEN
-
-         CALL alpale_wk(phys_tstep, cell_area, wake_k, wake_s, wake_dens, wake_fip_0, &
-                        wake_fip)
-       ELSE
-         wake_fip(:) = wake_fip_0(:)
-       ENDIF   ! (iflag_alp_wk_cond .GT. 0.)
+        ENDDO
+
+        IF (iflag_wake==2) THEN
+          ok_wk_lsp(:) = max(sign(1., wake_s(:) - wake_s_min_lsp), 0.)
+          DO k = 1, klev
+            dt_dwn(:, k) = dt_dwn(:, k) + &
+                    ok_wk_lsp(:) * (d_t_eva(:, k) + d_t_lsc(:, k)) / phys_tstep
+            dq_dwn(:, k) = dq_dwn(:, k) + &
+                    ok_wk_lsp(:) * (d_q_eva(:, k) + d_q_lsc(:, k)) / phys_tstep
+          ENDDO
+        ELSEIF (iflag_wake==3) THEN
+          ok_wk_lsp(:) = max(sign(1., wake_s(:) - wake_s_min_lsp), 0.)
+          DO k = 1, klev
+            DO i = 1, klon
+              IF (rneb(i, k)==0.) THEN
+                ! On ne tient compte des tendances qu'en dehors des
+                ! nuages (c'est-\`a-dire a priri dans une region ou
+                ! l'eau se reevapore).
+                dt_dwn(i, k) = dt_dwn(i, k) + &
+                        ok_wk_lsp(i) * d_t_lsc(i, k) / phys_tstep
+                dq_dwn(i, k) = dq_dwn(i, k) + &
+                        ok_wk_lsp(i) * d_q_lsc(i, k) / phys_tstep
+              ENDIF
+            ENDDO
+          ENDDO
+        ENDIF
+
+        !calcul caracteristiques de la poche froide
+        CALL calWAKE (iflag_wake_tend, paprs, pplay, phys_tstep, &
+                t_seri, q_seri, omega, &
+                dt_dwn, dq_dwn, M_dwn, M_up, &
+                dt_a, dq_a, cv_gen, &
+                sigd, cin, &
+                wake_deltat, wake_deltaq, wake_s, awake_s, wake_dens, awake_dens, &
+                wake_dth, wake_h, &
+                !!               wake_pe, wake_fip, wake_gfl,  &
+                wake_pe, wake_fip_0, wake_gfl, &   !! jyg
+                d_t_wake, d_q_wake, &
+                wake_k, t_x, q_x, &
+                wake_omgbdth, wake_dp_omgb, &
+                wake_dtKE, wake_dqKE, &
+                wake_omg, wake_dp_deltomg, &
+                wake_spread, wake_Cstar, d_deltat_wk_gw, &
+                d_deltat_wk, d_deltaq_wk, d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk)
+
+        !jyg    Reinitialize itapwk when wakes have been called
+        itapwk = 0
+      ENDIF !  (MOD(itapwk,wkpas).EQ.0)
+
+      itapwk = itapwk + 1
+
+      !-----------------------------------------------------------------------
+      ! ajout des tendances des poches froides
+      CALL add_phys_tend(du0, dv0, d_t_wake, d_q_wake, dql0, dqi0, dqbs0, paprs, 'wake', &
+              abortphy, flag_inhib_tend, itap, 0)
+      CALL prt_enerbil('wake', itap)
+      !------------------------------------------------------------------------
+
+      ! Increment Wake state variables
+      IF (iflag_wake_tend > 0.) THEN
+
+        CALL add_wake_tend &
+                (d_deltat_wk, d_deltaq_wk, d_s_wk, d_s_a_wk, d_dens_wk, d_dens_a_wk, wake_k, &
+                'wake', abortphy)
+        CALL prt_enerbil('wake', itap)
+      ENDIF   ! (iflag_wake_tend .GT. 0.)
+
+      IF (prt_level >= 10) THEN
+        print *, ' physiq, after calwake, wake_s: ', wake_s(:)
+        print *, ' physiq, after calwake, wake_deltat: ', wake_deltat(:, 1)
+        print *, ' physiq, after calwake, wake_deltaq: ', wake_deltaq(:, 1)
+      ENDIF
+
+      IF (iflag_alp_wk_cond > 0.) THEN
+
+        CALL alpale_wk(phys_tstep, cell_area, wake_k, wake_s, wake_dens, wake_fip_0, &
+                wake_fip)
+      ELSE
+        wake_fip(:) = wake_fip_0(:)
+      ENDIF   ! (iflag_alp_wk_cond .GT. 0.)
 
     ENDIF  ! (iflag_wake>=1)
-    !
+
     !===================================================================
     ! Convection seche (thermiques ou ajustement)
     !===================================================================
-    !
-    CALL stratocu_if(klon,klev,pctsrf,paprs, pplay,t_seri &
-         ,seuil_inversion,weak_inversion,dthmin)
-
-
-
-    d_t_ajsb(:,:)=0.
-    d_q_ajsb(:,:)=0.
-    d_t_ajs(:,:)=0.
-    d_u_ajs(:,:)=0.
-    d_v_ajs(:,:)=0.
-    d_q_ajs(:,:)=0.
-    clwcon0th(:,:)=0.
-    !
+
+    CALL stratocu_if(klon, klev, pctsrf, paprs, pplay, t_seri &
+            , seuil_inversion, weak_inversion, dthmin)
+
+    d_t_ajsb(:, :) = 0.
+    d_q_ajsb(:, :) = 0.
+    d_t_ajs(:, :) = 0.
+    d_u_ajs(:, :) = 0.
+    d_v_ajs(:, :) = 0.
+    d_q_ajs(:, :) = 0.
+    clwcon0th(:, :) = 0.
+
     !      fm_therm(:,:)=0.
     !      entr_therm(:,:)=0.
     !      detr_therm(:,:)=0.
-    !
-    IF (prt_level>9) WRITE(lunout,*) &
-         'AVANT LA CONVECTION SECHE , iflag_thermals=' &
-         ,iflag_thermals,'   nsplit_thermals=',nsplit_thermals
+
+    IF (prt_level>9) WRITE(lunout, *) &
+            'AVANT LA CONVECTION SECHE , iflag_thermals=' &
+            , iflag_thermals, '   nsplit_thermals=', nsplit_thermals
     IF (iflag_thermals<0) THEN
-       !  Rien
-       !  ====
-       IF (prt_level>9) WRITE(lunout,*)'pas de convection seche'
-       WRITE(lunout,*) 'WARNING : running without dry convection. Somme intermediate variables are not properly defined in physiq_mod.F90'
-       ! Reprendre proprement les initialisation ci dessouds si on veut vraiment utiliser l'option (FH)
-          fraca(:,:)=0.
-          fm_therm(:,:)=0.
-          ztv(:,:)=t_seri(:,:)
-          zqasc(:,:)=q_seri(:,:)
-          ztla(:,:)=0.
-          zthl(:,:)=0.
-          zpspsk(:,:)=(pplay(:,:)/100000.)**RKAPPA
-
-
+      !  Rien
+      !  ====
+      IF (prt_level>9) WRITE(lunout, *)'pas de convection seche'
+      WRITE(lunout, *) 'WARNING : running without dry convection. Somme intermediate variables are not properly defined in physiq_mod.F90'
+      ! Reprendre proprement les initialisation ci dessouds si on veut vraiment utiliser l'option (FH)
+      fraca(:, :) = 0.
+      fm_therm(:, :) = 0.
+      ztv(:, :) = t_seri(:, :)
+      zqasc(:, :) = q_seri(:, :)
+      ztla(:, :) = 0.
+      zthl(:, :) = 0.
+      zpspsk(:, :) = (pplay(:, :) / 100000.)**RKAPPA
 
     ELSE
 
-       !  Thermiques
-       !  ==========
-       IF (prt_level>9) WRITE(lunout,*)'JUSTE AVANT , iflag_thermals=' &
-            ,iflag_thermals,'   nsplit_thermals=',nsplit_thermals
-
-
-       !cc nrlmd le 10/04/2012
-       DO k=1,klev+1
-          DO i=1,klon
-             pbl_tke_input(i,k,is_oce)=pbl_tke(i,k,is_oce)
-             pbl_tke_input(i,k,is_ter)=pbl_tke(i,k,is_ter)
-             pbl_tke_input(i,k,is_lic)=pbl_tke(i,k,is_lic)
-             pbl_tke_input(i,k,is_sic)=pbl_tke(i,k,is_sic)
+      !  Thermiques
+      !  ==========
+      IF (prt_level>9) WRITE(lunout, *)'JUSTE AVANT , iflag_thermals=' &
+              , iflag_thermals, '   nsplit_thermals=', nsplit_thermals
+
+
+      !cc nrlmd le 10/04/2012
+      DO k = 1, klev + 1
+        DO i = 1, klon
+          pbl_tke_input(i, k, is_oce) = pbl_tke(i, k, is_oce)
+          pbl_tke_input(i, k, is_ter) = pbl_tke(i, k, is_ter)
+          pbl_tke_input(i, k, is_lic) = pbl_tke(i, k, is_lic)
+          pbl_tke_input(i, k, is_sic) = pbl_tke(i, k, is_sic)
+        ENDDO
+      ENDDO
+      !cc fin nrlmd le 10/04/2012
+
+      IF (iflag_thermals>=1) THEN
+
+        ! Tests Fredho, instensibilite au pas de temps -------------------------------
+        ! A detruire en 2024 une fois les tests documentes et les choix faits        !
+        if (iflag_thermals_tenv / 10 == 0) then                            !
+          do k = 1, klev                                                      !
+            do i = 1, klon                                                   !
+              t_env(i, k) = t_seri(i, k)                                     !
+              q_env(i, k) = q_seri(i, k)                                     !
+            enddo                                                         !
+          enddo                                                            !
+        else if (iflag_thermals_tenv / 10 == 2) then                      !
+          do k = 1, klev                                                      !
+            do i = 1, klon                                                   !
+              q_env(i, k) = q_seri(i, k)                                     !
+            enddo                                                         !
+          enddo                                                            !
+        else if (iflag_thermals_tenv / 10 == 3) then                      !
+          do k = 1, klev                                                      !
+            do i = 1, klon                                                   !
+              t_env(i, k) = t(i, k)                                          !
+              q_env(i, k) = qx(i, k, 1)                                       !
+            enddo                                                         !
+          enddo                                                            !
+        endif                                                              !
+        ! Tests Fredho, instensibilite au pas de temps ------------------------------
+
+        !jyg<
+        !!       IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
+        IF (mod(iflag_pbl_split / 10, 10) >= 1) THEN
+          !  Appel des thermiques avec les profils exterieurs aux poches
+          DO k = 1, klev
+            DO i = 1, klon
+              t_therm(i, k) = t_seri(i, k) - wake_s(i) * wake_deltat(i, k)
+              q_therm(i, k) = q_seri(i, k) - wake_s(i) * wake_deltaq(i, k)
+              t_env(i, k) = t_env(i, k) - wake_s(i) * wake_deltat(i, k)
+              q_env(i, k) = q_env(i, k) - wake_s(i) * wake_deltaq(i, k)
+              u_therm(i, k) = u_seri(i, k)
+              v_therm(i, k) = v_seri(i, k)
+            ENDDO
           ENDDO
-       ENDDO
-       !cc fin nrlmd le 10/04/2012
-
-       IF (iflag_thermals>=1) THEN
-
-! Tests Fredho, instensibilite au pas de temps -------------------------------
-! A detruire en 2024 une fois les tests documentes et les choix faits        !
-          if (iflag_thermals_tenv /10 == 0 ) then                            !
-            do k=1,klev                                                      !
-               do i=1,klon                                                   !
-                  t_env(i,k)=t_seri(i,k)                                     !
-                  q_env(i,k)=q_seri(i,k)                                     !
-               enddo                                                         !
-            enddo                                                            !
-          else if (iflag_thermals_tenv / 10 == 2 ) then                      !
-            do k=1,klev                                                      !
-               do i=1,klon                                                   !
-                  q_env(i,k)=q_seri(i,k)                                     !
-               enddo                                                         !
-            enddo                                                            !
-          else if (iflag_thermals_tenv / 10 == 3 ) then                      !
-            do k=1,klev                                                      !
-               do i=1,klon                                                   !
-                  t_env(i,k)=t(i,k)                                          !
-                  q_env(i,k)=qx(i,k,1)                                       !
-               enddo                                                         !
-            enddo                                                            !
-          endif                                                              !
-! Tests Fredho, instensibilite au pas de temps ------------------------------
-
-          !jyg<
-!!       IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
-          IF (mod(iflag_pbl_split/10,10) >= 1) THEN
-             !  Appel des thermiques avec les profils exterieurs aux poches
-             DO k=1,klev
-                DO i=1,klon
-                   t_therm(i,k) = t_seri(i,k) - wake_s(i)*wake_deltat(i,k)
-                   q_therm(i,k) = q_seri(i,k) - wake_s(i)*wake_deltaq(i,k)
-                   t_env(i,k)   = t_env(i,k) - wake_s(i)*wake_deltat(i,k)
-                   q_env(i,k)   = q_env(i,k) - wake_s(i)*wake_deltaq(i,k)
-                   u_therm(i,k) = u_seri(i,k)
-                   v_therm(i,k) = v_seri(i,k)
-                ENDDO
-             ENDDO
+        ELSE
+          !  Appel des thermiques avec les profils moyens
+          DO k = 1, klev
+            DO i = 1, klon
+              t_therm(i, k) = t_seri(i, k)
+              q_therm(i, k) = q_seri(i, k)
+              u_therm(i, k) = u_seri(i, k)
+              v_therm(i, k) = v_seri(i, k)
+            ENDDO
+          ENDDO
+        ENDIF
+        !>jyg
+        CALL calltherm(pdtphys &
+                , pplay, paprs, pphi, weak_inversion &
+                ! ,u_seri,v_seri,t_seri,q_seri,zqsat,debut & !jyg
+                , u_therm, v_therm, t_therm, q_therm, t_env, q_env, zqsat, debut &  !jyg
+                , d_u_ajs, d_v_ajs, d_t_ajs, d_q_ajs &
+                , fm_therm, entr_therm, detr_therm &
+                , zqasc, clwcon0th, lmax_th, ratqscth &
+                , ratqsdiff, zqsatth &
+                !on rajoute ale et alp, et les
+                !caracteristiques de la couche alim
+                , Ale_bl, Alp_bl, lalim_conv, wght_th, zmax0, f0, zw2, fraca &
+                , ztv, zpspsk, ztla, zthl &
+                !cc nrlmd le 10/04/2012
+                , pbl_tke_input, pctsrf, omega, cell_area &
+                , zlcl_th, fraca0, w0, w_conv, therm_tke_max0, env_tke_max0 &
+                , n2, s2, strig, zcong, ale_bl_stat &
+                , therm_tke_max, env_tke_max &
+                , alp_bl_det, alp_bl_fluct_m, alp_bl_fluct_tke &
+                , alp_bl_conv, alp_bl_stat &
+                !cc fin nrlmd le 10/04/2012
+                , zqla, ztva)
+
+        !jyg<
+        !!jyg          IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
+        IF (mod(iflag_pbl_split / 10, 10) >= 1) THEN
+          !  Si les thermiques ne sont presents que hors des
+          !  poches, la tendance moyenne associ\'ee doit etre
+          !  multipliee par la fraction surfacique qu'ils couvrent.
+          DO k = 1, klev
+            DO i = 1, klon
+
+              d_deltat_the(i, k) = - d_t_ajs(i, k)
+              d_deltaq_the(i, k) = - d_q_ajs(i, k)
+
+              d_u_ajs(i, k) = d_u_ajs(i, k) * (1. - wake_s(i))
+              d_v_ajs(i, k) = d_v_ajs(i, k) * (1. - wake_s(i))
+              d_t_ajs(i, k) = d_t_ajs(i, k) * (1. - wake_s(i))
+              d_q_ajs(i, k) = d_q_ajs(i, k) * (1. - wake_s(i))
+
+            ENDDO
+          ENDDO
+
+          IF (ok_bug_split_th) THEN
+            CALL add_wake_tend &
+                    (d_deltat_the, d_deltaq_the, dsig0, dsig0, ddens0, ddens0, wkoccur1, 'the', abortphy)
           ELSE
-             !  Appel des thermiques avec les profils moyens
-             DO k=1,klev
-                DO i=1,klon
-                   t_therm(i,k) = t_seri(i,k)
-                   q_therm(i,k) = q_seri(i,k)
-                   u_therm(i,k) = u_seri(i,k)
-                   v_therm(i,k) = v_seri(i,k)
-                ENDDO
-             ENDDO
+            CALL add_wake_tend &
+                    (d_deltat_the, d_deltaq_the, dsig0, dsig0, ddens0, ddens0, wake_k, 'the', abortphy)
           ENDIF
-          !>jyg
-          CALL calltherm(pdtphys &
-               ,pplay,paprs,pphi,weak_inversion &
-                        ! ,u_seri,v_seri,t_seri,q_seri,zqsat,debut & !jyg
-               ,u_therm,v_therm,t_therm,q_therm,t_env,q_env,zqsat,debut &  !jyg
-               ,d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs &
-               ,fm_therm,entr_therm,detr_therm &
-               ,zqasc,clwcon0th,lmax_th,ratqscth &
-               ,ratqsdiff,zqsatth &
-                                !on rajoute ale et alp, et les
-                                !caracteristiques de la couche alim
-               ,Ale_bl,Alp_bl,lalim_conv,wght_th, zmax0, f0, zw2,fraca &
-               ,ztv,zpspsk,ztla,zthl &
-                                !cc nrlmd le 10/04/2012
-               ,pbl_tke_input,pctsrf,omega,cell_area &
-               ,zlcl_th,fraca0,w0,w_conv,therm_tke_max0,env_tke_max0 &
-               ,n2,s2,strig,zcong,ale_bl_stat &
-               ,therm_tke_max,env_tke_max &
-               ,alp_bl_det,alp_bl_fluct_m,alp_bl_fluct_tke &
-               ,alp_bl_conv,alp_bl_stat &
-                                !cc fin nrlmd le 10/04/2012
-               ,zqla,ztva )
-          !
-          !jyg<
-!!jyg          IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
-          IF (mod(iflag_pbl_split/10,10) >= 1) THEN
-             !  Si les thermiques ne sont presents que hors des
-             !  poches, la tendance moyenne associ\'ee doit etre
-             !  multipliee par la fraction surfacique qu'ils couvrent.
-             DO k=1,klev
-                DO i=1,klon
-                   !
-                   d_deltat_the(i,k) = - d_t_ajs(i,k) 
-                   d_deltaq_the(i,k) = - d_q_ajs(i,k) 
-                   !
-                   d_u_ajs(i,k) = d_u_ajs(i,k)*(1.-wake_s(i)) 
-                   d_v_ajs(i,k) = d_v_ajs(i,k)*(1.-wake_s(i)) 
-                   d_t_ajs(i,k) = d_t_ajs(i,k)*(1.-wake_s(i)) 
-                   d_q_ajs(i,k) = d_q_ajs(i,k)*(1.-wake_s(i)) 
-                   !
-                ENDDO
-             ENDDO
-          !
-             IF (ok_bug_split_th) THEN
-               CALL add_wake_tend &
-                   (d_deltat_the, d_deltaq_the, dsig0, dsig0, ddens0, ddens0, wkoccur1, 'the', abortphy) 
-             ELSE
-               CALL add_wake_tend &
-                   (d_deltat_the, d_deltaq_the, dsig0, dsig0, ddens0, ddens0, wake_k, 'the', abortphy) 
-             ENDIF
-             CALL prt_enerbil('the',itap)
-          !
-          ENDIF  ! (mod(iflag_pbl_split/10,10) .GE. 1)
-          !
-          CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,  &
-                             dql0,dqi0,dqbs0,paprs,'thermals', abortphy,flag_inhib_tend,itap,0)
-          CALL prt_enerbil('thermals',itap)
-          !
-!
-          CALL alpale_th( phys_tstep, lmax_th, t_seri, cell_area,  &
-                          cin, s2, n2, strig, &
-                          ale_bl_trig, ale_bl_stat, ale_bl,  &
-                          alp_bl, alp_bl_stat, &
-                          proba_notrig, random_notrig, cv_gen)
-          !>jyg
-
-          ! ------------------------------------------------------------------
-          ! Transport de la TKE par les panaches thermiques.
-          ! FH : 2010/02/01
-               if (iflag_thermcell_tke==1) then
-               call thermcell_dtke(klon,klev,nbsrf,pdtphys,fm_therm,entr_therm,rg,paprs,pbl_tke)
-               endif
-          ! -------------------------------------------------------------------
-
-          DO i=1,klon
-             !           zmax_th(i)=pphi(i,lmax_th(i))/rg
-             !CR:04/05/12:correction calcul zmax
-             zmax_th(i)=zmax0(i) 
-          ENDDO
-
-       ENDIF
-
-       !  Ajustement sec
-       !  ==============
-
-       ! Dans le cas o\`u on active les thermiques, on fait partir l'ajustement
-       ! a partir du sommet des thermiques.
-       ! Dans le cas contraire, on demarre au niveau 1.
-
-       IF (iflag_thermals>=13.or.iflag_thermals<=0) THEN
-
-          IF (iflag_thermals==0) THEN
-             IF (prt_level>9) WRITE(lunout,*)'ajsec'
-             limbas(:)=1
-          ELSE
-             limbas(:)=lmax_th(:)
-          ENDIF
-
-          ! Attention : le call ajsec_convV2 n'est maintenu que momentanneement
-          ! pour des test de convergence numerique.
-          ! Le nouveau ajsec est a priori mieux, meme pour le cas 
-          ! iflag_thermals = 0 (l'ancienne version peut faire des tendances
-          ! non nulles numeriquement pour des mailles non concernees.
-
-          IF (iflag_thermals==0) THEN
-             ! Calling adjustment alone (but not the thermal plume model)
-             CALL ajsec_convV2(paprs, pplay, t_seri,q_seri &
+          CALL prt_enerbil('the', itap)
+
+        ENDIF  ! (mod(iflag_pbl_split/10,10) .GE. 1)
+
+        CALL add_phys_tend(d_u_ajs, d_v_ajs, d_t_ajs, d_q_ajs, &
+                dql0, dqi0, dqbs0, paprs, 'thermals', abortphy, flag_inhib_tend, itap, 0)
+        CALL prt_enerbil('thermals', itap)
+
+
+        CALL alpale_th(phys_tstep, lmax_th, t_seri, cell_area, &
+                cin, s2, n2, strig, &
+                ale_bl_trig, ale_bl_stat, ale_bl, &
+                alp_bl, alp_bl_stat, &
+                proba_notrig, random_notrig, cv_gen)
+        !>jyg
+
+        ! ------------------------------------------------------------------
+        ! Transport de la TKE par les panaches thermiques.
+        ! FH : 2010/02/01
+        if (iflag_thermcell_tke==1) then
+          call thermcell_dtke(klon, klev, nbsrf, pdtphys, fm_therm, entr_therm, rg, paprs, pbl_tke)
+        endif
+        ! -------------------------------------------------------------------
+
+        DO i = 1, klon
+          !           zmax_th(i)=pphi(i,lmax_th(i))/rg
+          !CR:04/05/12:correction calcul zmax
+          zmax_th(i) = zmax0(i)
+        ENDDO
+
+      ENDIF
+
+      !  Ajustement sec
+      !  ==============
+
+      ! Dans le cas o\`u on active les thermiques, on fait partir l'ajustement
+      ! a partir du sommet des thermiques.
+      ! Dans le cas contraire, on demarre au niveau 1.
+
+      IF (iflag_thermals>=13.or.iflag_thermals<=0) THEN
+
+        IF (iflag_thermals==0) THEN
+          IF (prt_level>9) WRITE(lunout, *)'ajsec'
+          limbas(:) = 1
+        ELSE
+          limbas(:) = lmax_th(:)
+        ENDIF
+
+        ! Attention : le call ajsec_convV2 n'est maintenu que momentanneement
+        ! pour des test de convergence numerique.
+        ! Le nouveau ajsec est a priori mieux, meme pour le cas
+        ! iflag_thermals = 0 (l'ancienne version peut faire des tendances
+        ! non nulles numeriquement pour des mailles non concernees.
+
+        IF (iflag_thermals==0) THEN
+          ! Calling adjustment alone (but not the thermal plume model)
+          CALL ajsec_convV2(paprs, pplay, t_seri, q_seri &
                   , d_t_ajsb, d_q_ajsb)
-          ELSE IF (iflag_thermals>0) THEN
-             ! Calling adjustment above the top of thermal plumes
-             CALL ajsec(paprs, pplay, t_seri,q_seri,limbas &
+        ELSE IF (iflag_thermals>0) THEN
+          ! Calling adjustment above the top of thermal plumes
+          CALL ajsec(paprs, pplay, t_seri, q_seri, limbas &
                   , d_t_ajsb, d_q_ajsb)
-          ENDIF
-
-          !--------------------------------------------------------------------
-          ! ajout des tendances de l'ajustement sec ou des thermiques
-          CALL add_phys_tend(du0,dv0,d_t_ajsb,d_q_ajsb,dql0,dqi0,dqbs0,paprs, &
-               'ajsb',abortphy,flag_inhib_tend,itap,0)
-          CALL prt_enerbil('ajsb',itap)
-          d_t_ajs(:,:)=d_t_ajs(:,:)+d_t_ajsb(:,:)
-          d_q_ajs(:,:)=d_q_ajs(:,:)+d_q_ajsb(:,:)
-
-          !---------------------------------------------------------------------
-
-       ENDIF
+        ENDIF
+
+        !--------------------------------------------------------------------
+        ! ajout des tendances de l'ajustement sec ou des thermiques
+        CALL add_phys_tend(du0, dv0, d_t_ajsb, d_q_ajsb, dql0, dqi0, dqbs0, paprs, &
+                'ajsb', abortphy, flag_inhib_tend, itap, 0)
+        CALL prt_enerbil('ajsb', itap)
+        d_t_ajs(:, :) = d_t_ajs(:, :) + d_t_ajsb(:, :)
+        d_q_ajs(:, :) = d_q_ajs(:, :) + d_q_ajsb(:, :)
+
+        !---------------------------------------------------------------------
+
+      ENDIF
 
     ENDIF
-    !
+
     !===================================================================
-    ! Computation of ratqs, the width (normalized) of the subrid scale 
+    ! Computation of ratqs, the width (normalized) of the subrid scale
     ! water distribution
 
-    l_mix_ave(:,:)=0.
-    wprime_ave(:,:)=0.
+    l_mix_ave(:, :) = 0.
+    wprime_ave(:, :) = 0.
 
     DO nsrf = 1, nbsrf
-       DO i = 1, klon
-          l_mix_ave(i,:) = l_mix_ave(i,:) + l_mix(i,:,nsrf)*pctsrf(i,nsrf)
-          wprime_ave(i,:) = wprime_ave(i,:) + wprime(i,:,nsrf)*pctsrf(i,nsrf)
-       ENDDO
+      DO i = 1, klon
+        l_mix_ave(i, :) = l_mix_ave(i, :) + l_mix(i, :, nsrf) * pctsrf(i, nsrf)
+        wprime_ave(i, :) = wprime_ave(i, :) + wprime(i, :, nsrf) * pctsrf(i, nsrf)
+      ENDDO
     ENDDO
 
-    CALL ratqs_main(klon,klev,nbsrf,prt_level,lunout,        &
-         iflag_ratqs,iflag_con,iflag_cld_th,pdtphys,  &
-         ratqsbas,ratqshaut,ratqsp0, ratqsdp, &
-         pctsrf,s_pblh,zstd, &
-         tau_ratqs,fact_cldcon,wake_s, wake_deltaq,   &
-         ptconv,ptconvth,clwcon0th, rnebcon0th,     &
-         paprs,pplay,t_seri,q_seri, &
-         qtc_cv, sigt_cv,detrain_cv,fm_cv,fqd,fqcomp,sigd,zqsat, &
-         omega,pbl_tke(:,:,is_ave),pbl_eps(:,:,is_ave),l_mix_ave,wprime_ave, &
-         t2m,q2m,fm_therm,entr_therm,detr_therm,cell_area, &
-         ratqs,ratqsc,ratqs_inter_)
-
-    !
+    CALL ratqs_main(klon, klev, nbsrf, prt_level, lunout, &
+            iflag_ratqs, iflag_con, iflag_cld_th, pdtphys, &
+            ratqsbas, ratqshaut, ratqsp0, ratqsdp, &
+            pctsrf, s_pblh, zstd, &
+            tau_ratqs, fact_cldcon, wake_s, wake_deltaq, &
+            ptconv, ptconvth, clwcon0th, rnebcon0th, &
+            paprs, pplay, t_seri, q_seri, &
+            qtc_cv, sigt_cv, detrain_cv, fm_cv, fqd, fqcomp, sigd, zqsat, &
+            omega, pbl_tke(:, :, is_ave), pbl_eps(:, :, is_ave), l_mix_ave, wprime_ave, &
+            t2m, q2m, fm_therm, entr_therm, detr_therm, cell_area, &
+            ratqs, ratqsc, ratqs_inter_)
+
     ! Appeler le processus de condensation a grande echelle
     ! et le processus de precipitation
     !-------------------------------------------------------------------------
     IF (prt_level >=10) THEN
-       print *,'itap, ->fisrtilp ',itap
+      print *, 'itap, ->fisrtilp ', itap
     ENDIF
-    !
-
-    picefra(:,:)=0.
+
+    picefra(:, :) = 0.
 
     IF (ok_new_lscp) THEN
 
-    !--mise à jour de flight_m et flight_h2o dans leur module
-    IF (ok_plane_h2o .OR. ok_plane_contrail) THEN
-      CALL airplane(debut,pphis,pplay,paprs,t_seri)
+      !--mise à jour de flight_m et flight_h2o dans leur module
+      IF (ok_plane_h2o .OR. ok_plane_contrail) THEN
+        CALL airplane(debut, pphis, pplay, paprs, t_seri)
+      ENDIF
+
+      CALL lscp(klon, klev, phys_tstep, missing_val, paprs, pplay, &
+              t_seri, q_seri, qs_ancien, ptconv, ratqs, &
+              d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, rneb_seri, &
+              pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb, &
+              radocond, picefra, rain_lsc, snow_lsc, &
+              frac_impa, frac_nucl, beta_prec_fisrt, &
+              prfl, psfl, rhcl, &
+              zqasc, fraca, ztv, zpspsk, ztla, zthl, iflag_cld_th, &
+              iflag_ice_thermo, ok_ice_sursat, zqsatl, zqsats, distcltop, temp_cltop, &
+              pbl_tke(:, :, is_ave), pbl_eps(:, :, is_ave), qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
+              Tcontr, qcontr, qcontr2, fcontrN, fcontrP, &
+              cloudth_sth, cloudth_senv, cloudth_sigmath, cloudth_sigmaenv, &
+              qraindiag, qsnowdiag, dqreva, dqssub, dqrauto, dqrcol, dqrmelt, &
+              dqrfreez, dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
+
+    ELSE
+
+      CALL fisrtilp(klon, klev, phys_tstep, paprs, pplay, &
+              t_seri, q_seri, ptconv, ratqs, &
+              d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, radocond, &
+              rain_lsc, snow_lsc, &
+              pfrac_impa, pfrac_nucl, pfrac_1nucl, &
+              frac_impa, frac_nucl, beta_prec_fisrt, &
+              prfl, psfl, rhcl, &
+              zqasc, fraca, ztv, zpspsk, ztla, zthl, iflag_cld_th, &
+              iflag_ice_thermo, &
+              cloudth_sth, cloudth_senv, cloudth_sigmath, cloudth_sigmaenv)
+
     ENDIF
 
-    CALL lscp(klon,klev,phys_tstep,missing_val,paprs,pplay, &
-         t_seri, q_seri,qs_ancien,ptconv,ratqs, &
-         d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, rneb_seri, & 
-         pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb,  &
-         radocond, picefra, rain_lsc, snow_lsc, &
-         frac_impa, frac_nucl, beta_prec_fisrt, &
-         prfl, psfl, rhcl,  &
-         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, &
-         iflag_ice_thermo, ok_ice_sursat, zqsatl, zqsats, distcltop, temp_cltop,  &
-         pbl_tke(:,:,is_ave), pbl_eps(:,:,is_ave), qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
-         Tcontr, qcontr, qcontr2, fcontrN, fcontrP , &
-         cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv, &
-         qraindiag, qsnowdiag, dqreva, dqssub, dqrauto, dqrcol, dqrmelt, &
-         dqrfreez, dqsauto, dqsagg, dqsrim, dqsmelt, dqsfreez)
-
-
-    ELSE
-
-    CALL fisrtilp(klon,klev,phys_tstep,paprs,pplay, &
-         t_seri, q_seri,ptconv,ratqs, &
-         d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, rneblsvol, radocond, &
-         rain_lsc, snow_lsc, &
-         pfrac_impa, pfrac_nucl, pfrac_1nucl, &
-         frac_impa, frac_nucl, beta_prec_fisrt, &
-         prfl, psfl, rhcl,  &
-         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, &
-         iflag_ice_thermo, &
-         cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv)
-
-    ENDIF
-    !
     WHERE (rain_lsc < 0) rain_lsc = 0.
     WHERE (snow_lsc < 0) snow_lsc = 0.
 
-!+JLD
-!    write(*,9000) 'phys lsc',"enerbil: bil_q, bil_e,",rain_lsc+snow_lsc &
-!        & ,((rcw-rcpd)*rain_lsc + (rcs-rcpd)*snow_lsc)*t_seri(1,1)-rlvtt*rain_lsc+rlstt*snow_lsc &
-!        & ,rain_lsc,snow_lsc
-!    write(*,9000) "rcpv","rcw",rcpv,rcw,rcs,t_seri(1,1)
-!-JLD 
-    CALL add_phys_tend(du0,dv0,d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc,dqbs0,paprs, &
-         'lsc',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('lsc',itap)
-    rain_num(:)=0.
+    !+JLD
+    !    write(*,9000) 'phys lsc',"enerbil: bil_q, bil_e,",rain_lsc+snow_lsc &
+    !        & ,((rcw-rcpd)*rain_lsc + (rcs-rcpd)*snow_lsc)*t_seri(1,1)-rlvtt*rain_lsc+rlstt*snow_lsc &
+    !        & ,rain_lsc,snow_lsc
+    !    write(*,9000) "rcpv","rcw",rcpv,rcw,rcs,t_seri(1,1)
+    !-JLD
+    CALL add_phys_tend(du0, dv0, d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, dqbs0, paprs, &
+            'lsc', abortphy, flag_inhib_tend, itap, 0)
+    CALL prt_enerbil('lsc', itap)
+    rain_num(:) = 0.
     DO k = 1, klev
-       DO i = 1, klon
-          IF (ql_seri(i,k)>oliqmax) THEN
-             rain_num(i)=rain_num(i)+(ql_seri(i,k)-oliqmax)*zmasse(i,k)/pdtphys
-             ql_seri(i,k)=oliqmax
-          ENDIF
-       ENDDO
+      DO i = 1, klon
+        IF (ql_seri(i, k)>oliqmax) THEN
+          rain_num(i) = rain_num(i) + (ql_seri(i, k) - oliqmax) * zmasse(i, k) / pdtphys
+          ql_seri(i, k) = oliqmax
+        ENDIF
+      ENDDO
     ENDDO
     IF (nqo >= 3) THEN
+      DO k = 1, klev
+        DO i = 1, klon
+          IF (qs_seri(i, k)>oicemax) THEN
+            rain_num(i) = rain_num(i) + (qs_seri(i, k) - oicemax) * zmasse(i, k) / pdtphys
+            qs_seri(i, k) = oicemax
+          ENDIF
+        ENDDO
+      ENDDO
+    ENDIF
+
+
+    !---------------------------------------------------------------------------
     DO k = 1, klev
-       DO i = 1, klon
-          IF (qs_seri(i,k)>oicemax) THEN
-             rain_num(i)=rain_num(i)+(qs_seri(i,k)-oicemax)*zmasse(i,k)/pdtphys
-             qs_seri(i,k)=oicemax
-          ENDIF
-       ENDDO
-    ENDDO
-    ENDIF
-
-
-!---------------------------------------------------------------------------
-    DO k = 1, klev
-       DO i = 1, klon
-          cldfra(i,k) = rneb(i,k)
-          !CR: a quoi ca sert? Faut-il ajouter qs_seri?
-          !EV: en effet etrange, j'ajouterais aussi qs_seri
-          !    plus largement, je nettoierais (enleverrais) ces lignes
-          IF (.NOT.new_oliq) radocond(i,k) = ql_seri(i,k)
-       ENDDO
+      DO i = 1, klon
+        cldfra(i, k) = rneb(i, k)
+        !CR: a quoi ca sert? Faut-il ajouter qs_seri?
+        !EV: en effet etrange, j'ajouterais aussi qs_seri
+        !    plus largement, je nettoierais (enleverrais) ces lignes
+        IF (.NOT.new_oliq) radocond(i, k) = ql_seri(i, k)
+      ENDDO
     ENDDO
 
@@ -3912,30 +3865,29 @@
 
     IF (ok_bs .AND. ok_rad_bs) THEN
-       IF (ok_new_lscp .AND. ok_icefra_lscp) THEN
-           DO k=1,klev
-             DO i=1,klon
-                radocond(i,k)=radocond(i,k)+qbs_seri(i,k)
-                picefra(i,k)=(radocond(i,k)*picefra(i,k)+qbs_seri(i,k))/(radocond(i,k))
-                qbsfra=min(qbs_seri(i,k)/qbst_bs,1.0) 
-                cldfra(i,k)=max(cldfra(i,k),qbsfra)
-             ENDDO
-           ENDDO
-       ELSE
-          WRITE(lunout,*)"PAY ATTENTION, you try to activate the radiative effect of blowing snow"
-          WRITE(lunout,*)"with ok_new_lscp=false and/or ok_icefra_lscp=false"
-          abort_message='inconsistency in cloud phase for blowing snow'
-          CALL abort_physic(modname,abort_message,1)
-       ENDIF
+      IF (ok_new_lscp .AND. ok_icefra_lscp) THEN
+        DO k = 1, klev
+          DO i = 1, klon
+            radocond(i, k) = radocond(i, k) + qbs_seri(i, k)
+            picefra(i, k) = (radocond(i, k) * picefra(i, k) + qbs_seri(i, k)) / (radocond(i, k))
+            qbsfra = min(qbs_seri(i, k) / qbst_bs, 1.0)
+            cldfra(i, k) = max(cldfra(i, k), qbsfra)
+          ENDDO
+        ENDDO
+      ELSE
+        WRITE(lunout, *)"PAY ATTENTION, you try to activate the radiative effect of blowing snow"
+        WRITE(lunout, *)"with ok_new_lscp=false and/or ok_icefra_lscp=false"
+        abort_message = 'inconsistency in cloud phase for blowing snow'
+        CALL abort_physic(modname, abort_message, 1)
+      ENDIF
 
     ENDIF
 
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
-    !
     !-------------------------------------------------------------------
     !  PRESCRIPTION DES NUAGES POUR LE RAYONNEMENT
@@ -3943,119 +3895,118 @@
 
     ! 1. NUAGES CONVECTIFS
-    !
+
     !IM cf FH
     !     IF (iflag_cld_th.eq.-1) THEN ! seulement pour Tiedtke
     IF (iflag_cld_th<=-1) THEN ! seulement pour Tiedtke
-       snow_tiedtke=0.
-       !     print*,'avant calcul de la pseudo precip '
-       !     print*,'iflag_cld_th',iflag_cld_th
-       IF (iflag_cld_th==-1) THEN
-          rain_tiedtke=rain_con
-       ELSE
-          !       print*,'calcul de la pseudo precip '
-          rain_tiedtke=0.
-          !         print*,'calcul de la pseudo precip 0'
-          DO k=1,klev
-             DO i=1,klon
-                IF (d_q_con(i,k)<0.) THEN
-                   rain_tiedtke(i)=rain_tiedtke(i)-d_q_con(i,k)/pdtphys &
-                        *(paprs(i,k)-paprs(i,k+1))/rg
-                ENDIF
-             ENDDO
+      snow_tiedtke = 0.
+      !     print*,'avant calcul de la pseudo precip '
+      !     print*,'iflag_cld_th',iflag_cld_th
+      IF (iflag_cld_th==-1) THEN
+        rain_tiedtke = rain_con
+      ELSE
+        !       print*,'calcul de la pseudo precip '
+        rain_tiedtke = 0.
+        !         print*,'calcul de la pseudo precip 0'
+        DO k = 1, klev
+          DO i = 1, klon
+            IF (d_q_con(i, k)<0.) THEN
+              rain_tiedtke(i) = rain_tiedtke(i) - d_q_con(i, k) / pdtphys &
+                      * (paprs(i, k) - paprs(i, k + 1)) / rg
+            ENDIF
           ENDDO
-       ENDIF
-       !
-       !     call dump2d(iim,jjm,rain_tiedtke(2:klon-1),'PSEUDO PRECIP ')
-       !
-
-       ! Nuages diagnostiques pour Tiedtke
-       CALL diagcld1(paprs,pplay, &
-                                !IM cf FH. rain_con,snow_con,ibas_con,itop_con,
-            rain_tiedtke,snow_tiedtke,ibas_con,itop_con, &
-            diafra,dialiq)
-       DO k = 1, klev
-          DO i = 1, klon
-             IF (diafra(i,k)>cldfra(i,k)) THEN
-                radocond(i,k) = dialiq(i,k)
-                cldfra(i,k) = diafra(i,k)
-             ENDIF
+        ENDDO
+      ENDIF
+
+      !     call dump2d(iim,jjm,rain_tiedtke(2:klon-1),'PSEUDO PRECIP ')
+
+      ! Nuages diagnostiques pour Tiedtke
+      CALL diagcld1(paprs, pplay, &
+              !IM cf FH. rain_con,snow_con,ibas_con,itop_con,
+              rain_tiedtke, snow_tiedtke, ibas_con, itop_con, &
+              diafra, dialiq)
+      DO k = 1, klev
+        DO i = 1, klon
+          IF (diafra(i, k)>cldfra(i, k)) THEN
+            radocond(i, k) = dialiq(i, k)
+            cldfra(i, k) = diafra(i, k)
+          ENDIF
+        ENDDO
+      ENDDO
+
+    ELSE IF (iflag_cld_th>=3) THEN
+      !  On prend pour les nuages convectifs le max du calcul de la
+      !  convection et du calcul du pas de temps precedent diminue d'un facteur
+      !  facttemps
+      facteur = pdtphys * facttemps
+      DO k = 1, klev
+        DO i = 1, klon
+          rnebcon(i, k) = rnebcon(i, k) * facteur
+          IF (rnebcon0(i, k) * clwcon0(i, k)>rnebcon(i, k) * clwcon(i, k)) THEN
+            rnebcon(i, k) = rnebcon0(i, k)
+            clwcon(i, k) = clwcon0(i, k)
+          ENDIF
+        ENDDO
+      ENDDO
+
+      !   On prend la somme des fractions nuageuses et des contenus en eau
+
+      IF (iflag_cld_th>=5) THEN
+
+        DO k = 1, klev
+          ptconvth(:, k) = fm_therm(:, k + 1)>0.
+        ENDDO
+
+        IF (iflag_coupl==4) THEN
+
+          ! Dans le cas iflag_coupl==4, on prend la somme des convertures
+          ! convectives et lsc dans la partie des thermiques
+          ! Le controle par iflag_coupl est peut etre provisoire.
+          DO k = 1, klev
+            DO i = 1, klon
+              IF (ptconv(i, k).AND.ptconvth(i, k)) THEN
+                radocond(i, k) = radocond(i, k) + rnebcon(i, k) * clwcon(i, k)
+                cldfra(i, k) = min(cldfra(i, k) + rnebcon(i, k), 1.)
+              ELSE IF (ptconv(i, k)) THEN
+                cldfra(i, k) = rnebcon(i, k)
+                radocond(i, k) = rnebcon(i, k) * clwcon(i, k)
+              ENDIF
+            ENDDO
           ENDDO
-       ENDDO
-
-    ELSE IF (iflag_cld_th>=3) THEN
-       !  On prend pour les nuages convectifs le max du calcul de la
-       !  convection et du calcul du pas de temps precedent diminue d'un facteur
-       !  facttemps
-       facteur = pdtphys *facttemps
-       DO k=1,klev
-          DO i=1,klon
-             rnebcon(i,k)=rnebcon(i,k)*facteur
-             IF (rnebcon0(i,k)*clwcon0(i,k)>rnebcon(i,k)*clwcon(i,k)) THEN
-                rnebcon(i,k)=rnebcon0(i,k)
-                clwcon(i,k)=clwcon0(i,k)
-             ENDIF
+
+        ELSE IF (iflag_coupl==5) THEN
+          DO k = 1, klev
+            DO i = 1, klon
+              cldfra(i, k) = min(cldfra(i, k) + rnebcon(i, k), 1.)
+              radocond(i, k) = radocond(i, k) + rnebcon(i, k) * clwcon(i, k)
+            ENDDO
           ENDDO
-       ENDDO
-
-       !   On prend la somme des fractions nuageuses et des contenus en eau
-
-       IF (iflag_cld_th>=5) THEN
-
-          DO k=1,klev
-             ptconvth(:,k)=fm_therm(:,k+1)>0.
+
+        ELSE
+
+          ! Si on est sur un point touche par la convection
+          ! profonde et pas par les thermiques, on prend la
+          ! couverture nuageuse et l'eau nuageuse de la convection
+          ! profonde.
+
+          !IM/FH: 2011/02/23
+          ! definition des points sur lesquels ls thermiques sont actifs
+
+          DO k = 1, klev
+            DO i = 1, klon
+              IF (ptconv(i, k).AND. .NOT.ptconvth(i, k)) THEN
+                cldfra(i, k) = rnebcon(i, k)
+                radocond(i, k) = rnebcon(i, k) * clwcon(i, k)
+              ENDIF
+            ENDDO
           ENDDO
 
-          IF (iflag_coupl==4) THEN
-
-             ! Dans le cas iflag_coupl==4, on prend la somme des convertures
-             ! convectives et lsc dans la partie des thermiques
-             ! Le controle par iflag_coupl est peut etre provisoire.
-             DO k=1,klev
-                DO i=1,klon
-                   IF (ptconv(i,k).AND.ptconvth(i,k)) THEN
-                      radocond(i,k)=radocond(i,k)+rnebcon(i,k)*clwcon(i,k)
-                      cldfra(i,k)=min(cldfra(i,k)+rnebcon(i,k),1.)
-                   ELSE IF (ptconv(i,k)) THEN
-                      cldfra(i,k)=rnebcon(i,k)
-                      radocond(i,k)=rnebcon(i,k)*clwcon(i,k)
-                   ENDIF
-                ENDDO
-             ENDDO
-
-          ELSE IF (iflag_coupl==5) THEN
-             DO k=1,klev
-                DO i=1,klon
-                   cldfra(i,k)=min(cldfra(i,k)+rnebcon(i,k),1.)
-                   radocond(i,k)=radocond(i,k)+rnebcon(i,k)*clwcon(i,k)
-                ENDDO
-             ENDDO
-
-          ELSE
-
-             ! Si on est sur un point touche par la convection
-             ! profonde et pas par les thermiques, on prend la
-             ! couverture nuageuse et l'eau nuageuse de la convection
-             ! profonde.
-
-             !IM/FH: 2011/02/23 
-             ! definition des points sur lesquels ls thermiques sont actifs
-
-             DO k=1,klev
-                DO i=1,klon
-                   IF (ptconv(i,k).AND. .NOT.ptconvth(i,k)) THEN
-                      cldfra(i,k)=rnebcon(i,k)
-                      radocond(i,k)=rnebcon(i,k)*clwcon(i,k)
-                   ENDIF
-                ENDDO
-             ENDDO
-
-          ENDIF
-
-       ELSE
-
-          ! Ancienne version
-          cldfra(:,:)=min(max(cldfra(:,:),rnebcon(:,:)),1.)
-          radocond(:,:)=radocond(:,:)+rnebcon(:,:)*clwcon(:,:)
-       ENDIF
+        ENDIF
+
+      ELSE
+
+        ! Ancienne version
+        cldfra(:, :) = min(max(cldfra(:, :), rnebcon(:, :)), 1.)
+        radocond(:, :) = radocond(:, :) + rnebcon(:, :) * clwcon(:, :)
+      ENDIF
 
     ENDIF
@@ -4068,173 +4019,171 @@
     !        enddo prfl, psfl,
     !     enddo
-    !
+
     ! 2. NUAGES STARTIFORMES
-    !
+
     IF (ok_stratus) THEN
-       CALL diagcld2(paprs,pplay,t_seri,q_seri, diafra,dialiq)
-       DO k = 1, klev
-          DO i = 1, klon
-             IF (diafra(i,k)>cldfra(i,k)) THEN
-                radocond(i,k) = dialiq(i,k)
-                cldfra(i,k) = diafra(i,k)
-             ENDIF
-          ENDDO
-       ENDDO
+      CALL diagcld2(paprs, pplay, t_seri, q_seri, diafra, dialiq)
+      DO k = 1, klev
+        DO i = 1, klon
+          IF (diafra(i, k)>cldfra(i, k)) THEN
+            radocond(i, k) = dialiq(i, k)
+            cldfra(i, k) = diafra(i, k)
+          ENDIF
+        ENDDO
+      ENDDO
     ENDIF
-    !
+
     ! Precipitation totale
-    !
+
     DO i = 1, klon
-       rain_fall(i) = rain_con(i) + rain_lsc(i)
-       snow_fall(i) = snow_con(i) + snow_lsc(i)
+      rain_fall(i) = rain_con(i) + rain_lsc(i)
+      snow_fall(i) = snow_con(i) + snow_lsc(i)
     ENDDO
-    !
+
     ! Calculer l'humidite relative pour diagnostique
-    !
+
     DO k = 1, klev
-       DO i = 1, klon
-          zx_t = t_seri(i,k)
-          IF (thermcep) THEN
-             !!           if (iflag_ice_thermo.eq.0) then                 !jyg
-             zdelta = MAX(0.,SIGN(1.,rtt-zx_t))
-             !!           else                                            !jyg
-             !!           zdelta = MAX(0.,SIGN(1.,t_glace_min-zx_t))      !jyg
-             !!           endif                                           !jyg
-             zx_qs  = r2es * FOEEW(zx_t,zdelta)/pplay(i,k)
-             zx_qs  = MIN(0.5,zx_qs)
-             zcor   = 1./(1.-retv*zx_qs)
-             zx_qs  = zx_qs*zcor
+      DO i = 1, klon
+        zx_t = t_seri(i, k)
+        IF (thermcep) THEN
+          !!           if (iflag_ice_thermo.eq.0) then                 !jyg
+          zdelta = MAX(0., SIGN(1., rtt - zx_t))
+          !!           else                                            !jyg
+          !!           zdelta = MAX(0.,SIGN(1.,t_glace_min-zx_t))      !jyg
+          !!           endif                                           !jyg
+          zx_qs = r2es * FOEEW(zx_t, zdelta) / pplay(i, k)
+          zx_qs = MIN(0.5, zx_qs)
+          zcor = 1. / (1. - retv * zx_qs)
+          zx_qs = zx_qs * zcor
+        ELSE
+          !!           IF (zx_t.LT.t_coup) THEN             !jyg
+          IF (zx_t<rtt) THEN                  !jyg
+            zx_qs = qsats(zx_t) / pplay(i, k)
           ELSE
-             !!           IF (zx_t.LT.t_coup) THEN             !jyg
-             IF (zx_t<rtt) THEN                  !jyg
-                zx_qs = qsats(zx_t)/pplay(i,k)
-             ELSE
-                zx_qs = qsatl(zx_t)/pplay(i,k)
-             ENDIF
+            zx_qs = qsatl(zx_t) / pplay(i, k)
           ENDIF
-          zx_rh(i,k) = q_seri(i,k)/zx_qs
-            IF (iflag_ice_thermo > 0) THEN
-          zx_rhl(i,k) = q_seri(i,k)/(qsatl(zx_t)/pplay(i,k))
-          zx_rhi(i,k) = q_seri(i,k)/(qsats(zx_t)/pplay(i,k))
-            ENDIF
-          zqsat(i,k)=zx_qs
-       ENDDO
+        ENDIF
+        zx_rh(i, k) = q_seri(i, k) / zx_qs
+        IF (iflag_ice_thermo > 0) THEN
+          zx_rhl(i, k) = q_seri(i, k) / (qsatl(zx_t) / pplay(i, k))
+          zx_rhi(i, k) = q_seri(i, k) / (qsats(zx_t) / pplay(i, k))
+        ENDIF
+        zqsat(i, k) = zx_qs
+      ENDDO
     ENDDO
 
-    !IM Calcul temp.potentielle a 2m (tpot) et temp. potentielle 
+    !IM Calcul temp.potentielle a 2m (tpot) et temp. potentielle
     !   equivalente a 2m (tpote) pour diagnostique
-    !
+
     DO i = 1, klon
-       tpot(i)=zt2m(i)*(100000./paprs(i,1))**RKAPPA
-       IF (thermcep) THEN
-          IF(zt2m(i)<RTT) then
-             Lheat=RLSTT
-          ELSE
-             Lheat=RLVTT
-          ENDIF
-       ELSE
-          IF (zt2m(i)<RTT) THEN
-             Lheat=RLSTT
-          ELSE
-             Lheat=RLVTT
-          ENDIF
-       ENDIF
-       tpote(i) = tpot(i)*      &
-            EXP((Lheat *qsat2m(i))/(RCPD*zt2m(i)))
+      tpot(i) = zt2m(i) * (100000. / paprs(i, 1))**RKAPPA
+      IF (thermcep) THEN
+        IF(zt2m(i)<RTT) then
+          Lheat = RLSTT
+        ELSE
+          Lheat = RLVTT
+        ENDIF
+      ELSE
+        IF (zt2m(i)<RTT) THEN
+          Lheat = RLSTT
+        ELSE
+          Lheat = RLVTT
+        ENDIF
+      ENDIF
+      tpote(i) = tpot(i) * &
+              EXP((Lheat * qsat2m(i)) / (RCPD * zt2m(i)))
     ENDDO
 
-    IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL
-IF (CPPKEY_INCA) THEN
-       CALL VTe(VTphysiq)
-       CALL VTb(VTinca)
-       calday = REAL(days_elapsed + 1) + jH_cur
-
-       CALL chemtime(itap+itau_phy-1, date0, phys_tstep, itap)
-       CALL AEROSOL_METEO_CALC( &
-            calday,pdtphys,pplay,paprs,t,pmflxr,pmflxs, &
-            prfl,psfl,pctsrf,cell_area, &
-            latitude_deg,longitude_deg,u10m,v10m)
-
-       zxsnow_dummy(:) = 0.0
-
-       CALL chemhook_begin (calday, &
-            days_elapsed+1, &
-            jH_cur, &
-            pctsrf(1,1), &
-            latitude_deg, &
-            longitude_deg, &
-            cell_area, &
-            paprs, &
-            pplay, &
-            coefh(1:klon,1:klev,is_ave), &
-            pphi, &
-            t_seri, &
-            u, &
-            v, &
-            rot, &
-            wo(:, :, 1), &
-            q_seri, &
-            zxtsol, &
-            zt2m, &
-            zxsnow_dummy, &
-            solsw, &
-            albsol1, &
-            rain_fall, &
-            snow_fall, &
-            itop_con, &
-            ibas_con, &
-            cldfra, &
-            nbp_lon, &
-            nbp_lat-1, &
-            tr_seri(:,:,1+nqCO2:nbtr), &
-            ftsol, &
-            paprs, &
-            cdragh, &
-            cdragm, &
-            pctsrf, &
-            pdtphys, &
-            itap)
-
-       CALL VTe(VTinca)
-       CALL VTb(VTphysiq)
-END IF
+    IF (ANY(type_trac == ['inca', 'inco'])) THEN ! ModThL
+      IF (CPPKEY_INCA) THEN
+        CALL VTe(VTphysiq)
+        CALL VTb(VTinca)
+        calday = REAL(days_elapsed + 1) + jH_cur
+
+        CALL chemtime(itap + itau_phy - 1, date0, phys_tstep, itap)
+        CALL AEROSOL_METEO_CALC(&
+                calday, pdtphys, pplay, paprs, t, pmflxr, pmflxs, &
+                prfl, psfl, pctsrf, cell_area, &
+                latitude_deg, longitude_deg, u10m, v10m)
+
+        zxsnow_dummy(:) = 0.0
+
+        CALL chemhook_begin (calday, &
+                days_elapsed + 1, &
+                jH_cur, &
+                pctsrf(1, 1), &
+                latitude_deg, &
+                longitude_deg, &
+                cell_area, &
+                paprs, &
+                pplay, &
+                coefh(1:klon, 1:klev, is_ave), &
+                pphi, &
+                t_seri, &
+                u, &
+                v, &
+                rot, &
+                wo(:, :, 1), &
+                q_seri, &
+                zxtsol, &
+                zt2m, &
+                zxsnow_dummy, &
+                solsw, &
+                albsol1, &
+                rain_fall, &
+                snow_fall, &
+                itop_con, &
+                ibas_con, &
+                cldfra, &
+                nbp_lon, &
+                nbp_lat - 1, &
+                tr_seri(:, :, 1 + nqCO2:nbtr), &
+                ftsol, &
+                paprs, &
+                cdragh, &
+                cdragm, &
+                pctsrf, &
+                pdtphys, &
+                itap)
+
+        CALL VTe(VTinca)
+        CALL VTb(VTphysiq)
+      END IF
     ENDIF !type_trac = inca or inco
     IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
     !CALL chemtime_rep(itap+itau_phy-1, date0, dtime, itap)
-    CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap) 
+    CALL chemtime_rep(itap+itau_phy-1, date0, phys_tstep, itap)
 #endif
     ENDIF
 
-    !
     ! Appeler le rayonnement mais calculer tout d'abord l'albedo du sol.
-    !
-    IF (MOD(itaprad,radpas)==0) THEN
-
-       !
-       !jq - introduce the aerosol direct and first indirect radiative forcings
-       !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
-       IF (flag_aerosol > 0) THEN
-          IF (iflag_rrtm == 0) THEN !--old radiation
-             IF (.NOT. aerosol_couple) THEN
-                !
-                CALL readaerosol_optic( &
-                     debut, flag_aerosol, itap, jD_cur-jD_ref, &
-                     pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                     mass_solu_aero, mass_solu_aero_pi,  &
-                     tau_aero, piz_aero, cg_aero,  &
-                     tausum_aero, tau3d_aero)
-             ENDIF
-          ELSE IF (iflag_rrtm ==1) THEN  ! RRTM radiation
-             IF (aerosol_couple .AND. config_inca == 'aero' ) THEN
-                abort_message='config_inca=aero et rrtm=1 impossible'
-                CALL abort_physic(modname,abort_message,1)
-             ELSE
-                !
+
+    IF (MOD(itaprad, radpas)==0) THEN
+
+      !jq - introduce the aerosol direct and first indirect radiative forcings
+      !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
+      IF (flag_aerosol > 0) THEN
+        IF (iflag_rrtm == 0) THEN !--old radiation
+          IF (.NOT. aerosol_couple) THEN
+
+            CALL readaerosol_optic(&
+                    debut, flag_aerosol, itap, jD_cur - jD_ref, &
+                    pdtphys, pplay, paprs, t_seri, rhcl, presnivs, &
+                    mass_solu_aero, mass_solu_aero_pi, &
+                    tau_aero, piz_aero, cg_aero, &
+                    tausum_aero, tau3d_aero)
+          ENDIF
+        ELSE IF (iflag_rrtm ==1) THEN  ! RRTM radiation
+          IF (aerosol_couple .AND. config_inca == 'aero') THEN
+            abort_message = 'config_inca=aero et rrtm=1 impossible'
+            CALL abort_physic(modname, abort_message, 1)
+          ELSE
+
 #ifdef CPP_RRTM
                 IF (NSW.EQ.6) THEN
                    !--new aerosol properties SW and LW
-                   !
-#ifdef CPP_Dust
+
+IF (CPPKEY_DUST) THEN
                    !--SPL aerosol model
                    CALL splaerosol_optic_rrtm( ok_alw, pplay, paprs, t_seri, rhcl, &
@@ -4242,5 +4191,5 @@
                         tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
                         tausum_aero, tau3d_aero)
-#else
+ELSE
                    !--climatologies or INCA aerosols
                    CALL readaerosol_optic_rrtm( debut, aerosol_couple, ok_alw, ok_volcan, &
@@ -4250,5 +4199,5 @@
                         tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
                         tausum_aero, drytausum_aero, tau3d_aero)
-#endif
+END IF
 
                    IF (flag_aerosol .EQ. 7) THEN
@@ -4257,8 +4206,7 @@
                    ENDIF
 
-                   !
-                ELSE IF (NSW.EQ.2) THEN 
+                ELSE IF (NSW.EQ.2) THEN
                    !--for now we use the old aerosol properties
-                   !
+
                    CALL readaerosol_optic( &
                         debut, flag_aerosol, itap, jD_cur-jD_ref, &
@@ -4267,5 +4215,5 @@
                         tau_aero, piz_aero, cg_aero,  &
                         tausum_aero, tau3d_aero)
-                   !
+
                    !--natural aerosols
                    tau_aero_sw_rrtm(:,:,1,:)=tau_aero(:,:,3,:)
@@ -4276,8 +4224,8 @@
                    piz_aero_sw_rrtm(:,:,2,:)=piz_aero(:,:,2,:)
                    cg_aero_sw_rrtm (:,:,2,:)=cg_aero (:,:,2,:)
-                   !
+
                    !--no LW optics
                    tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
-                   !
+
                 ELSE
                    abort_message='Only NSW=2 or 6 are possible with ' &
@@ -4286,11 +4234,11 @@
                 ENDIF
 #else
-                abort_message='You should compile with -rrtm if running ' &
-                     // 'with iflag_rrtm=1'
-                CALL abort_physic(modname,abort_message,1)
+            abort_message = 'You should compile with -rrtm if running ' &
+                    // 'with iflag_rrtm=1'
+            CALL abort_physic(modname, abort_message, 1)
 #endif
-                !
-             ENDIF
-          ELSE IF (iflag_rrtm ==2) THEN    ! ecrad RADIATION
+
+          ENDIF
+        ELSE IF (iflag_rrtm ==2) THEN    ! ecrad RADIATION
 #ifdef CPP_ECRAD
              !--climatologies or INCA aerosols
@@ -4298,48 +4246,48 @@
                   flag_aerosol, flag_bc_internal_mixture, itap, jD_cur-jD_ref, &
                   pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                  tr_seri, mass_solu_aero, mass_solu_aero_pi, m_allaer)  
+                  tr_seri, mass_solu_aero, mass_solu_aero_pi, m_allaer)
 #else
-                abort_message='You should compile with -rad ecrad if running with iflag_rrtm=2'
-                CALL abort_physic(modname,abort_message,1)
+          abort_message = 'You should compile with -rad ecrad if running with iflag_rrtm=2'
+          CALL abort_physic(modname, abort_message, 1)
 #endif
+        ENDIF
+
+      ELSE   !--flag_aerosol = 0
+        tausum_aero(:, :, :) = 0.
+        drytausum_aero(:, :) = 0.
+        mass_solu_aero(:, :) = 0.
+        mass_solu_aero_pi(:, :) = 0.
+        IF (iflag_rrtm == 0) THEN !--old radiation
+          tau_aero(:, :, :, :) = 1.e-15
+          piz_aero(:, :, :, :) = 1.
+          cg_aero(:, :, :, :) = 0.
+        ELSE
+          tau_aero_sw_rrtm(:, :, :, :) = 1.e-15
+          tau_aero_lw_rrtm(:, :, :, :) = 1.e-15
+          piz_aero_sw_rrtm(:, :, :, :) = 1.0
+          cg_aero_sw_rrtm(:, :, :, :) = 0.0
+        ENDIF
+      ENDIF
+
+      !--WMO criterion to determine tropopause
+      CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
+
+      !--STRAT AEROSOL
+      !--updates tausum_aero,tau_aero,piz_aero,cg_aero
+      IF (flag_aerosol_strat>0) THEN
+        IF (prt_level >=10) THEN
+          PRINT *, 'appel a readaerosolstrat', mth_cur
+        ENDIF
+        IF (iflag_rrtm==0) THEN
+          IF (flag_aerosol_strat==1) THEN
+            CALL readaerosolstrato(debut)
+          ELSE
+            abort_message = 'flag_aerosol_strat must equal 1 for rrtm=0'
+            CALL abort_physic(modname, abort_message, 1)
           ENDIF
-
-       ELSE   !--flag_aerosol = 0 
-          tausum_aero(:,:,:) = 0.
-          drytausum_aero(:,:) = 0.
-          mass_solu_aero(:,:) = 0.
-          mass_solu_aero_pi(:,:) = 0.
-          IF (iflag_rrtm == 0) THEN !--old radiation
-             tau_aero(:,:,:,:) = 1.e-15
-             piz_aero(:,:,:,:) = 1.
-             cg_aero(:,:,:,:)  = 0.
-          ELSE
-             tau_aero_sw_rrtm(:,:,:,:) = 1.e-15
-             tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
-             piz_aero_sw_rrtm(:,:,:,:) = 1.0
-             cg_aero_sw_rrtm(:,:,:,:)  = 0.0
-          ENDIF
-       ENDIF
-       !
-       !--WMO criterion to determine tropopause
-       CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
-       !
-       !--STRAT AEROSOL
-       !--updates tausum_aero,tau_aero,piz_aero,cg_aero
-       IF (flag_aerosol_strat>0) THEN
-          IF (prt_level >=10) THEN
-             PRINT *,'appel a readaerosolstrat', mth_cur
-          ENDIF
-          IF (iflag_rrtm==0) THEN
-           IF (flag_aerosol_strat==1) THEN
-             CALL readaerosolstrato(debut)
-           ELSE
-             abort_message='flag_aerosol_strat must equal 1 for rrtm=0'
-             CALL abort_physic(modname,abort_message,1)
-           ENDIF
-          ELSE
+        ELSE
 #ifdef CPP_RRTM
 IF (.NOT. CPPKEY_STRATAER) THEN
-          !--prescribed strat aerosols 
+          !--prescribed strat aerosols
           !--only in the case of non-interactive strat aerosols
             IF (flag_aerosol_strat.EQ.1) THEN
@@ -4353,13 +4301,13 @@
 END IF
 #else
-             abort_message='You should compile with -rrtm if running ' &
+          abort_message = 'You should compile with -rrtm if running ' &
                   // 'with iflag_rrtm=1'
-             CALL abort_physic(modname,abort_message,1)
+          CALL abort_physic(modname, abort_message, 1)
 #endif
-          ENDIF
-       ELSE
-          tausum_aero(:,:,id_STRAT_phy) = 0. 
-       ENDIF
-!
+        ENDIF
+      ELSE
+        tausum_aero(:, :, id_STRAT_phy) = 0.
+      ENDIF
+
 #ifdef CPP_RRTM
 IF (CPPKEY_STRATAER) THEN
@@ -4370,291 +4318,287 @@
 END IF
 #endif
-       !--fin STRAT AEROSOL
-       !     
-
-       ! Calculer les parametres optiques des nuages et quelques
-       ! parametres pour diagnostiques:
-       !
-       IF (aerosol_couple.AND.config_inca=='aero') THEN 
-          mass_solu_aero(:,:)    = ccm(:,:,1) 
-          mass_solu_aero_pi(:,:) = ccm(:,:,2) 
-       ENDIF
-
-       !Rajout appel a interface calcul proprietes optiques des nuages
-       CALL call_cloud_optics_prop(klon, klev, ok_newmicro, &
-               paprs, pplay, t_seri, radocond, picefra, cldfra, &
-               cldtau, cldemi, cldh, cldl, cldm, cldt, cldq, &
-               flwp, fiwp, flwc, fiwc, ok_aie, &
-               mass_solu_aero, mass_solu_aero_pi, &
-               cldtaupi, distcltop, temp_cltop, re, fl, ref_liq, ref_ice, &
-               ref_liq_pi, ref_ice_pi, scdnc, cldncl, reffclwtop, lcc, reffclws, &
-               reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra,  & 
-               zfice, dNovrN, ptconv, rnebcon, clwcon)
-
-       !
-       !IM betaCRF
-       !
-       cldtaurad   = cldtau
-       cldtaupirad = cldtaupi
-       cldemirad   = cldemi
-       cldfrarad   = cldfra
-
-       !
-       IF (lon1_beta==-180..AND.lon2_beta==180..AND. &
-           lat1_beta==90..AND.lat2_beta==-90.) THEN
-          !
-          ! global
-          !
-!IM 251017 begin
-!               print*,'physiq betaCRF global zdtime=',zdtime
-!IM 251017 end
-          DO k=1, klev
-             DO i=1, klon
-                IF (pplay(i,k)>=pfree) THEN
-                   beta(i,k) = beta_pbl
-                ELSE
-                   beta(i,k) = beta_free
-                ENDIF
-                IF (mskocean_beta) THEN
-                   beta(i,k) = beta(i,k) * pctsrf(i,is_oce)
-                ENDIF
-                cldtaurad(i,k)   = cldtau(i,k) * beta(i,k)
-                cldtaupirad(i,k) = cldtaupi(i,k) * beta(i,k)
-                cldemirad(i,k)   = cldemi(i,k) * beta(i,k)
-                cldfrarad(i,k)   = cldfra(i,k) * beta(i,k)
-             ENDDO
+      !--fin STRAT AEROSOL
+
+      ! Calculer les parametres optiques des nuages et quelques
+      ! parametres pour diagnostiques:
+
+      IF (aerosol_couple.AND.config_inca=='aero') THEN
+        mass_solu_aero(:, :) = ccm(:, :, 1)
+        mass_solu_aero_pi(:, :) = ccm(:, :, 2)
+      ENDIF
+
+      !Rajout appel a interface calcul proprietes optiques des nuages
+      CALL call_cloud_optics_prop(klon, klev, ok_newmicro, &
+              paprs, pplay, t_seri, radocond, picefra, cldfra, &
+              cldtau, cldemi, cldh, cldl, cldm, cldt, cldq, &
+              flwp, fiwp, flwc, fiwc, ok_aie, &
+              mass_solu_aero, mass_solu_aero_pi, &
+              cldtaupi, distcltop, temp_cltop, re, fl, ref_liq, ref_ice, &
+              ref_liq_pi, ref_ice_pi, scdnc, cldncl, reffclwtop, lcc, reffclws, &
+              reffclwc, cldnvi, lcc3d, lcc3dcon, lcc3dstra, icc3dcon, icc3dstra, &
+              zfice, dNovrN, ptconv, rnebcon, clwcon)
+
+      !IM betaCRF
+
+      cldtaurad = cldtau
+      cldtaupirad = cldtaupi
+      cldemirad = cldemi
+      cldfrarad = cldfra
+
+      IF (lon1_beta==-180..AND.lon2_beta==180..AND. &
+              lat1_beta==90..AND.lat2_beta==-90.) THEN
+
+        ! global
+
+        !IM 251017 begin
+        !               print*,'physiq betaCRF global zdtime=',zdtime
+        !IM 251017 end
+        DO k = 1, klev
+          DO i = 1, klon
+            IF (pplay(i, k)>=pfree) THEN
+              beta(i, k) = beta_pbl
+            ELSE
+              beta(i, k) = beta_free
+            ENDIF
+            IF (mskocean_beta) THEN
+              beta(i, k) = beta(i, k) * pctsrf(i, is_oce)
+            ENDIF
+            cldtaurad(i, k) = cldtau(i, k) * beta(i, k)
+            cldtaupirad(i, k) = cldtaupi(i, k) * beta(i, k)
+            cldemirad(i, k) = cldemi(i, k) * beta(i, k)
+            cldfrarad(i, k) = cldfra(i, k) * beta(i, k)
           ENDDO
-          !
-       ELSE
-          !
-          ! regional
-          !
-          DO k=1, klev
-             DO i=1,klon
-                !
-                IF (longitude_deg(i)>=lon1_beta.AND. &
+        ENDDO
+
+      ELSE
+
+        ! regional
+
+        DO k = 1, klev
+          DO i = 1, klon
+
+            IF (longitude_deg(i)>=lon1_beta.AND. &
                     longitude_deg(i)<=lon2_beta.AND. &
                     latitude_deg(i)<=lat1_beta.AND.  &
                     latitude_deg(i)>=lat2_beta) THEN
-                   IF (pplay(i,k)>=pfree) THEN
-                      beta(i,k) = beta_pbl
-                   ELSE
-                      beta(i,k) = beta_free
-                   ENDIF
-                   IF (mskocean_beta) THEN
-                      beta(i,k) = beta(i,k) * pctsrf(i,is_oce)
-                   ENDIF
-                   cldtaurad(i,k)   = cldtau(i,k) * beta(i,k)
-                   cldtaupirad(i,k) = cldtaupi(i,k) * beta(i,k)
-                   cldemirad(i,k)   = cldemi(i,k) * beta(i,k)
-                   cldfrarad(i,k)   = cldfra(i,k) * beta(i,k)
-                ENDIF
-             !
-             ENDDO
+              IF (pplay(i, k)>=pfree) THEN
+                beta(i, k) = beta_pbl
+              ELSE
+                beta(i, k) = beta_free
+              ENDIF
+              IF (mskocean_beta) THEN
+                beta(i, k) = beta(i, k) * pctsrf(i, is_oce)
+              ENDIF
+              cldtaurad(i, k) = cldtau(i, k) * beta(i, k)
+              cldtaupirad(i, k) = cldtaupi(i, k) * beta(i, k)
+              cldemirad(i, k) = cldemi(i, k) * beta(i, k)
+              cldfrarad(i, k) = cldfra(i, k) * beta(i, k)
+            ENDIF
+
           ENDDO
-       !
-       ENDIF
-
-       !lecture de la chlorophylle pour le nouvel albedo de Sunghye Baek 
-       IF (ok_chlorophyll) THEN
-          print*,"-- reading chlorophyll"
-          CALL readchlorophyll(debut)
-       ENDIF
-
-!--if ok_suntime_rrtm we use ancillay data for RSUN 
-!--previous values are therefore overwritten
-!--this is needed for CMIP6 runs
-!--and only possible for new radiation scheme
-       IF (iflag_rrtm==1.AND.ok_suntime_rrtm) THEN
+        ENDDO
+
+      ENDIF
+
+      !lecture de la chlorophylle pour le nouvel albedo de Sunghye Baek
+      IF (ok_chlorophyll) THEN
+        print*, "-- reading chlorophyll"
+        CALL readchlorophyll(debut)
+      ENDIF
+
+      !--if ok_suntime_rrtm we use ancillay data for RSUN
+      !--previous values are therefore overwritten
+      !--this is needed for CMIP6 runs
+      !--and only possible for new radiation scheme
+      IF (iflag_rrtm==1.AND.ok_suntime_rrtm) THEN
 #ifdef CPP_RRTM
          CALL read_rsun_rrtm(debut)
 #endif
-       ENDIF
-
-       IF (mydebug) THEN
-          CALL writefield_phy('u_seri',u_seri,nbp_lev)
-          CALL writefield_phy('v_seri',v_seri,nbp_lev)
-          CALL writefield_phy('t_seri',t_seri,nbp_lev)
-          CALL writefield_phy('q_seri',q_seri,nbp_lev)
-       ENDIF
-
-       !
-       !sonia : If Iflag_radia >=2, pertubation of some variables
-       !input to radiation (DICE)
-       !
-       IF (iflag_radia >= 2) THEN
-          zsav_tsol (:) = zxtsol(:)
-          CALL perturb_radlwsw(zxtsol,iflag_radia)
-       ENDIF
-
-       IF (aerosol_couple.AND.config_inca=='aero') THEN 
-IF (CPPKEY_INCA) THEN
+      ENDIF
+
+      IF (mydebug) THEN
+        CALL writefield_phy('u_seri', u_seri, nbp_lev)
+        CALL writefield_phy('v_seri', v_seri, nbp_lev)
+        CALL writefield_phy('t_seri', t_seri, nbp_lev)
+        CALL writefield_phy('q_seri', q_seri, nbp_lev)
+      ENDIF
+
+      !sonia : If Iflag_radia >=2, pertubation of some variables
+      !input to radiation (DICE)
+
+      IF (iflag_radia >= 2) THEN
+        zsav_tsol (:) = zxtsol(:)
+        CALL perturb_radlwsw(zxtsol, iflag_radia)
+      ENDIF
+
+      IF (aerosol_couple.AND.config_inca=='aero') THEN
+        IF (CPPKEY_INCA) THEN
           CALL radlwsw_inca  &
-               (chemistry_couple, kdlon,kflev,dist, rmu0, fract, solaire, &
-               paprs, pplay,zxtsol,albsol1, albsol2, t_seri,q_seri, &
-               size(wo,3), wo, &
-               cldfrarad, cldemirad, cldtaurad, &
-               heat,heat0,cool,cool0,albpla, &
-               topsw,toplw,solsw,sollw, &
-               sollwdown, &
-               topsw0,toplw0,solsw0,sollw0, &
-               lwdn0, lwdn, lwup0, lwup,  &
-               swdn0, swdn, swup0, swup, &
-               ok_ade, ok_aie, &
-               tau_aero, piz_aero, cg_aero, &
-               topswad_aero, solswad_aero, &
-               topswad0_aero, solswad0_aero, &
-               topsw_aero, topsw0_aero, &
-               solsw_aero, solsw0_aero, &
-               cldtaupirad, &
-               topswai_aero, solswai_aero)
-END IF
-       ELSE
-          !
-          !IM calcul radiatif pour le cas actuel
-          !
-          RCO2 = RCO2_act
-          RCH4 = RCH4_act
-          RN2O = RN2O_act
-          RCFC11 = RCFC11_act
-          RCFC12 = RCFC12_act
-          ! 
-          !--interactive CO2 in ppm from carbon cycle
-          IF (carbon_cycle_rad) RCO2=RCO2_glo
-          !
+                  (chemistry_couple, kdlon, kflev, dist, rmu0, fract, solaire, &
+                  paprs, pplay, zxtsol, albsol1, albsol2, t_seri, q_seri, &
+                  size(wo, 3), wo, &
+                  cldfrarad, cldemirad, cldtaurad, &
+                  heat, heat0, cool, cool0, albpla, &
+                  topsw, toplw, solsw, sollw, &
+                  sollwdown, &
+                  topsw0, toplw0, solsw0, sollw0, &
+                  lwdn0, lwdn, lwup0, lwup, &
+                  swdn0, swdn, swup0, swup, &
+                  ok_ade, ok_aie, &
+                  tau_aero, piz_aero, cg_aero, &
+                  topswad_aero, solswad_aero, &
+                  topswad0_aero, solswad0_aero, &
+                  topsw_aero, topsw0_aero, &
+                  solsw_aero, solsw0_aero, &
+                  cldtaupirad, &
+                  topswai_aero, solswai_aero)
+        END IF
+      ELSE
+
+        !IM calcul radiatif pour le cas actuel
+
+        RCO2 = RCO2_act
+        RCH4 = RCH4_act
+        RN2O = RN2O_act
+        RCFC11 = RCFC11_act
+        RCFC12 = RCFC12_act
+
+        !--interactive CO2 in ppm from carbon cycle
+        IF (carbon_cycle_rad) RCO2 = RCO2_glo
+
+        IF (prt_level >=10) THEN
+          print *, ' ->radlwsw, number 1 '
+        ENDIF
+
+        ! AI namelist utilise pour l appel principal de radlwsw (ecrad)
+        namelist_ecrad_file = 'namelist_ecrad'
+
+        CALL radlwsw &
+                (debut, dist, rmu0, fract, &
+                !albedo SB >>>
+                !      paprs, pplay,zxtsol,albsol1, albsol2,  &
+                paprs, pplay, zxtsol, SFRWL, albsol_dir, albsol_dif, &
+                !albedo SB <<<
+                t_seri, q_seri, wo, &
+                cldfrarad, cldemirad, cldtaurad, &
+                ok_ade.OR.flag_aerosol_strat>0, ok_aie, ok_volcan, flag_volc_surfstrat, &
+                flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
+                tau_aero, piz_aero, cg_aero, &
+                tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &
+                ! Rajoute par OB pour RRTM
+                tau_aero_lw_rrtm, &
+                cldtaupirad, m_allaer, &
+                !              zqsat, flwcrad, fiwcrad, &
+                zqsat, flwc, fiwc, &
+                ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
+                namelist_ecrad_file, &
+                heat, heat0, cool, cool0, albpla, &
+                heat_volc, cool_volc, &
+                topsw, toplw, solsw, solswfdiff, sollw, &
+                sollwdown, &
+                topsw0, toplw0, solsw0, sollw0, &
+                lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup, &
+                swdnc0, swdn0, swdn, swupc0, swup0, swup, &
+                topswad_aero, solswad_aero, &
+                topswai_aero, solswai_aero, &
+                topswad0_aero, solswad0_aero, &
+                topsw_aero, topsw0_aero, &
+                solsw_aero, solsw0_aero, &
+                topswcf_aero, solswcf_aero, &
+                !-C. Kleinschmitt for LW diagnostics
+                toplwad_aero, sollwad_aero, &
+                toplwai_aero, sollwai_aero, &
+                toplwad0_aero, sollwad0_aero, &
+                !-end
+                ZLWFT0_i, ZFLDN0, ZFLUP0, &
+                ZSWFT0_i, ZFSDN0, ZFSUP0, &
+                cloud_cover_sw)
+
+        !lwoff=y, betalwoff=1. : offset LW CRE for radiation code and other
+        !schemes
+        toplw = toplw + betalwoff * (toplw0 - toplw)
+        sollw = sollw + betalwoff * (sollw0 - sollw)
+        lwdn = lwdn + betalwoff * (lwdn0 - lwdn)
+        lwup = lwup + betalwoff * (lwup0 - lwup)
+        sollwdown(:) = sollwdown(:) + betalwoff * (-1. * ZFLDN0(:, 1) - &
+                sollwdown(:))
+        cool = cool + betalwoff * (cool0 - cool)
+
+        IF (.NOT. using_xios) THEN
+
+          !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
+          !IM des taux doit etre different du taux actuel
+          !IM Par defaut on a les taux perturbes egaux aux taux actuels
+
+          IF (RCO2_per/=RCO2_act.OR. &
+                  RCH4_per/=RCH4_act.OR. &
+                  RN2O_per/=RN2O_act.OR. &
+                  RCFC11_per/=RCFC11_act.OR. &
+                  RCFC12_per/=RCFC12_act) ok_4xCO2atm = .TRUE.
+        ENDIF
+
+        IF (ok_4xCO2atm) THEN
+
+          RCO2 = RCO2_per
+          RCH4 = RCH4_per
+          RN2O = RN2O_per
+          RCFC11 = RCFC11_per
+          RCFC12 = RCFC12_per
+
           IF (prt_level >=10) THEN
-             print *,' ->radlwsw, number 1 '
+            print *, ' ->radlwsw, number 2 '
           ENDIF
-          !
-          ! AI namelist utilise pour l appel principal de radlwsw (ecrad)
-          namelist_ecrad_file='namelist_ecrad'
-          !
+
+          namelist_ecrad_file = 'namelist_ecrad'
+
           CALL radlwsw &
-               (debut, dist, rmu0, fract,  &
-                                !albedo SB >>>
-                                !      paprs, pplay,zxtsol,albsol1, albsol2,  &
-               paprs, pplay,zxtsol,SFRWL,albsol_dir, albsol_dif,  &
-                                !albedo SB <<<
-               t_seri,q_seri,wo, &
-               cldfrarad, cldemirad, cldtaurad, &
-               ok_ade.OR.flag_aerosol_strat>0, ok_aie,  ok_volcan, flag_volc_surfstrat, &
-               flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-               tau_aero, piz_aero, cg_aero, &
-               tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, & 
-               ! Rajoute par OB pour RRTM
-               tau_aero_lw_rrtm, & 
-               cldtaupirad, m_allaer, &
-!              zqsat, flwcrad, fiwcrad, &
-               zqsat, flwc, fiwc, &
-               ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
-               namelist_ecrad_file, &
-               heat,heat0,cool,cool0,albpla, &
-               heat_volc,cool_volc, &
-               topsw,toplw,solsw,solswfdiff,sollw, &
-               sollwdown, &
-               topsw0,toplw0,solsw0,sollw0, &
-               lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup,  &
-               swdnc0, swdn0, swdn, swupc0, swup0, swup, &
-               topswad_aero, solswad_aero, &
-               topswai_aero, solswai_aero, &
-               topswad0_aero, solswad0_aero, &
-               topsw_aero, topsw0_aero, &
-               solsw_aero, solsw0_aero, &
-               topswcf_aero, solswcf_aero, &
-                                !-C. Kleinschmitt for LW diagnostics
-               toplwad_aero, sollwad_aero,&
-               toplwai_aero, sollwai_aero, &
-               toplwad0_aero, sollwad0_aero,&
-                                !-end
-               ZLWFT0_i, ZFLDN0, ZFLUP0, &
-               ZSWFT0_i, ZFSDN0, ZFSUP0, &
-               cloud_cover_sw)
-
-          !lwoff=y, betalwoff=1. : offset LW CRE for radiation code and other
-          !schemes
-          toplw = toplw + betalwoff * (toplw0 - toplw)
-          sollw = sollw + betalwoff * (sollw0 - sollw)
-          lwdn = lwdn + betalwoff * (lwdn0 - lwdn)
-          lwup = lwup + betalwoff * (lwup0 - lwup)
-          sollwdown(:)= sollwdown(:) + betalwoff *(-1.*ZFLDN0(:,1) - &
-                        sollwdown(:))
-          cool = cool + betalwoff * (cool0 - cool)
- 
-          IF (.NOT. using_xios) THEN
-            !
-            !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
-            !IM des taux doit etre different du taux actuel
-            !IM Par defaut on a les taux perturbes egaux aux taux actuels
-            !
-            IF (RCO2_per/=RCO2_act.OR. &
-                RCH4_per/=RCH4_act.OR. &
-                RN2O_per/=RN2O_act.OR. &
-                RCFC11_per/=RCFC11_act.OR. &
-                RCFC12_per/=RCFC12_act) ok_4xCO2atm =.TRUE.
-          ENDIF
-   ! 
-          IF (ok_4xCO2atm) THEN
-                !
-                RCO2 = RCO2_per
-                RCH4 = RCH4_per
-                RN2O = RN2O_per
-                RCFC11 = RCFC11_per
-                RCFC12 = RCFC12_per
-                !
-                IF (prt_level >=10) THEN
-                   print *,' ->radlwsw, number 2 '
-                ENDIF
-                !
-                namelist_ecrad_file='namelist_ecrad'
-                !
-                CALL radlwsw &
-                     (debut, dist, rmu0, fract,  &
-                                !albedo SB >>>
-                                !      paprs, pplay,zxtsol,albsol1, albsol2,  &
-                     paprs, pplay,zxtsol,SFRWL,albsol_dir, albsol_dif, & 
-                                !albedo SB <<<
-                     t_seri,q_seri,wo, &
-                     cldfrarad, cldemirad, cldtaurad, &
-                     ok_ade.OR.flag_aerosol_strat>0, ok_aie,  ok_volcan, flag_volc_surfstrat, &
-                     flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
-                     tau_aero, piz_aero, cg_aero, &
-                     tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &
-                                ! Rajoute par OB pour RRTM
-                     tau_aero_lw_rrtm, &
-                     cldtaupi, m_allaer, &
-!                    zqsat, flwcrad, fiwcrad, &
-                     zqsat, flwc, fiwc, &
-                     ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
-                     namelist_ecrad_file, &
-                     heatp,heat0p,coolp,cool0p,albplap, &
-                     heat_volc,cool_volc, &
-                     topswp,toplwp,solswp,solswfdiffp,sollwp, &
-                     sollwdownp, &
-                     topsw0p,toplw0p,solsw0p,sollw0p, &
-                     lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp,  &
-                     swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp, &
-                     topswad_aerop, solswad_aerop, &
-                     topswai_aerop, solswai_aerop, &
-                     topswad0_aerop, solswad0_aerop, &
-                     topsw_aerop, topsw0_aerop, &
-                     solsw_aerop, solsw0_aerop, &
-                     topswcf_aerop, solswcf_aerop, &
-                                !-C. Kleinschmitt for LW diagnostics
-                     toplwad_aerop, sollwad_aerop,&
-                     toplwai_aerop, sollwai_aerop, &
-                     toplwad0_aerop, sollwad0_aerop,&
-                                !-end
-                     ZLWFT0_i, ZFLDN0, ZFLUP0, &
-                     ZSWFT0_i, ZFSDN0, ZFSUP0, &
-                     cloud_cover_sw)
-          ENDIF !ok_4xCO2atm
-
-! A.I aout 2023
-! Effet 3D des nuages Ecrad
-! a passer : nom du ficher namelist et cles ok_3Deffect
-! a declarer comme iflag_rrtm et a lire dans physiq.def
+                  (debut, dist, rmu0, fract, &
+                  !albedo SB >>>
+                  !      paprs, pplay,zxtsol,albsol1, albsol2,  &
+                  paprs, pplay, zxtsol, SFRWL, albsol_dir, albsol_dif, &
+                  !albedo SB <<<
+                  t_seri, q_seri, wo, &
+                  cldfrarad, cldemirad, cldtaurad, &
+                  ok_ade.OR.flag_aerosol_strat>0, ok_aie, ok_volcan, flag_volc_surfstrat, &
+                  flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
+                  tau_aero, piz_aero, cg_aero, &
+                  tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &
+                  ! Rajoute par OB pour RRTM
+                  tau_aero_lw_rrtm, &
+                  cldtaupi, m_allaer, &
+                  !                    zqsat, flwcrad, fiwcrad, &
+                  zqsat, flwc, fiwc, &
+                  ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
+                  namelist_ecrad_file, &
+                  heatp, heat0p, coolp, cool0p, albplap, &
+                  heat_volc, cool_volc, &
+                  topswp, toplwp, solswp, solswfdiffp, sollwp, &
+                  sollwdownp, &
+                  topsw0p, toplw0p, solsw0p, sollw0p, &
+                  lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp, &
+                  swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp, &
+                  topswad_aerop, solswad_aerop, &
+                  topswai_aerop, solswai_aerop, &
+                  topswad0_aerop, solswad0_aerop, &
+                  topsw_aerop, topsw0_aerop, &
+                  solsw_aerop, solsw0_aerop, &
+                  topswcf_aerop, solswcf_aerop, &
+                  !-C. Kleinschmitt for LW diagnostics
+                  toplwad_aerop, sollwad_aerop, &
+                  toplwai_aerop, sollwai_aerop, &
+                  toplwad0_aerop, sollwad0_aerop, &
+                  !-end
+                  ZLWFT0_i, ZFLDN0, ZFLUP0, &
+                  ZSWFT0_i, ZFSDN0, ZFSUP0, &
+                  cloud_cover_sw)
+        ENDIF !ok_4xCO2atm
+
+        ! A.I aout 2023
+        ! Effet 3D des nuages Ecrad
+        ! a passer : nom du ficher namelist et cles ok_3Deffect
+        ! a declarer comme iflag_rrtm et a lire dans physiq.def
 #ifdef CPP_ECRAD
           IF (ok_3Deffect) then
-!                print*,'ok_3Deffect = ',ok_3Deffect  
+!                print*,'ok_3Deffect = ',ok_3Deffect
                 namelist_ecrad_file='namelist_ecrad_s2'
                 CALL radlwsw &
@@ -4672,5 +4616,5 @@
                      ref_liq, ref_ice, ref_liq_pi, ref_ice_pi, &
                      namelist_ecrad_file, &
-! A modifier              
+! A modifier
                      heat_s2,heat0_s2,cool_s2,cool0_s2,albpla_s2, &
                      heat_volc,cool_volc, &
@@ -4697,249 +4641,243 @@
 #endif
 
-       ENDIF ! aerosol_couple
-       itaprad = 0
-       !
-       !  If Iflag_radia >=2, reset pertubed variables
-       !
-       IF (iflag_radia >= 2) THEN
-          zxtsol(:) = zsav_tsol (:)
-       ENDIF
+      ENDIF ! aerosol_couple
+      itaprad = 0
+
+      !  If Iflag_radia >=2, reset pertubed variables
+
+      IF (iflag_radia >= 2) THEN
+        zxtsol(:) = zsav_tsol (:)
+      ENDIF
     ENDIF ! MOD(itaprad,radpas)
     itaprad = itaprad + 1
 
     IF (iflag_radia==0) THEN
-       IF (prt_level>=9) THEN
-          PRINT *,'--------------------------------------------------'
-          PRINT *,'>>>> ATTENTION rayonnement desactive pour ce cas'
-          PRINT *,'>>>>           heat et cool mis a zero '
-          PRINT *,'--------------------------------------------------'
-       ENDIF
-       heat=0.
-       cool=0.
-       sollw=0.   ! MPL 01032011
-       solsw=0.
-       radsol=0.
-       swup=0.    ! MPL 27102011 pour les fichiers AMMA_profiles et AMMA_scalars
-       swup0=0.
-       lwup=0.
-       lwup0=0.
-       lwdn=0.
-       lwdn0=0.
+      IF (prt_level>=9) THEN
+        PRINT *, '--------------------------------------------------'
+        PRINT *, '>>>> ATTENTION rayonnement desactive pour ce cas'
+        PRINT *, '>>>>           heat et cool mis a zero '
+        PRINT *, '--------------------------------------------------'
+      ENDIF
+      heat = 0.
+      cool = 0.
+      sollw = 0.   ! MPL 01032011
+      solsw = 0.
+      radsol = 0.
+      swup = 0.    ! MPL 27102011 pour les fichiers AMMA_profiles et AMMA_scalars
+      swup0 = 0.
+      lwup = 0.
+      lwup0 = 0.
+      lwdn = 0.
+      lwdn0 = 0.
     ENDIF
 
-    !
     ! Calculer radsol a l'exterieur de radlwsw
     ! pour prendre en compte le cycle diurne
     ! recode par Olivier Boucher en sept 2015
-    !
-    radsol=solsw*swradcorr+sollw
+
+    radsol = solsw * swradcorr + sollw
 
     IF (ok_4xCO2atm) THEN
-       radsolp=solswp*swradcorr+sollwp
+      radsolp = solswp * swradcorr + sollwp
     ENDIF
 
-    !
     ! Ajouter la tendance des rayonnements (tous les pas)
     ! avec une correction pour le cycle diurne dans le SW
-    !
-
-    DO k=1, klev
-       d_t_swr(:,k)=swradcorr(:)*heat(:,k)*phys_tstep/RDAY
-       d_t_sw0(:,k)=swradcorr(:)*heat0(:,k)*phys_tstep/RDAY
-       d_t_lwr(:,k)=-cool(:,k)*phys_tstep/RDAY
-       d_t_lw0(:,k)=-cool0(:,k)*phys_tstep/RDAY
+
+    DO k = 1, klev
+      d_t_swr(:, k) = swradcorr(:) * heat(:, k) * phys_tstep / RDAY
+      d_t_sw0(:, k) = swradcorr(:) * heat0(:, k) * phys_tstep / RDAY
+      d_t_lwr(:, k) = -cool(:, k) * phys_tstep / RDAY
+      d_t_lw0(:, k) = -cool0(:, k) * phys_tstep / RDAY
     ENDDO
 
-    CALL add_phys_tend(du0,dv0,d_t_swr,dq0,dql0,dqi0,dqbs0,paprs,'SW',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('SW',itap)
-    CALL add_phys_tend(du0,dv0,d_t_lwr,dq0,dql0,dqi0,dqbs0,paprs,'LW',abortphy,flag_inhib_tend,itap,0)
-    CALL prt_enerbil('LW',itap)
-
-    !
+    CALL add_phys_tend(du0, dv0, d_t_swr, dq0, dql0, dqi0, dqbs0, paprs, 'SW', abortphy, flag_inhib_tend, itap, 0)
+    CALL prt_enerbil('SW', itap)
+    CALL add_phys_tend(du0, dv0, d_t_lwr, dq0, dql0, dqi0, dqbs0, paprs, 'LW', abortphy, flag_inhib_tend, itap, 0)
+    CALL prt_enerbil('LW', itap)
+
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
     ! Calculer l'hydrologie de la surface
-    !
+
     !      CALL hydrol(dtime,pctsrf,rain_fall, snow_fall, zxevap,
     !     .            agesno, ftsol,fqsurf,fsnow, ruis)
-    !
-
-    !
+
     ! Calculer le bilan du sol et la derive de temperature (couplage)
-    !
+
     DO i = 1, klon
-       !         bils(i) = radsol(i) - sens(i) - evap(i)*RLVTT
-       ! a la demande de JLD
-       bils(i) = radsol(i) - sens(i) + zxfluxlat(i)
+      !         bils(i) = radsol(i) - sens(i) - evap(i)*RLVTT
+      ! a la demande de JLD
+      bils(i) = radsol(i) - sens(i) + zxfluxlat(i)
     ENDDO
-    !
+
     !moddeblott(jan95)
     ! Appeler le programme de parametrisation de l'orographie
     ! a l'echelle sous-maille:
-    !
+
     IF (prt_level >=10) THEN
-       print *,' call orography ? ', ok_orodr
+      print *, ' call orography ? ', ok_orodr
     ENDIF
-    !
+
     IF (ok_orodr) THEN
-       !
-       !  selection des points pour lesquels le shema est actif:
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the drag on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
-          ! zpmm_orodr_t and zstd_orodr_t are activation thresholds set by F. Lott to
-          ! earn computation time but they are not physical.
-          IF (((zpic(i)-zmea(i))>zpmm_orodr_t).AND.(zstd(i)>zstd_orodr_t).AND.(zrel_oro(i)<=zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-          ENDIF
-       ENDDO
-       !        igwdim=MAX(1,igwd)
-       !
-       IF (ok_strato) THEN
-
-          CALL drag_noro_strato(0,klon,klev,phys_tstep,paprs,pplay, &
-               zmea,zstd, zsig, zgam, zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrdr, zvstrdr, &
-               d_t_oro, d_u_oro, d_v_oro)
-
-       ELSE
-          CALL drag_noro(klon,klev,phys_tstep,paprs,pplay, &
-               zmea,zstd, zsig, zgam, zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrdr, zvstrdr, &
-               d_t_oro, d_u_oro, d_v_oro)
-       ENDIF
-       !
-       !  ajout des tendances
-       !-----------------------------------------------------------------------
-       ! ajout des tendances de la trainee de l'orographie
-       CALL add_phys_tend(d_u_oro,d_v_oro,d_t_oro,dq0,dql0,dqi0,dqbs0,paprs,'oro', &
-            abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('oro',itap)
-       !----------------------------------------------------------------------
-       !
+
+      !  selection des points pour lesquels le shema est actif:
+      igwd = 0
+      DO i = 1, klon
+        itest(i) = 0
+        zrel_oro(i) = zstd(i) / (max(zsig(i), 1.E-8) * sqrt(cell_area(i)))
+        !zrel_oro: relative mountain height wrt relief explained by mean slope
+        ! -> condition on zrel_oro can deactivate the drag on tilted planar terrains
+        !    such as ice sheets (work by V. Wiener)
+        ! zpmm_orodr_t and zstd_orodr_t are activation thresholds set by F. Lott to
+        ! earn computation time but they are not physical.
+        IF (((zpic(i) - zmea(i))>zpmm_orodr_t).AND.(zstd(i)>zstd_orodr_t).AND.(zrel_oro(i)<=zrel_oro_t)) THEN
+          itest(i) = 1
+          igwd = igwd + 1
+          idx(igwd) = i
+        ENDIF
+      ENDDO
+      !        igwdim=MAX(1,igwd)
+
+      IF (ok_strato) THEN
+
+        CALL drag_noro_strato(0, klon, klev, phys_tstep, paprs, pplay, &
+                zmea, zstd, zsig, zgam, zthe, zpic, zval, &
+                igwd, idx, itest, &
+                t_seri, u_seri, v_seri, &
+                zulow, zvlow, zustrdr, zvstrdr, &
+                d_t_oro, d_u_oro, d_v_oro)
+
+      ELSE
+        CALL drag_noro(klon, klev, phys_tstep, paprs, pplay, &
+                zmea, zstd, zsig, zgam, zthe, zpic, zval, &
+                igwd, idx, itest, &
+                t_seri, u_seri, v_seri, &
+                zulow, zvlow, zustrdr, zvstrdr, &
+                d_t_oro, d_u_oro, d_v_oro)
+      ENDIF
+
+      !  ajout des tendances
+      !-----------------------------------------------------------------------
+      ! ajout des tendances de la trainee de l'orographie
+      CALL add_phys_tend(d_u_oro, d_v_oro, d_t_oro, dq0, dql0, dqi0, dqbs0, paprs, 'oro', &
+              abortphy, flag_inhib_tend, itap, 0)
+      CALL prt_enerbil('oro', itap)
+      !----------------------------------------------------------------------
+
     ENDIF ! fin de test sur ok_orodr
-    !
+
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
     IF (ok_orolf) THEN
-       !
-       !  selection des points pour lesquels le shema est actif:
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-          !zrel_oro: relative mountain height wrt relief explained by mean slope
-          ! -> condition on zrel_oro can deactivate the lifting on tilted planar terrains
-          !    such as ice sheets (work by V. Wiener)
-          zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
-          IF (((zpic(i)-zmea(i))>zpmm_orolf_t).AND.(zrel_oro(i)<=zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-          ENDIF
-       ENDDO
-       !        igwdim=MAX(1,igwd)
-       !
-       IF (ok_strato) THEN
-
-          CALL lift_noro_strato(klon,klev,phys_tstep,paprs,pplay, &
-               latitude_deg,zmea,zstd,zpic,zgam,zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrli, zvstrli, &
-               d_t_lif, d_u_lif, d_v_lif               )
-
-       ELSE
-          CALL lift_noro(klon,klev,phys_tstep,paprs,pplay, &
-               latitude_deg,zmea,zstd,zpic, &
-               itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrli, zvstrli, &
-               d_t_lif, d_u_lif, d_v_lif)
-       ENDIF
-
-       ! ajout des tendances de la portance de l'orographie
-       CALL add_phys_tend(d_u_lif, d_v_lif, d_t_lif, dq0, dql0, dqi0, dqbs0,paprs, &
-            'lif', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('lif',itap)
+
+      !  selection des points pour lesquels le shema est actif:
+      igwd = 0
+      DO i = 1, klon
+        itest(i) = 0
+        !zrel_oro: relative mountain height wrt relief explained by mean slope
+        ! -> condition on zrel_oro can deactivate the lifting on tilted planar terrains
+        !    such as ice sheets (work by V. Wiener)
+        zrel_oro(i) = zstd(i) / (max(zsig(i), 1.E-8) * sqrt(cell_area(i)))
+        IF (((zpic(i) - zmea(i))>zpmm_orolf_t).AND.(zrel_oro(i)<=zrel_oro_t)) THEN
+          itest(i) = 1
+          igwd = igwd + 1
+          idx(igwd) = i
+        ENDIF
+      ENDDO
+      !        igwdim=MAX(1,igwd)
+
+      IF (ok_strato) THEN
+
+        CALL lift_noro_strato(klon, klev, phys_tstep, paprs, pplay, &
+                latitude_deg, zmea, zstd, zpic, zgam, zthe, zpic, zval, &
+                igwd, idx, itest, &
+                t_seri, u_seri, v_seri, &
+                zulow, zvlow, zustrli, zvstrli, &
+                d_t_lif, d_u_lif, d_v_lif)
+
+      ELSE
+        CALL lift_noro(klon, klev, phys_tstep, paprs, pplay, &
+                latitude_deg, zmea, zstd, zpic, &
+                itest, &
+                t_seri, u_seri, v_seri, &
+                zulow, zvlow, zustrli, zvstrli, &
+                d_t_lif, d_u_lif, d_v_lif)
+      ENDIF
+
+      ! ajout des tendances de la portance de l'orographie
+      CALL add_phys_tend(d_u_lif, d_v_lif, d_t_lif, dq0, dql0, dqi0, dqbs0, paprs, &
+              'lif', abortphy, flag_inhib_tend, itap, 0)
+      CALL prt_enerbil('lif', itap)
     ENDIF ! fin de test sur ok_orolf
 
     IF (ok_hines) then
-       !  HINES GWD PARAMETRIZATION
-       east_gwstress=0.
-       west_gwstress=0.
-       du_gwd_hines=0.
-       dv_gwd_hines=0.
-       CALL hines_gwd(klon, klev, phys_tstep, paprs, pplay, latitude_deg, t_seri, &
-            u_seri, v_seri, zustr_gwd_hines, zvstr_gwd_hines, d_t_hin, &
-            du_gwd_hines, dv_gwd_hines)
-       zustr_gwd_hines=0.
-       zvstr_gwd_hines=0.
-       DO k = 1, klev
-          zustr_gwd_hines(:)=zustr_gwd_hines(:)+ du_gwd_hines(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-          zvstr_gwd_hines(:)=zvstr_gwd_hines(:)+ dv_gwd_hines(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-       ENDDO
-
-       d_t_hin(:, :)=0.
-       CALL add_phys_tend(du_gwd_hines, dv_gwd_hines, d_t_hin, dq0, dql0, &
-            dqi0, dqbs0, paprs, 'hin', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('hin',itap)
+      !  HINES GWD PARAMETRIZATION
+      east_gwstress = 0.
+      west_gwstress = 0.
+      du_gwd_hines = 0.
+      dv_gwd_hines = 0.
+      CALL hines_gwd(klon, klev, phys_tstep, paprs, pplay, latitude_deg, t_seri, &
+              u_seri, v_seri, zustr_gwd_hines, zvstr_gwd_hines, d_t_hin, &
+              du_gwd_hines, dv_gwd_hines)
+      zustr_gwd_hines = 0.
+      zvstr_gwd_hines = 0.
+      DO k = 1, klev
+        zustr_gwd_hines(:) = zustr_gwd_hines(:) + du_gwd_hines(:, k) / phys_tstep &
+                * (paprs(:, k) - paprs(:, k + 1)) / rg
+        zvstr_gwd_hines(:) = zvstr_gwd_hines(:) + dv_gwd_hines(:, k) / phys_tstep &
+                * (paprs(:, k) - paprs(:, k + 1)) / rg
+      ENDDO
+
+      d_t_hin(:, :) = 0.
+      CALL add_phys_tend(du_gwd_hines, dv_gwd_hines, d_t_hin, dq0, dql0, &
+              dqi0, dqbs0, paprs, 'hin', abortphy, flag_inhib_tend, itap, 0)
+      CALL prt_enerbil('hin', itap)
     ENDIF
 
     IF (.not. ok_hines .and. ok_gwd_rando) then
-       ! ym missing init for east_gwstress & west_gwstress -> added in phys_local_var_mod
-       CALL acama_GWD_rando(PHYS_TSTEP, pplay, latitude_deg, t_seri, u_seri, &
-            v_seri, rot, zustr_gwd_front, zvstr_gwd_front, du_gwd_front, &
-            dv_gwd_front, east_gwstress, west_gwstress)
-       zustr_gwd_front=0.
-       zvstr_gwd_front=0.
-       DO k = 1, klev
-          zustr_gwd_front(:)=zustr_gwd_front(:)+ du_gwd_front(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-          zvstr_gwd_front(:)=zvstr_gwd_front(:)+ dv_gwd_front(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-       ENDDO
-
-       CALL add_phys_tend(du_gwd_front, dv_gwd_front, dt0, dq0, dql0, dqi0, dqbs0, &
-            paprs, 'front_gwd_rando', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('front_gwd_rando',itap)
+      ! ym missing init for east_gwstress & west_gwstress -> added in phys_local_var_mod
+      CALL acama_GWD_rando(PHYS_TSTEP, pplay, latitude_deg, t_seri, u_seri, &
+              v_seri, rot, zustr_gwd_front, zvstr_gwd_front, du_gwd_front, &
+              dv_gwd_front, east_gwstress, west_gwstress)
+      zustr_gwd_front = 0.
+      zvstr_gwd_front = 0.
+      DO k = 1, klev
+        zustr_gwd_front(:) = zustr_gwd_front(:) + du_gwd_front(:, k) / phys_tstep &
+                * (paprs(:, k) - paprs(:, k + 1)) / rg
+        zvstr_gwd_front(:) = zvstr_gwd_front(:) + dv_gwd_front(:, k) / phys_tstep &
+                * (paprs(:, k) - paprs(:, k + 1)) / rg
+      ENDDO
+
+      CALL add_phys_tend(du_gwd_front, dv_gwd_front, dt0, dq0, dql0, dqi0, dqbs0, &
+              paprs, 'front_gwd_rando', abortphy, flag_inhib_tend, itap, 0)
+      CALL prt_enerbil('front_gwd_rando', itap)
     ENDIF
 
     IF (ok_gwd_rando) THEN
-       CALL FLOTT_GWD_rando(PHYS_TSTEP, pplay, t_seri, u_seri, v_seri, &
-            rain_fall + snow_fall, zustr_gwd_rando, zvstr_gwd_rando, &
-            du_gwd_rando, dv_gwd_rando, east_gwstress, west_gwstress)
-       CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0, dqi0, dqbs0, &
-            paprs, 'flott_gwd_rando', abortphy,flag_inhib_tend,itap,0)
-       CALL prt_enerbil('flott_gwd_rando',itap)
-       zustr_gwd_rando=0.
-       zvstr_gwd_rando=0.
-       DO k = 1, klev
-          zustr_gwd_rando(:)=zustr_gwd_rando(:)+ du_gwd_rando(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-          zvstr_gwd_rando(:)=zvstr_gwd_rando(:)+ dv_gwd_rando(:, k)/phys_tstep &
-               * (paprs(:, k)-paprs(:, k+1))/rg
-       ENDDO
+      CALL FLOTT_GWD_rando(PHYS_TSTEP, pplay, t_seri, u_seri, v_seri, &
+              rain_fall + snow_fall, zustr_gwd_rando, zvstr_gwd_rando, &
+              du_gwd_rando, dv_gwd_rando, east_gwstress, west_gwstress)
+      CALL add_phys_tend(du_gwd_rando, dv_gwd_rando, dt0, dq0, dql0, dqi0, dqbs0, &
+              paprs, 'flott_gwd_rando', abortphy, flag_inhib_tend, itap, 0)
+      CALL prt_enerbil('flott_gwd_rando', itap)
+      zustr_gwd_rando = 0.
+      zvstr_gwd_rando = 0.
+      DO k = 1, klev
+        zustr_gwd_rando(:) = zustr_gwd_rando(:) + du_gwd_rando(:, k) / phys_tstep &
+                * (paprs(:, k) - paprs(:, k + 1)) / rg
+        zvstr_gwd_rando(:) = zvstr_gwd_rando(:) + dv_gwd_rando(:, k) / phys_tstep &
+                * (paprs(:, k) - paprs(:, k + 1)) / rg
+      ENDDO
     ENDIF
 
@@ -4947,201 +4885,196 @@
 
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
     DO i = 1, klon
-       zustrph(i)=0.
-       zvstrph(i)=0.
+      zustrph(i) = 0.
+      zvstrph(i) = 0.
     ENDDO
     DO k = 1, klev
-       DO i = 1, klon
-          zustrph(i)=zustrph(i)+(u_seri(i,k)-u(i,k))/phys_tstep* &
-               (paprs(i,k)-paprs(i,k+1))/rg
-          zvstrph(i)=zvstrph(i)+(v_seri(i,k)-v(i,k))/phys_tstep* &
-               (paprs(i,k)-paprs(i,k+1))/rg
-       ENDDO
+      DO i = 1, klon
+        zustrph(i) = zustrph(i) + (u_seri(i, k) - u(i, k)) / phys_tstep * &
+                (paprs(i, k) - paprs(i, k + 1)) / rg
+        zvstrph(i) = zvstrph(i) + (v_seri(i, k) - v(i, k)) / phys_tstep * &
+                (paprs(i, k) - paprs(i, k + 1)) / rg
+      ENDDO
     ENDDO
-    !
+
     !IM calcul composantes axiales du moment angulaire et couple des montagnes
-    !
-    IF (is_sequential .and. ok_orodr) THEN 
-       CALL aaam_bud (27,klon,klev,jD_cur-jD_ref,jH_cur, &
-            ra,rg,romega, &
-            latitude_deg,longitude_deg,pphis, &
-            zustrdr,zustrli,zustrph, &
-            zvstrdr,zvstrli,zvstrph, &
-            paprs,u,v, &
-            aam, torsfc)
+
+    IF (is_sequential .and. ok_orodr) THEN
+      CALL aaam_bud (27, klon, klev, jD_cur - jD_ref, jH_cur, &
+              ra, rg, romega, &
+              latitude_deg, longitude_deg, pphis, &
+              zustrdr, zustrli, zustrph, &
+              zvstrdr, zvstrli, zvstrph, &
+              paprs, u, v, &
+              aam, torsfc)
     ENDIF
     !IM cf. FLott END
     !DC Calcul de la tendance due au methane
     IF (ok_qch4) THEN
-!      d_q_ch4: H2O source from CH4 in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
-IF (CPPKEY_STRATAER) THEN
-       CALL stratH2O_methox(debut,paprs,d_q_ch4)
-ELSE
-!      ECMWF routine METHOX
-       CALL METHOX(1,klon,klon,klev,q_seri,d_q_ch4,pplay)
-END IF
-       ! add humidity tendency due to methane
-       d_q_ch4_dtime(:,:) = d_q_ch4(:,:)*phys_tstep
-       CALL add_phys_tend(du0, dv0, dt0, d_q_ch4_dtime, dql0, dqi0, dqbs0, paprs, &
-            'q_ch4', abortphy,flag_inhib_tend,itap,0)
-       d_q_ch4(:,:) = d_q_ch4_dtime(:,:)/phys_tstep ! update with H2O conserv done in add_phys_tend
+      !      d_q_ch4: H2O source from CH4 in MMR/s (mass mixing ratio/s or kg H2O/kg air/s)
+      IF (CPPKEY_STRATAER) THEN
+        CALL stratH2O_methox(debut, paprs, d_q_ch4)
+      ELSE
+        !      ECMWF routine METHOX
+        CALL METHOX(1, klon, klon, klev, q_seri, d_q_ch4, pplay)
+      END IF
+      ! add humidity tendency due to methane
+      d_q_ch4_dtime(:, :) = d_q_ch4(:, :) * phys_tstep
+      CALL add_phys_tend(du0, dv0, dt0, d_q_ch4_dtime, dql0, dqi0, dqbs0, paprs, &
+              'q_ch4', abortphy, flag_inhib_tend, itap, 0)
+      d_q_ch4(:, :) = d_q_ch4_dtime(:, :) / phys_tstep ! update with H2O conserv done in add_phys_tend
     ENDIF
-    !
-    !
-IF (CPPKEY_STRATAER) THEN
-    IF (ok_qemiss) THEN
-       flh2o=1
-       IF(flag_verbose_strataer) THEN
-          print *,'IN physiq_mod: ok_qemiss =yes (',ok_qemiss,'), flh2o=',flh2o
-          print *,'IN physiq_mod: flag_emit=',flag_emit,', nErupt=',nErupt
-          print *,'IN physiq_mod: nAerErupt=',nAerErupt
-       ENDIF
-       
-       SELECT CASE(flag_emit)
-       CASE(1) ! emission volc H2O in LMDZ
-          DO ieru=1, nErupt
-             IF (year_cur==year_emit_vol(ieru).AND.&
-                  mth_cur==mth_emit_vol(ieru).AND.&
-                  day_cur>=day_emit_vol(ieru).AND.&
-                  day_cur<(day_emit_vol(ieru)+injdur)) THEN
-                
-                IF(flag_verbose_strataer) print *,'IN physiq_mod: date=',year_cur,mth_cur,day_cur
-                ! initialisation of q tendency emission
-                d_q_emiss(:,:)=0.
-                ! daily injection mass emission - NL
-                m_H2O_emiss_vol_daily = m_H2O_emiss_vol(ieru)/(REAL(injdur)&
-                     *REAL(ponde_lonlat_vol(ieru)))
-                !
-                CALL STRATEMIT(pdtphys,pdtphys,latitude_deg,longitude_deg,t_seri,&
-                    pplay,paprs,tr_seri,&
-                    m_H2O_emiss_vol_daily,&
-                    xlat_min_vol(ieru),xlat_max_vol(ieru),&
-                    xlon_min_vol(ieru),xlon_max_vol(ieru),&
-                    altemiss_vol(ieru),sigma_alt_vol(ieru),1,1.,&
-                    nAerErupt+1,0)
-                
-                IF(flag_verbose_strataer) print *,'IN physiq_mod: min max d_q_emiss=',&
-                     minval(d_q_emiss),maxval(d_q_emiss)
-                
-                CALL add_phys_tend(du0, dv0, dt0, d_q_emiss, dql0, dqi0, dqbs0, paprs, &
-                     'q_emiss',abortphy,flag_inhib_tend,itap,0)
-                IF (abortphy==1) Print*,'ERROR ABORT TEND EMISS'
-             ENDIF
+
+
+    IF (CPPKEY_STRATAER) THEN
+      IF (ok_qemiss) THEN
+        flh2o = 1
+        IF(flag_verbose_strataer) THEN
+          print *, 'IN physiq_mod: ok_qemiss =yes (', ok_qemiss, '), flh2o=', flh2o
+          print *, 'IN physiq_mod: flag_emit=', flag_emit, ', nErupt=', nErupt
+          print *, 'IN physiq_mod: nAerErupt=', nAerErupt
+        ENDIF
+
+        SELECT CASE(flag_emit)
+        CASE(1) ! emission volc H2O in LMDZ
+          DO ieru = 1, nErupt
+            IF (year_cur==year_emit_vol(ieru).AND.&
+                    mth_cur==mth_emit_vol(ieru).AND.&
+                    day_cur>=day_emit_vol(ieru).AND.&
+                    day_cur<(day_emit_vol(ieru) + injdur)) THEN
+
+              IF(flag_verbose_strataer) print *, 'IN physiq_mod: date=', year_cur, mth_cur, day_cur
+              ! initialisation of q tendency emission
+              d_q_emiss(:, :) = 0.
+              ! daily injection mass emission - NL
+              m_H2O_emiss_vol_daily = m_H2O_emiss_vol(ieru) / (REAL(injdur)&
+                      * REAL(ponde_lonlat_vol(ieru)))
+
+              CALL STRATEMIT(pdtphys, pdtphys, latitude_deg, longitude_deg, t_seri, &
+                      pplay, paprs, tr_seri, &
+                      m_H2O_emiss_vol_daily, &
+                      xlat_min_vol(ieru), xlat_max_vol(ieru), &
+                      xlon_min_vol(ieru), xlon_max_vol(ieru), &
+                      altemiss_vol(ieru), sigma_alt_vol(ieru), 1, 1., &
+                      nAerErupt + 1, 0)
+
+              IF(flag_verbose_strataer) print *, 'IN physiq_mod: min max d_q_emiss=', &
+                      minval(d_q_emiss), maxval(d_q_emiss)
+
+              CALL add_phys_tend(du0, dv0, dt0, d_q_emiss, dql0, dqi0, dqbs0, paprs, &
+                      'q_emiss', abortphy, flag_inhib_tend, itap, 0)
+              IF (abortphy==1) Print*, 'ERROR ABORT TEND EMISS'
+            ENDIF
           ENDDO
-          flh2o=0
-       END SELECT ! emission scenario (flag_emit)
+          flh2o = 0
+        END SELECT ! emission scenario (flag_emit)
+      ENDIF
+    END IF
+
+    !===============================================================
+    !            Additional tendency of TKE due to orography
+    !===============================================================
+
+    ! Inititialization
+    !------------------
+
+    addtkeoro = 0
+    CALL getin_p('addtkeoro', addtkeoro)
+
+    IF (prt_level>=5) &
+            print*, 'addtkeoro', addtkeoro
+
+    alphatkeoro = 1.
+    CALL getin_p('alphatkeoro', alphatkeoro)
+    alphatkeoro = min(max(0., alphatkeoro), 1.)
+
+    smallscales_tkeoro = .FALSE.
+    CALL getin_p('smallscales_tkeoro', smallscales_tkeoro)
+
+    dtadd(:, :) = 0.
+    duadd(:, :) = 0.
+    dvadd(:, :) = 0.
+
+    ! Choices for addtkeoro:
+    !      ** 0 no TKE tendency from orography
+    !      ** 1 we include a fraction alphatkeoro of the whole tendency duoro
+    !      ** 2 we include a fraction alphatkeoro of the gravity wave part of duoro
+
+    IF (addtkeoro > 0 .AND. ok_orodr) THEN
+      !      -------------------------------------------
+
+
+      !  selection des points pour lesquels le schema est actif:
+
+      IF (addtkeoro == 1) THEN
+
+        duadd(:, :) = alphatkeoro * d_u_oro(:, :)
+        dvadd(:, :) = alphatkeoro * d_v_oro(:, :)
+
+      ELSE IF (addtkeoro == 2) THEN
+
+        IF (smallscales_tkeoro) THEN
+          igwd = 0
+          DO i = 1, klon
+            itest(i) = 0
+            ! Etienne: ici je prends en compte plus de relief que la routine drag_noro_strato
+            ! car on peut s'attendre a ce que les petites echelles produisent aussi de la TKE
+            ! Mais attention, cela ne va pas dans le sens de la conservation de l'energie!
+            IF ((zstd(i)>1.0) .AND.(zrel_oro(i)<=zrel_oro_t)) THEN
+              itest(i) = 1
+              igwd = igwd + 1
+              idx(igwd) = i
+            ENDIF
+          ENDDO
+
+        ELSE
+
+          igwd = 0
+          DO i = 1, klon
+            itest(i) = 0
+            IF (((zpic(i) - zmea(i))>zpmm_orodr_t).AND.(zstd(i)>zstd_orodr_t).AND.(zrel_oro(i)<=zrel_oro_t)) THEN
+              itest(i) = 1
+              igwd = igwd + 1
+              idx(igwd) = i
+            ENDIF
+          ENDDO
+
+        ENDIF
+
+        CALL drag_noro_strato(addtkeoro, klon, klev, phys_tstep, paprs, pplay, &
+                zmea, zstd, zsig, zgam, zthe, zpic, zval, &
+                igwd, idx, itest, &
+                t_seri, u_seri, v_seri, &
+                zulow, zvlow, zustrdr, zvstrdr, &
+                d_t_oro_gw, d_u_oro_gw, d_v_oro_gw)
+
+        zustrdr(:) = 0.
+        zvstrdr(:) = 0.
+        zulow(:) = 0.
+        zvlow(:) = 0.
+
+        duadd(:, :) = alphatkeoro * d_u_oro_gw(:, :)
+        dvadd(:, :) = alphatkeoro * d_v_oro_gw(:, :)
+      ENDIF
+
+
+      ! TKE update from subgrid temperature and wind tendencies
+      !----------------------------------------------------------
+      forall (k = 1:nbp_lev) exner(:, k) = (pplay(:, k) / paprs(:, 1))**RKAPPA
+
+      CALL tend_to_tke(pdtphys, paprs, exner, t_seri, u_seri, v_seri, dtadd, duadd, dvadd, pctsrf, pbl_tke)
+
+      ! Prevent pbl_tke_w from becoming negative
+      wake_delta_pbl_tke(:, :, :) = max(wake_delta_pbl_tke(:, :, :), -pbl_tke(:, :, :))
+
     ENDIF
-END IF
-
-!===============================================================
-!            Additional tendency of TKE due to orography
-!===============================================================
-!
-! Inititialization
-!------------------
-
-       addtkeoro=0   
-       CALL getin_p('addtkeoro',addtkeoro) 
-      
-       IF (prt_level>=5) &
-            print*,'addtkeoro', addtkeoro
-            
-       alphatkeoro=1.   
-       CALL getin_p('alphatkeoro',alphatkeoro)
-       alphatkeoro=min(max(0.,alphatkeoro),1.)
-
-       smallscales_tkeoro=.FALSE.   
-       CALL getin_p('smallscales_tkeoro',smallscales_tkeoro) 
-
-
-       dtadd(:,:)=0.
-       duadd(:,:)=0.
-       dvadd(:,:)=0.
-
-! Choices for addtkeoro:
-!      ** 0 no TKE tendency from orography    
-!      ** 1 we include a fraction alphatkeoro of the whole tendency duoro
-!      ** 2 we include a fraction alphatkeoro of the gravity wave part of duoro
-!
-
-       IF (addtkeoro > 0 .AND. ok_orodr ) THEN
-!      -------------------------------------------
-
-
-       !  selection des points pour lesquels le schema est actif:
-
-
-  IF (addtkeoro == 1 ) THEN
-
-            duadd(:,:)=alphatkeoro*d_u_oro(:,:)
-            dvadd(:,:)=alphatkeoro*d_v_oro(:,:)
-
-  ELSE IF (addtkeoro == 2) THEN
-
-     IF (smallscales_tkeoro) THEN
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-! Etienne: ici je prends en compte plus de relief que la routine drag_noro_strato
-! car on peut s'attendre a ce que les petites echelles produisent aussi de la TKE
-! Mais attention, cela ne va pas dans le sens de la conservation de l'energie! 
-          IF ((zstd(i)>1.0) .AND.(zrel_oro(i)<=zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-          ENDIF
-       ENDDO
-
-     ELSE 
-
-       igwd=0
-       DO i=1,klon
-          itest(i)=0
-        IF (((zpic(i)-zmea(i))>zpmm_orodr_t).AND.(zstd(i)>zstd_orodr_t).AND.(zrel_oro(i)<=zrel_oro_t)) THEN
-             itest(i)=1
-             igwd=igwd+1
-             idx(igwd)=i
-        ENDIF
-       ENDDO
-
-     ENDIF
-
-     CALL drag_noro_strato(addtkeoro,klon,klev,phys_tstep,paprs,pplay, &
-               zmea,zstd, zsig, zgam, zthe,zpic,zval, &
-               igwd,idx,itest, &
-               t_seri, u_seri, v_seri, &
-               zulow, zvlow, zustrdr, zvstrdr, &
-               d_t_oro_gw, d_u_oro_gw, d_v_oro_gw)
-
-     zustrdr(:)=0.
-     zvstrdr(:)=0.
-     zulow(:)=0.
-     zvlow(:)=0.
-
-     duadd(:,:)=alphatkeoro*d_u_oro_gw(:,:)
-     dvadd(:,:)=alphatkeoro*d_v_oro_gw(:,:)
-  ENDIF
-
-
-   ! TKE update from subgrid temperature and wind tendencies
-   !----------------------------------------------------------
-    forall (k=1: nbp_lev) exner(:, k) = (pplay(:, k)/paprs(:,1))**RKAPPA
-
-
-    CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke)
-   !
-   ! Prevent pbl_tke_w from becoming negative
-    wake_delta_pbl_tke(:,:,:) = max(wake_delta_pbl_tke(:,:,:), -pbl_tke(:,:,:))
-   !
-
-       ENDIF
-!      -----
-!===============================================================
+    !      -----
+    !===============================================================
 
 
@@ -5152,5 +5085,5 @@
 
     IF (ok_cosp) THEN
-       ! adeclarer 
+      ! adeclarer
 #ifdef CPP_COSP
        IF (itap.eq.1.or.MOD(itap,NINT(freq_cosp/phys_tstep)).EQ.0) THEN
@@ -5241,23 +5174,23 @@
 
 
-! Marine
-
-  IF (ok_airs) then
-
-  IF (itap==1.or.MOD(itap,NINT(freq_airs/phys_tstep))==0) THEN
-     write(*,*) 'je vais appeler simu_airs, ok_airs, freq_airs=', ok_airs, freq_airs
-     CALL simu_airs(itap,rneb, t_seri, cldemi, fiwc, ref_ice, pphi, pplay, paprs,&
-   map_prop_hc,map_prop_hist,&
-   map_emis_hc,map_iwp_hc,map_deltaz_hc,map_pcld_hc,map_tcld_hc,&
-   map_emis_Cb,map_pcld_Cb,map_tcld_Cb,&
-   map_emis_ThCi,map_pcld_ThCi,map_tcld_ThCi,&
-   map_emis_Anv,map_pcld_Anv,map_tcld_Anv,&
-   map_emis_hist,map_iwp_hist,map_deltaz_hist,map_rad_hist,&
-   map_ntot,map_hc,map_hist,&
-   map_Cb,map_ThCi,map_Anv,&
-   alt_tropo )
-  ENDIF
-
-  ENDIF  ! ok_airs
+    ! Marine
+
+    IF (ok_airs) then
+
+      IF (itap==1.or.MOD(itap, NINT(freq_airs / phys_tstep))==0) THEN
+        write(*, *) 'je vais appeler simu_airs, ok_airs, freq_airs=', ok_airs, freq_airs
+        CALL simu_airs(itap, rneb, t_seri, cldemi, fiwc, ref_ice, pphi, pplay, paprs, &
+                map_prop_hc, map_prop_hist, &
+                map_emis_hc, map_iwp_hc, map_deltaz_hc, map_pcld_hc, map_tcld_hc, &
+                map_emis_Cb, map_pcld_Cb, map_tcld_Cb, &
+                map_emis_ThCi, map_pcld_ThCi, map_tcld_ThCi, &
+                map_emis_Anv, map_pcld_Anv, map_tcld_Anv, &
+                map_emis_hist, map_iwp_hist, map_deltaz_hist, map_rad_hist, &
+                map_ntot, map_hc, map_hist, &
+                map_Cb, map_ThCi, map_Anv, &
+                alt_tropo)
+      ENDIF
+
+    ENDIF  ! ok_airs
 
 
@@ -5269,10 +5202,9 @@
     !   Calcul  des tendances traceurs
     !====================================================================
-    !
 
     IF (type_trac == 'repr') THEN
-!MM pas d'impact, car on recupere q_seri,tr_seri,t_seri via phys_local_var_mod
-!MM                               dans Reprobus
-       sh_in(:,:) = q_seri(:,:)
+      !MM pas d'impact, car on recupere q_seri,tr_seri,t_seri via phys_local_var_mod
+      !MM                               dans Reprobus
+      sh_in(:, :) = q_seri(:, :)
 #ifdef REPROBUS
        d_q_rep(:,:) = 0.
@@ -5281,55 +5213,55 @@
 #endif
     ELSE
-       sh_in(:,:) = qx(:,:,ivap)
-       IF (nqo >= 3) THEN 
-          ch_in(:,:) = qx(:,:,iliq) + qx(:,:,isol)
-       ELSE 
-          ch_in(:,:) = qx(:,:,iliq)
-       ENDIF
+      sh_in(:, :) = qx(:, :, ivap)
+      IF (nqo >= 3) THEN
+        ch_in(:, :) = qx(:, :, iliq) + qx(:, :, isol)
+      ELSE
+        ch_in(:, :) = qx(:, :, iliq)
+      ENDIF
     ENDIF
 
-#ifdef CPP_Dust
-    !  Avec SPLA, iflag_phytrac est forcé =1 
-    CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
-                      pdtphys,ftsol,                                   &  ! I
-                      t,q_seri,paprs,pplay,RHcl,                  &  ! I
-                      pmfu, pmfd, pen_u, pde_u, pen_d, pde_d,          &  ! I
-                      coefh(1:klon,1:klev,is_ave), cdragh, cdragm, u1, v1,                 &  ! I
-                      u_seri, v_seri, latitude_deg, longitude_deg,  &
-                      pphis,pctsrf,pmflxr,pmflxs,prfl,psfl,            &  ! I
-                      da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,     &  ! I
-                      epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,      &  ! I
-                      ev,wdtrainA,  wdtrainM,wght_cvfd,              &  ! I
-                      fm_therm, entr_therm, rneb,                      &  ! I
-                      beta_prec_fisrt,beta_prec, & !I
-                      zu10m,zv10m,wstar,ale_bl,ale_wake,               &  ! I
-                      d_tr_dyn,tr_seri)
-
-#else
-    IF (iflag_phytrac == 1 ) THEN
-      CALL phytrac ( &
-         itap,     days_elapsed+1,    jH_cur,   debut, &
-         lafin,    phys_tstep,     u, v,     t, &
-         paprs,    pplay,     pmfu,     pmfd, &
-         pen_u,    pde_u,     pen_d,    pde_d, &
-         cdragh,   coefh(1:klon,1:klev,is_ave),   fm_therm, entr_therm, &
-         u1,       v1,        ftsol,    pctsrf, &
-         zustar,   zu10m,     zv10m, &
-         wstar(:,is_ave),    ale_bl,         ale_wake, &
-         latitude_deg, longitude_deg, &
-         frac_impa,frac_nucl, beta_prec_fisrt,beta_prec, &
-         presnivs, pphis,     pphi,     albsol1, &
-         sh_in,   ch_in,    rhcl,      cldfra,   rneb, &
-         diafra,   radocond,    itop_con, ibas_con, &
-         pmflxr,   pmflxs,    prfl,     psfl, &
-         da,       phi,       mp,       upwd, &
-         phi2,     d1a,       dam,      sij, wght_cvfd, &        !<<RomP+RL
-         wdtrainA, wdtrainM,  sigd,     clw,elij, &   !<<RomP
-         ev,       ep,        epmlmMm,  eplaMm, &     !<<RomP
-         dnwd,     aerosol_couple,      flxmass_w, &
-         tau_aero, piz_aero,  cg_aero,  ccm, &
-         rfname, &
-         d_tr_dyn, &                                 !<<RomP
-         tr_seri, init_source)
+    IF (CPPKEY_DUST) THEN
+      !  Avec SPLA, iflag_phytrac est forcé =1
+      CALL       phytracr_spl (debut, lafin, jD_cur, jH_cur, iflag_con, &  ! I
+              pdtphys, ftsol, &  ! I
+              t, q_seri, paprs, pplay, RHcl, &  ! I
+              pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &  ! I
+              coefh(1:klon, 1:klev, is_ave), cdragh, cdragm, u1, v1, &  ! I
+              u_seri, v_seri, latitude_deg, longitude_deg, &
+              pphis, pctsrf, pmflxr, pmflxs, prfl, psfl, &  ! I
+              da, phi, phi2, d1a, dam, mp, ep, sigd, sij, clw, elij, &  ! I
+              epmlmMm, eplaMm, upwd, dnwd, itop_con, ibas_con, &  ! I
+              ev, wdtrainA, wdtrainM, wght_cvfd, &  ! I
+              fm_therm, entr_therm, rneb, &  ! I
+              beta_prec_fisrt, beta_prec, & !I
+              zu10m, zv10m, wstar, ale_bl, ale_wake, &  ! I
+              d_tr_dyn, tr_seri)
+
+    ELSE
+      IF (iflag_phytrac == 1) THEN
+        CALL phytrac (&
+                itap, days_elapsed + 1, jH_cur, debut, &
+                lafin, phys_tstep, u, v, t, &
+                paprs, pplay, pmfu, pmfd, &
+                pen_u, pde_u, pen_d, pde_d, &
+                cdragh, coefh(1:klon, 1:klev, is_ave), fm_therm, entr_therm, &
+                u1, v1, ftsol, pctsrf, &
+                zustar, zu10m, zv10m, &
+                wstar(:, is_ave), ale_bl, ale_wake, &
+                latitude_deg, longitude_deg, &
+                frac_impa, frac_nucl, beta_prec_fisrt, beta_prec, &
+                presnivs, pphis, pphi, albsol1, &
+                sh_in, ch_in, rhcl, cldfra, rneb, &
+                diafra, radocond, itop_con, ibas_con, &
+                pmflxr, pmflxs, prfl, psfl, &
+                da, phi, mp, upwd, &
+                phi2, d1a, dam, sij, wght_cvfd, &        !<<RomP+RL
+                wdtrainA, wdtrainM, sigd, clw, elij, &   !<<RomP
+                ev, ep, epmlmMm, eplaMm, &     !<<RomP
+                dnwd, aerosol_couple, flxmass_w, &
+                tau_aero, piz_aero, cg_aero, ccm, &
+                rfname, &
+                d_tr_dyn, &                                 !<<RomP
+                tr_seri, init_source)
 #ifdef REPROBUS
 
@@ -5345,42 +5277,39 @@
 
 #endif
-    ENDIF    ! (iflag_phytrac=1)
-
-#endif
+      ENDIF    ! (iflag_phytrac=1)
+
+    END IF
     !ENDIF    ! (iflag_phytrac=1)
 
     IF (offline) THEN
 
-       IF (prt_level>=9) &
-            print*,'Attention on met a 0 les thermiques pour phystoke'
-       CALL phystokenc ( &
-            nlon,klev,pdtphys,longitude_deg,latitude_deg, &
-            t,pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
-            fm_therm,entr_therm, &
-            cdragh,coefh(1:klon,1:klev,is_ave),u1,v1,ftsol,pctsrf, &
-            frac_impa, frac_nucl, &
-            pphis,cell_area,phys_tstep,itap, &
-            qx(:,:,ivap),da,phi,mp,upwd,dnwd)
-
+      IF (prt_level>=9) &
+              print*, 'Attention on met a 0 les thermiques pour phystoke'
+      CALL phystokenc (&
+              nlon, klev, pdtphys, longitude_deg, latitude_deg, &
+              t, pmfu, pmfd, pen_u, pde_u, pen_d, pde_d, &
+              fm_therm, entr_therm, &
+              cdragh, coefh(1:klon, 1:klev, is_ave), u1, v1, ftsol, pctsrf, &
+              frac_impa, frac_nucl, &
+              pphis, cell_area, phys_tstep, itap, &
+              qx(:, :, ivap), da, phi, mp, upwd, dnwd)
 
     ENDIF
 
-    !
     ! Calculer le transport de l'eau et de l'energie (diagnostique)
-    !
-    CALL transp (paprs,zxtsol, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, &
-                 ue, ve, uq, vq, uwat, vwat)
-    !
+
+    CALL transp (paprs, zxtsol, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, &
+            ue, ve, uq, vq, uwat, vwat)
+
     !IM global posePB BEG
     IF(1==0) THEN
-       !
-       CALL transp_lay (paprs,zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, &
-            ve_lay, vq_lay, ue_lay, uq_lay)
-       !
+
+      CALL transp_lay (paprs, zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, &
+              ve_lay, vq_lay, ue_lay, uq_lay)
+
     ENDIF !(1.EQ.0) THEN
     !IM global posePB END
-    !
+
     ! Accumuler les variables a stocker dans les fichiers histoire:
-    !
 
     !================================================================
@@ -5389,10 +5318,10 @@
     !================================================================
 
-    d_t_ec(:,:)=0.
-    forall (k=1: nbp_lev) exner(:, k) = (pplay(:, k)/paprs(:,1))**RKAPPA
-    CALL ener_conserv(klon,klev,pdtphys,u,v,t,qx,ivap,iliq,isol, &
-         u_seri,v_seri,t_seri,q_seri,ql_seri,qs_seri,pbl_tke(:,:,is_ave)-tke0(:,:), &
-         zmasse,exner,d_t_ec)
-    t_seri(:,:)=t_seri(:,:)+d_t_ec(:,:)
+    d_t_ec(:, :) = 0.
+    forall (k = 1:nbp_lev) exner(:, k) = (pplay(:, k) / paprs(:, 1))**RKAPPA
+    CALL ener_conserv(klon, klev, pdtphys, u, v, t, qx, ivap, iliq, isol, &
+            u_seri, v_seri, t_seri, q_seri, ql_seri, qs_seri, pbl_tke(:, :, is_ave) - tke0(:, :), &
+            zmasse, exner, d_t_ec)
+    t_seri(:, :) = t_seri(:, :) + d_t_ec(:, :)
 
     !==================================================================
@@ -5402,51 +5331,51 @@
     !==================================================================
     IF (ok_water_mass_fixer) THEN
-    qql2(:)=0.0
-    DO k = 1, klev
-      qql2(:)=qql2(:)+(q_seri(:,k)+ql_seri(:,k))*zmasse(:,k)
-      IF (nqo >= 3) THEN
-        qql2(:)=qql2(:)+qs_seri(:,k)*zmasse(:,k)
-      ENDIF
-      IF (ok_bs) THEN
-        qql2(:)=qql2(:)+qbs_seri(:,k)*zmasse(:,k)
-      ENDIF
-    ENDDO
-
-IF (CPPKEY_STRATAER) THEN
-    IF (ok_qemiss) THEN
-       DO k = 1, klev
-          qql1(:) = qql1(:)+d_q_emiss(:,k)*zmasse(:,k)
-       ENDDO
-    ENDIF
-END IF
-    IF (ok_qch4) THEN
-       DO k = 1, klev
-          qql1(:) = qql1(:)+d_q_ch4_dtime(:,k)*zmasse(:,k)
-       ENDDO
-    ENDIF
-    
-    DO i = 1, klon
-      !--compute ratio of what q+ql should be with conservation to what it is
-      IF (ok_bs) THEN
-        corrqql=(qql1(i)+(evap(i)-rain_fall(i)-snow_fall(i)-bs_fall(i))*pdtphys)/qql2(i)
-      ELSE
-        corrqql=(qql1(i)+(evap(i)-rain_fall(i)-snow_fall(i))*pdtphys)/qql2(i)
-      ENDIF
+      qql2(:) = 0.0
       DO k = 1, klev
-        q_seri(i,k) =q_seri(i,k)*corrqql
-        ql_seri(i,k)=ql_seri(i,k)*corrqql
+        qql2(:) = qql2(:) + (q_seri(:, k) + ql_seri(:, k)) * zmasse(:, k)
         IF (nqo >= 3) THEN
-          qs_seri(i,k)=qs_seri(i,k)*corrqql
+          qql2(:) = qql2(:) + qs_seri(:, k) * zmasse(:, k)
         ENDIF
         IF (ok_bs) THEN
-          qbs_seri(i,k)=qbs_seri(i,k)*corrqql
+          qql2(:) = qql2(:) + qbs_seri(:, k) * zmasse(:, k)
         ENDIF
       ENDDO
-    ENDDO
+
+      IF (CPPKEY_STRATAER) THEN
+        IF (ok_qemiss) THEN
+          DO k = 1, klev
+            qql1(:) = qql1(:) + d_q_emiss(:, k) * zmasse(:, k)
+          ENDDO
+        ENDIF
+      END IF
+      IF (ok_qch4) THEN
+        DO k = 1, klev
+          qql1(:) = qql1(:) + d_q_ch4_dtime(:, k) * zmasse(:, k)
+        ENDDO
+      ENDIF
+
+      DO i = 1, klon
+        !--compute ratio of what q+ql should be with conservation to what it is
+        IF (ok_bs) THEN
+          corrqql = (qql1(i) + (evap(i) - rain_fall(i) - snow_fall(i) - bs_fall(i)) * pdtphys) / qql2(i)
+        ELSE
+          corrqql = (qql1(i) + (evap(i) - rain_fall(i) - snow_fall(i)) * pdtphys) / qql2(i)
+        ENDIF
+        DO k = 1, klev
+          q_seri(i, k) = q_seri(i, k) * corrqql
+          ql_seri(i, k) = ql_seri(i, k) * corrqql
+          IF (nqo >= 3) THEN
+            qs_seri(i, k) = qs_seri(i, k) * corrqql
+          ENDIF
+          IF (ok_bs) THEN
+            qbs_seri(i, k) = qbs_seri(i, k) * corrqql
+          ENDIF
+        ENDDO
+      ENDDO
     ENDIF
     !--fin mass fixer
 
     !cc prw  = eau precipitable
-    !   prlw = colonne eau liquide 
+    !   prlw = colonne eau liquide
     !   prlw = colonne eau solide
     !   prbsw = colonne neige soufflee
@@ -5459,19 +5388,19 @@
     water_budget(:) = 0.0
     DO k = 1, klev
-       prw(:)  = prw(:)  + q_seri(:,k)*zmasse(:,k)
-       prlw(:) = prlw(:) + ql_seri(:,k)*zmasse(:,k)
-       water_budget(:) = water_budget(:) + (q_seri(:,k)-qx(:,k,ivap)+ql_seri(:,k)-qx(:,k,iliq))*zmasse(:,k)
-       IF (nqo >= 3) THEN
-         prsw(:) = prsw(:) + qs_seri(:,k)*zmasse(:,k)
-         water_budget(:) = water_budget(:) + (qs_seri(:,k)-qx(:,k,isol))*zmasse(:,k)
-       ENDIF
-       IF (nqo >= 4 .AND. ok_bs) THEN
-         prbsw(:)= prbsw(:) + qbs_seri(:,k)*zmasse(:,k)
-         water_budget(:) = water_budget(:) + (qbs_seri(:,k)-qx(:,k,ibs))*zmasse(:,k)
-       ENDIF
+      prw(:) = prw(:) + q_seri(:, k) * zmasse(:, k)
+      prlw(:) = prlw(:) + ql_seri(:, k) * zmasse(:, k)
+      water_budget(:) = water_budget(:) + (q_seri(:, k) - qx(:, k, ivap) + ql_seri(:, k) - qx(:, k, iliq)) * zmasse(:, k)
+      IF (nqo >= 3) THEN
+        prsw(:) = prsw(:) + qs_seri(:, k) * zmasse(:, k)
+        water_budget(:) = water_budget(:) + (qs_seri(:, k) - qx(:, k, isol)) * zmasse(:, k)
+      ENDIF
+      IF (nqo >= 4 .AND. ok_bs) THEN
+        prbsw(:) = prbsw(:) + qbs_seri(:, k) * zmasse(:, k)
+        water_budget(:) = water_budget(:) + (qbs_seri(:, k) - qx(:, k, ibs)) * zmasse(:, k)
+      ENDIF
     ENDDO
-    water_budget(:)=water_budget(:)+(rain_fall(:)+snow_fall(:)-evap(:))*pdtphys
+    water_budget(:) = water_budget(:) + (rain_fall(:) + snow_fall(:) - evap(:)) * pdtphys
     IF (ok_bs) THEN
-      water_budget(:)=water_budget(:)+bs_fall(:)*pdtphys
+      water_budget(:) = water_budget(:) + bs_fall(:) * pdtphys
     ENDIF
 
@@ -5479,40 +5408,40 @@
     !   SORTIES
     !=======================================================================
-    !
+
     !IM initialisation + calculs divers diag AMIP2
-    !
+
     include "calcul_divers.h"
-    !
+
     !IM Interpolation sur les niveaux de pression du NMC
     !   -------------------------------------------------
-    !
+
     include "calcul_STDlev.h"
-    !
+
     ! slp sea level pressure derived from Arpege-IFS : CALL ctstar + CALL pppmer
-    CALL diag_slp(klon,t_seri,paprs,pplay,pphis,ptstar,pt0,slp)
-    !
-    !
-    IF (ANY(type_trac == ['inca','inco'])) THEN
-IF (CPPKEY_INCA) THEN
-       CALL VTe(VTphysiq)
-       CALL VTb(VTinca)
-
-       CALL chemhook_end ( &
-            phys_tstep, &
-            pplay, &
-            t_seri, &
-            tr_seri(:,:,1+nqCO2:nbtr), &
-            nbtr, &
-            paprs, &
-            q_seri, &
-            cell_area, &
-            pphi, &
-            pphis, &
-            zx_rh, &
-            aps, bps, ap, bp, lafin)
-
-       CALL VTe(VTinca)
-       CALL VTb(VTphysiq)
-END IF
+    CALL diag_slp(klon, t_seri, paprs, pplay, pphis, ptstar, pt0, slp)
+
+
+    IF (ANY(type_trac == ['inca', 'inco'])) THEN
+      IF (CPPKEY_INCA) THEN
+        CALL VTe(VTphysiq)
+        CALL VTb(VTinca)
+
+        CALL chemhook_end (&
+                phys_tstep, &
+                pplay, &
+                t_seri, &
+                tr_seri(:, :, 1 + nqCO2:nbtr), &
+                nbtr, &
+                paprs, &
+                q_seri, &
+                cell_area, &
+                pphi, &
+                pphis, &
+                zx_rh, &
+                aps, bps, ap, bp, lafin)
+
+        CALL VTe(VTinca)
+        CALL VTb(VTphysiq)
+      END IF
     ENDIF
 
@@ -5523,73 +5452,72 @@
     ENDIF
 
-    !
     ! Convertir les incrementations en tendances
-    !
+
     IF (prt_level >=10) THEN
-       print *,'Convertir les incrementations en tendances '
+      print *, 'Convertir les incrementations en tendances '
     ENDIF
-    !
+
     IF (mydebug) THEN
-       CALL writefield_phy('u_seri',u_seri,nbp_lev)
-       CALL writefield_phy('v_seri',v_seri,nbp_lev)
-       CALL writefield_phy('t_seri',t_seri,nbp_lev)
-       CALL writefield_phy('q_seri',q_seri,nbp_lev)
+      CALL writefield_phy('u_seri', u_seri, nbp_lev)
+      CALL writefield_phy('v_seri', v_seri, nbp_lev)
+      CALL writefield_phy('t_seri', t_seri, nbp_lev)
+      CALL writefield_phy('q_seri', q_seri, nbp_lev)
     ENDIF
 
     DO k = 1, klev
-       DO i = 1, klon
-          d_u(i,k) = ( u_seri(i,k) - u(i,k) ) / phys_tstep
-          d_v(i,k) = ( v_seri(i,k) - v(i,k) ) / phys_tstep
-          d_t(i,k) = ( t_seri(i,k)-t(i,k) ) / phys_tstep
-          d_qx(i,k,ivap) = ( q_seri(i,k) - qx(i,k,ivap) ) / phys_tstep
-          d_qx(i,k,iliq) = ( ql_seri(i,k) - qx(i,k,iliq) ) / phys_tstep
-          !CR: on ajoute le contenu en glace
-          IF (nqo >= 3) THEN
-             d_qx(i,k,isol) = ( qs_seri(i,k) - qx(i,k,isol) ) / phys_tstep
-          ENDIF
-          !--ice_sursat: nqo=4, on ajoute rneb
-          IF (nqo>=4 .and. ok_ice_sursat) THEN
-             d_qx(i,k,irneb) = ( rneb_seri(i,k) - qx(i,k,irneb) ) / phys_tstep
-          ENDIF
-
-           IF (nqo>=4 .and. ok_bs) THEN
-             d_qx(i,k,ibs) = ( qbs_seri(i,k) - qx(i,k,ibs) ) / phys_tstep
-          ENDIF
-
-       ENDDO
+      DO i = 1, klon
+        d_u(i, k) = (u_seri(i, k) - u(i, k)) / phys_tstep
+        d_v(i, k) = (v_seri(i, k) - v(i, k)) / phys_tstep
+        d_t(i, k) = (t_seri(i, k) - t(i, k)) / phys_tstep
+        d_qx(i, k, ivap) = (q_seri(i, k) - qx(i, k, ivap)) / phys_tstep
+        d_qx(i, k, iliq) = (ql_seri(i, k) - qx(i, k, iliq)) / phys_tstep
+        !CR: on ajoute le contenu en glace
+        IF (nqo >= 3) THEN
+          d_qx(i, k, isol) = (qs_seri(i, k) - qx(i, k, isol)) / phys_tstep
+        ENDIF
+        !--ice_sursat: nqo=4, on ajoute rneb
+        IF (nqo>=4 .and. ok_ice_sursat) THEN
+          d_qx(i, k, irneb) = (rneb_seri(i, k) - qx(i, k, irneb)) / phys_tstep
+        ENDIF
+
+        IF (nqo>=4 .and. ok_bs) THEN
+          d_qx(i, k, ibs) = (qbs_seri(i, k) - qx(i, k, ibs)) / phys_tstep
+        ENDIF
+
+      ENDDO
     ENDDO
-    !
+
     ! DC: All iterations are cycled if nqtot==nqo, so no nqtot>nqo condition required
     itr = 0
     DO iq = 1, nqtot
-       IF(.NOT.tracers(iq)%isInPhysics) CYCLE
-       itr = itr+1
-       DO  k = 1, klev
-          DO  i = 1, klon
-             d_qx(i,k,iq) = ( tr_seri(i,k,itr) - qx(i,k,iq) ) / phys_tstep
-          ENDDO
-       ENDDO
+      IF(.NOT.tracers(iq)%isInPhysics) CYCLE
+      itr = itr + 1
+      DO  k = 1, klev
+        DO  i = 1, klon
+          d_qx(i, k, iq) = (tr_seri(i, k, itr) - qx(i, k, iq)) / phys_tstep
+        ENDDO
+      ENDDO
     ENDDO
-    !
+
     !IM rajout diagnostiques bilan KP pour analyse MJO par Jun-Ichi Yano
     !IM global posePB      include "write_bilKP_ins.h"
     !IM global posePB      include "write_bilKP_ave.h"
-    !
+
     ! Sauvegarder les valeurs de t et q a la fin de la physique:
-    !
-    u_ancien(:,:)  = u_seri(:,:)
-    v_ancien(:,:)  = v_seri(:,:)
-    t_ancien(:,:)  = t_seri(:,:)
-    q_ancien(:,:)  = q_seri(:,:)
-    ql_ancien(:,:) = ql_seri(:,:)
-    qs_ancien(:,:) = qs_seri(:,:)
-    qbs_ancien(:,:) = qbs_seri(:,:)
-    rneb_ancien(:,:) = rneb_seri(:,:)
-    CALL water_int(klon,klev,q_ancien,zmasse,prw_ancien)
-    CALL water_int(klon,klev,ql_ancien,zmasse,prlw_ancien)
-    CALL water_int(klon,klev,qs_ancien,zmasse,prsw_ancien)
-    CALL water_int(klon,klev,qbs_ancien,zmasse,prbsw_ancien)
+
+    u_ancien(:, :) = u_seri(:, :)
+    v_ancien(:, :) = v_seri(:, :)
+    t_ancien(:, :) = t_seri(:, :)
+    q_ancien(:, :) = q_seri(:, :)
+    ql_ancien(:, :) = ql_seri(:, :)
+    qs_ancien(:, :) = qs_seri(:, :)
+    qbs_ancien(:, :) = qbs_seri(:, :)
+    rneb_ancien(:, :) = rneb_seri(:, :)
+    CALL water_int(klon, klev, q_ancien, zmasse, prw_ancien)
+    CALL water_int(klon, klev, ql_ancien, zmasse, prlw_ancien)
+    CALL water_int(klon, klev, qs_ancien, zmasse, prsw_ancien)
+    CALL water_int(klon, klev, qbs_ancien, zmasse, prbsw_ancien)
     ! !! RomP >>>
-    IF (nqtot > nqo) tr_ancien(:,:,:) = tr_seri(:,:,:)
+    IF (nqtot > nqo) tr_ancien(:, :, :) = tr_seri(:, :, :)
     ! !! RomP <<<
     !==========================================================================
@@ -5601,41 +5529,41 @@
 
     IF (prt_level>=1) THEN
-       write(lunout,*) 'FIN DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
-       write(lunout,*) &
-            'nlon,klev,nqtot,debut,lafin,jD_cur, jH_cur, pdtphys pct tlos'
-       write(lunout,*) &
-            nlon,klev,nqtot,debut,lafin, jD_cur, jH_cur ,pdtphys, &
-            pctsrf(igout,is_ter), pctsrf(igout,is_lic),pctsrf(igout,is_oce), &
-            pctsrf(igout,is_sic)
-       write(lunout,*) 'd_t_dyn,d_t_con,d_t_lsc,d_t_ajsb,d_t_ajs,d_t_eva'
-       DO k=1,klev
-          write(lunout,*) d_t_dyn(igout,k),d_t_con(igout,k), &
-               d_t_lsc(igout,k),d_t_ajsb(igout,k),d_t_ajs(igout,k), &
-               d_t_eva(igout,k)
-       ENDDO
-       write(lunout,*) 'cool,heat'
-       DO k=1,klev
-          write(lunout,*) cool(igout,k),heat(igout,k)
-       ENDDO
-
-       !jyg<     (En attendant de statuer sur le sort de d_t_oli)
-       !jyg!     write(lunout,*) 'd_t_oli,d_t_vdf,d_t_oro,d_t_lif,d_t_ec'
-       !jyg!     do k=1,klev
-       !jyg!        write(lunout,*) d_t_oli(igout,k),d_t_vdf(igout,k), &
-       !jyg!             d_t_oro(igout,k),d_t_lif(igout,k),d_t_ec(igout,k)
-       !jyg!     enddo
-       write(lunout,*) 'd_t_vdf,d_t_oro,d_t_lif,d_t_ec'
-       DO k=1,klev
-          write(lunout,*) d_t_vdf(igout,k), &
-               d_t_oro(igout,k),d_t_lif(igout,k),d_t_ec(igout,k)
-       ENDDO
-       !>jyg
-
-       write(lunout,*) 'd_ps ',d_ps(igout)
-       write(lunout,*) 'd_u, d_v, d_t, d_qx1, d_qx2 '
-       DO k=1,klev
-          write(lunout,*) d_u(igout,k),d_v(igout,k),d_t(igout,k), &
-               d_qx(igout,k,1),d_qx(igout,k,2)
-       ENDDO
+      write(lunout, *) 'FIN DE PHYSIQ !!!!!!!!!!!!!!!!!!!!'
+      write(lunout, *) &
+              'nlon,klev,nqtot,debut,lafin,jD_cur, jH_cur, pdtphys pct tlos'
+      write(lunout, *) &
+              nlon, klev, nqtot, debut, lafin, jD_cur, jH_cur, pdtphys, &
+              pctsrf(igout, is_ter), pctsrf(igout, is_lic), pctsrf(igout, is_oce), &
+              pctsrf(igout, is_sic)
+      write(lunout, *) 'd_t_dyn,d_t_con,d_t_lsc,d_t_ajsb,d_t_ajs,d_t_eva'
+      DO k = 1, klev
+        write(lunout, *) d_t_dyn(igout, k), d_t_con(igout, k), &
+                d_t_lsc(igout, k), d_t_ajsb(igout, k), d_t_ajs(igout, k), &
+                d_t_eva(igout, k)
+      ENDDO
+      write(lunout, *) 'cool,heat'
+      DO k = 1, klev
+        write(lunout, *) cool(igout, k), heat(igout, k)
+      ENDDO
+
+      !jyg<     (En attendant de statuer sur le sort de d_t_oli)
+      !jyg!     write(lunout,*) 'd_t_oli,d_t_vdf,d_t_oro,d_t_lif,d_t_ec'
+      !jyg!     do k=1,klev
+      !jyg!        write(lunout,*) d_t_oli(igout,k),d_t_vdf(igout,k), &
+      !jyg!             d_t_oro(igout,k),d_t_lif(igout,k),d_t_ec(igout,k)
+      !jyg!     enddo
+      write(lunout, *) 'd_t_vdf,d_t_oro,d_t_lif,d_t_ec'
+      DO k = 1, klev
+        write(lunout, *) d_t_vdf(igout, k), &
+                d_t_oro(igout, k), d_t_lif(igout, k), d_t_ec(igout, k)
+      ENDDO
+      !>jyg
+
+      write(lunout, *) 'd_ps ', d_ps(igout)
+      write(lunout, *) 'd_u, d_v, d_t, d_qx1, d_qx2 '
+      DO k = 1, klev
+        write(lunout, *) d_u(igout, k), d_v(igout, k), d_t(igout, k), &
+                d_qx(igout, k, 1), d_qx(igout, k, 2)
+      ENDDO
     ENDIF
 
@@ -5644,19 +5572,18 @@
     !============================================================
     DO k = 1, klev
-       DO i = 1, klon
-          !JYG/IM theta en debut du pas de temps
-          !JYG/IM       theta(i,k)=t(i,k)*(100000./pplay(i,k))**(RD/RCPD)
-          !JYG/IM theta en fin de pas de temps de physique
-          theta(i,k)=t_seri(i,k)*(100000./pplay(i,k))**(RD/RCPD)
-          ! thetal: 2 lignes suivantes a decommenter si vous avez les fichiers
-          !     MPL 20130625
-          ! fth_fonctions.F90 et parkind1.F90
-          ! sinon thetal=theta
-          !       thetal(i,k)=fth_thetal(pplay(i,k),t_seri(i,k),q_seri(i,k),
-          !    :         ql_seri(i,k))
-          thetal(i,k)=theta(i,k)
-       ENDDO
+      DO i = 1, klon
+        !JYG/IM theta en debut du pas de temps
+        !JYG/IM       theta(i,k)=t(i,k)*(100000./pplay(i,k))**(RD/RCPD)
+        !JYG/IM theta en fin de pas de temps de physique
+        theta(i, k) = t_seri(i, k) * (100000. / pplay(i, k))**(RD / RCPD)
+        ! thetal: 2 lignes suivantes a decommenter si vous avez les fichiers
+        !     MPL 20130625
+        ! fth_fonctions.F90 et parkind1.F90
+        ! sinon thetal=theta
+        !       thetal(i,k)=fth_thetal(pplay(i,k),t_seri(i,k),q_seri(i,k),
+        !    :         ql_seri(i,k))
+        thetal(i, k) = theta(i, k)
+      ENDDO
     ENDDO
-    !
 
     ! 22.03.04 BEG
@@ -5667,5 +5594,5 @@
 
     ! Recupere des varibles calcule dans differents modules
-    ! pour ecriture dans histxxx.nc 
+    ! pour ecriture dans histxxx.nc
 
     ! Get some variables from module fonte_neige_mod
@@ -5704,5 +5631,5 @@
     !On effectue les sorties:
 
-#ifdef CPP_Dust
+IF (CPPKEY_DUST) THEN
   CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,  &
        pplay, lmax_th, aerosol_couple,                 &
@@ -5711,12 +5638,12 @@
        ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
        flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#else
+ELSE
     CALL phys_output_write(itap, pdtphys, paprs, pphis,  &
          pplay, lmax_th, aerosol_couple,                 &
-         ok_ade, ok_aie, ok_volcan, ivap, iliq, isol, ibs,   & 
+         ok_ade, ok_aie, ok_volcan, ivap, iliq, isol, ibs,   &
          ok_sync, ptconv, read_climoz, clevSTD,          &
          ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
          flag_aerosol, flag_aerosol_strat, ok_cdnc,t, u1, v1)
-#endif
+END IF
 
     IF (.NOT. using_xios) THEN
@@ -5726,6 +5653,6 @@
 #endif
     ! Petit appelle de sorties pour accompagner le travail sur phyex
-    if ( iflag_physiq == 1 ) then
-        call output_physiqex(debut,jD_eq,pdtphys,presnivs,paprs,u,v,t,qx,cldfra,0.*t,0.*t,0.*t,pbl_tke,theta)
+    if (iflag_physiq == 1) then
+      call output_physiqex(debut, jD_eq, pdtphys, presnivs, paprs, u, v, t, qx, cldfra, 0. * t, 0. * t, 0. * t, pbl_tke, theta)
     endif
 
@@ -5736,51 +5663,49 @@
 
     IF (abortphy==1) THEN
-       abort_message ='Plantage hgardfou'
-       CALL abort_physic (modname,abort_message,1)
+      abort_message = 'Plantage hgardfou'
+      CALL abort_physic (modname, abort_message, 1)
     ENDIF
 
     ! 22.03.04 END
-    !
+
     !====================================================================
     ! Si c'est la fin, il faut conserver l'etat de redemarrage
     !====================================================================
-    !
 
     ! Disabling calls to the prt_alerte function
     alert_first_call = .FALSE.
 
-    
     IF (lafin) THEN
-       itau_phy = itau_phy + itap
-       CALL phyredem ("restartphy.nc")
-       !         open(97,form="unformatted",file="finbin")
-       !         write(97) u_seri,v_seri,t_seri,q_seri
-       !         close(97)
-      
-       IF (is_omp_master) THEN
-       
-         IF (read_climoz >= 1) THEN
-           IF (is_mpi_root) CALL nf95_close(ncid_climoz)
-            DEALLOCATE(press_edg_climoz)
-            DEALLOCATE(press_cen_climoz)
-         ENDIF
-       
-       ENDIF
-
-       IF (using_xios) THEN
-
-IF (CPPKEY_INCA) THEN
-          IF (type_trac == 'inca') THEN 
-             IF (is_omp_master .AND. grid_type==unstructured) THEN 
-                CALL finalize_inca
-             ENDIF
+      itau_phy = itau_phy + itap
+      CALL phyredem ("restartphy.nc")
+      !         open(97,form="unformatted",file="finbin")
+      !         write(97) u_seri,v_seri,t_seri,q_seri
+      !         close(97)
+
+      IF (is_omp_master) THEN
+
+        IF (read_climoz >= 1) THEN
+          IF (is_mpi_root) CALL nf95_close(ncid_climoz)
+          DEALLOCATE(press_edg_climoz)
+          DEALLOCATE(press_cen_climoz)
+        ENDIF
+
+      ENDIF
+
+      IF (using_xios) THEN
+
+        IF (CPPKEY_INCA) THEN
+          IF (type_trac == 'inca') THEN
+            IF (is_omp_master .AND. grid_type==unstructured) THEN
+              CALL finalize_inca
+            ENDIF
           ENDIF
-END IF
-
-          IF (is_omp_master .and. grid_type==unstructured) CALL xios_context_finalize
-       ENDIF
-
-       WRITE(lunout,*) ' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
-       
+        END IF
+
+        IF (is_omp_master .and. grid_type==unstructured) CALL xios_context_finalize
+      ENDIF
+
+      WRITE(lunout, *) ' physiq fin, nombre de steps ou cvpas = 1 : ', Ncvpaseq1
+
     ENDIF
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/physiqex_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/physiqex_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/physiqex_mod.F90	(revision 5099)
@@ -23,7 +23,6 @@
 
       IMPLICIT none
-!
+
 ! Routine argument:
-!
 
       integer,intent(in) :: nlon ! number of atmospheric colums
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phystokenc_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phystokenc_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phystokenc_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE phystokenc_mod
 
@@ -45,9 +45,9 @@
 ! Auteur(s) FH
 ! Objet: Ecriture des variables pour transport offline
-!
+
 !======================================================================
 
 ! Arguments:
-!
+
   REAL,DIMENSION(klon,klev), INTENT(IN)     :: psh   ! humidite specifique
   REAL,DIMENSION(klon,klev), INTENT(IN)     :: pda
@@ -59,8 +59,8 @@
 !   EN ENTREE:
 !   ==========
-!
+
 !   divers:
 !   -------
-!
+
   INTEGER nlon ! nombre de points horizontaux
   INTEGER nlev ! nombre de couches verticales
@@ -72,5 +72,5 @@
 !   convection:
 !   -----------
-!
+
   REAL pmfu(klon,klev)  ! flux de masse dans le panache montant
   REAL pmfd(klon,klev)  ! flux de masse dans le panache descendant
@@ -82,5 +82,5 @@
   REAL,ALLOCATABLE,SAVE :: t(:,:)
 !$OMP THREADPRIVATE(t)
-!
+
   REAL rlon(klon), rlat(klon), dtime
   REAL zx_tmp_3d(nbp_lon,nbp_lat,klev),zx_tmp_2d(nbp_lon,nbp_lat)
@@ -88,5 +88,5 @@
 !   Couche limite:
 !   --------------
-!
+
   REAL cdragh(klon)          ! cdrag
   REAL pcoefh(klon,klev)     ! coeff melange CL
@@ -104,17 +104,17 @@
 !$OMP THREADPRIVATE(entr_therm)
 !$OMP THREADPRIVATE(fm_therm)
-!
+
 !   Lessivage:
 !   ----------
-!
+
   REAL frac_impa(klon,klev)
   REAL frac_nucl(klon,klev)
-!
+
 ! Arguments necessaires pour les sources et puits de traceur
-!
+
   REAL ftsol(klon,nbsrf)  ! Temperature du sol (surf)(Kelvin)
   REAL pctsrf(klon,nbsrf) ! Pourcentage de sol f(nature du sol)
 !======================================================================
-!
+
   INTEGER i, k, kk
   REAL,ALLOCATABLE,SAVE :: mfu(:,:)  ! flux de masse dans le panache montant
@@ -148,5 +148,5 @@
   CHARACTER(len=12) :: nvar
   logical, parameter :: lstokenc=.FALSE.
-!
+
 !======================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phytrac_mod.F90	(revision 5099)
@@ -5,9 +5,9 @@
   ! Chemistry modules (INCA, Reprobus or the more specific traclmdz routine)
   ! are called from phytrac.
-  !
+
   !======================================================================
   ! Auteur(s) FH
   ! Objet: Moniteur general des tendances traceurs
-  !
+
   ! iflag_vdf_trac : Options for activating transport by vertical diffusion :
   !     1. notmal
@@ -20,5 +20,4 @@
   !=================================================================================
 
-  !
   ! Tracer tendencies, for outputs
   !-------------------------------
@@ -75,5 +74,5 @@
     !===============================================================================
     !    -- Do specific treatment according to chemestry model or local LMDZ tracers
-    !
+
     !===============================================================================
     !   -- CO2 interactif --
@@ -112,5 +111,5 @@
           d_tr_dyn, &   ! RomP
           tr_seri, init_source)
-    !
+
     !======================================================================
     ! Auteur(s) FH
@@ -170,5 +169,5 @@
     REAL, DIMENSION(klon), INTENT(IN) :: xlat    ! latitudes pour chaque point
     REAL, DIMENSION(klon), INTENT(IN) :: xlon    ! longitudes pour chaque point
-    !
+
     !Physique:
     !--------
@@ -188,18 +187,17 @@
     REAL, DIMENSION(klon, klev), INTENT(IN) :: diafra  ! fraction nuageuse (convection ou stratus artificiels)
     REAL, DIMENSION(klon, klev), INTENT(IN) :: rneb    ! fraction nuageuse (grande echelle)
-    !
+
     REAL :: ql_incl ! contenu en eau liquide nuageuse dans le nuage ! ql_incl=oliq/rneb
     REAL, DIMENSION(klon, klev), INTENT(IN) :: beta_fisrt ! taux de conversion de l'eau cond (de fisrtilp)
     REAL, DIMENSION(klon, klev), INTENT(out) :: beta_v1    ! -- (originale version)
 
-    !
     INTEGER, DIMENSION(klon), INTENT(IN) :: itop_con
     INTEGER, DIMENSION(klon), INTENT(IN) :: ibas_con
     REAL, DIMENSION(klon), INTENT(IN) :: albsol  ! albedo surface
-    !
+
     !Dynamique
     !--------
     REAL, DIMENSION(klon, klev, nbtr), INTENT(IN) :: d_tr_dyn
-    !
+
     !Convection:
     !----------
@@ -228,5 +226,5 @@
     REAL, DIMENSION(klon, klev), INTENT(IN) :: d1a, dam
     REAL, DIMENSION(klon, klev, klev), INTENT(IN) :: phi2
-    !
+
     REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainA
     REAL, DIMENSION(klon, klev), INTENT(IN) :: wdtrainM
@@ -242,17 +240,17 @@
     REAL, DIMENSION(klon, klev), INTENT(IN) :: clw
     ! RomP <<<
-    !
+
     REAL, DIMENSION(klon, klev), INTENT(IN) :: mp
     REAL, DIMENSION(klon, klev), INTENT(IN) :: upwd      ! saturated updraft mass flux
     REAL, DIMENSION(klon, klev), INTENT(IN) :: dnwd      ! saturated downdraft mass flux
-    !
+
     !Thermiques:
     !----------
     REAL, DIMENSION(klon, klev + 1), INTENT(IN) :: fm_therm
     REAL, DIMENSION(klon, klev), INTENT(INOUT) :: entr_therm
-    !
+
     !Couche limite:
     !--------------
-    !
+
     REAL, DIMENSION(:), INTENT(IN) :: cdragh          ! (klon) coeff drag pour T et Q
     REAL, DIMENSION(:, :), INTENT(IN) :: coefh           ! (klon,klev) coeff melange CL (m**2/s)
@@ -261,8 +259,8 @@
     REAL, DIMENSION(:), INTENT(IN) :: yu1             ! (klon) vents au premier niveau
     REAL, DIMENSION(:), INTENT(IN) :: yv1             ! (klon) vents au premier niveau
-    !
+
     !Lessivage:
     !----------
-    !
+
     REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ccntrAA
     REAL, DIMENSION(:), ALLOCATABLE, SAVE :: ccntrENV
@@ -273,7 +271,7 @@
     REAL, DIMENSION(klon, klev) :: ccntrENV_3d
     REAL, DIMENSION(klon, klev) :: coefcoli_3d
-    !
+
     ! pour le ON-LINE
-    !
+
     REAL, DIMENSION(klon, klev), INTENT(IN) :: frac_impa ! fraction d'aerosols non impactes
     REAL, DIMENSION(klon, klev), INTENT(IN) :: frac_nucl ! fraction d'aerosols non nuclees
@@ -299,9 +297,8 @@
     !Sources et Reservoirs de traceurs (ex:Radon):
     !--------------------------------------------
-    !
+
     REAL, DIMENSION(:, :), ALLOCATABLE, SAVE :: source  ! a voir lorsque le flux de surface est prescrit
     !$OMP THREADPRIVATE(source)
 
-    !
     !Entrees/Sorties:
     !---------------
@@ -314,5 +311,5 @@
     INTEGER :: itau_w      ! pas de temps ecriture = nstep + itau_phy
     LOGICAL, PARAMETER :: ok_sync = .TRUE.
-    !
+
     ! Nature du traceur
     !------------------
@@ -320,5 +317,5 @@
     !$OMP THREADPRIVATE(aerosol)                        ! aerosol(it) = false => gaz
     REAL, DIMENSION(klon, klev) :: delp     ! epaisseur de couche (Pa)
-    !
+
     ! Tendances de traceurs (Td) et flux de traceurs:
     !------------------------
@@ -421,10 +418,10 @@
       ! obsolete car remplace par des ecritures dans phys_output_write
       !RomP >>>
-      !
+
       !Config Key  = convscav
       !Config Desc = Convective scavenging switch: 0=off, 1=on.
       !Config Def  = .FALSE.
       !Config Help =
-      !
+
       !$OMP MASTER
       convscav_omp = .FALSE.
@@ -443,5 +440,5 @@
       iflag_the_trac = iflag_the_trac_omp
       write(lunout, *) 'phytrac passage dans routine conv avec lessivage', convscav
-      !
+
       !Config Key  = iflag_lscav
       !Config Desc = Large scale scavenging parametrization: 0=none, 1=old(Genthon92),
@@ -449,5 +446,5 @@
       !Config Def  = 1
       !Config Help =
-      !
+
       !$OMP MASTER
       iflag_lscav_omp = 1
@@ -465,5 +462,5 @@
       ccntrENV_in = ccntrENV_omp
       coefcoli_in = coefcoli_omp
-      !
+
       SELECT CASE(iflag_lscav)
       CASE(0)
@@ -517,14 +514,13 @@
       ENDIF
 
-      !
       !--initialising coefficients for scavenging in the case of NP
-      !
+
       ALLOCATE(flag_cvltr(nbtr))
       IF (iflag_con==3) THEN
-        !
+
         ALLOCATE(ccntrAA(nbtr))
         ALLOCATE(ccntrENV(nbtr))
         ALLOCATE(coefcoli(nbtr))
-        !
+
         DO it = 1, nbtr
           IF (type_trac == 'repr') THEN
@@ -534,5 +530,5 @@
             !                   !--gas-phase species
             !                   flag_cvltr(it)=.FALSE.
-            !
+
             !                ELSEIF ( (it.GE.id_CIDUSTM) .AND. (it.LE.id_AIN) ) THEN
             !                   !--insoluble aerosol species
@@ -579,11 +575,11 @@
           ENDIF
         ENDDO
-        !
+
       ELSE ! iflag_con .ne. 3
         flag_cvltr(:) = .FALSE.
       ENDIF
-      !
+
       ! print out all tracer flags
-      !
+
       WRITE(lunout, *) 'print out all tracer flags'
       WRITE(lunout, *) 'type_trac      =', type_trac
@@ -603,5 +599,5 @@
       IF (lessivage .AND. ANY(type_trac == ['inca', 'inco'])) &
               CALL abort_physic('phytrac', 'lessivage=T config_inca=inca impossible', 1)
-      !
+
     ENDIF ! of IF (debutphy)
     !############################################ END INITIALIZATION #######
@@ -612,5 +608,5 @@
       ENDDO
     ENDDO
-    !
+
     IF (id_be > 0) THEN
       DO k = 1, klev
@@ -623,5 +619,5 @@
     !===============================================================================
     !    -- Do specific treatment according to chemestry model or local LMDZ tracers
-    !
+
     !===============================================================================
     IF (type_trac == 'inca') THEN
@@ -686,6 +682,6 @@
           IF (flag_cvltr(it)) THEN
             !--nouveau transport convectif de Emanuel avec lessivage convectif
-            !
-            !
+
+
             ccntrAA_3d(:, :) = ccntrAA(it)
             ccntrENV_3d(:, :) = ccntrENV(it)
@@ -709,5 +705,5 @@
             !--beware this interface is a bit weird because it is called for each tracer
             !--with the full array tr_seri even if only item it is processed
-            !
+
             CALL cvltr_noscav(it, pdtphys, da, phi, mp, wght_cvfd, paprs, pplay, &  !jyg
                     tr_seri, upwd, dnwd, d_tr_cv)                                !jyg
@@ -809,5 +805,5 @@
 
       !  Injection during BL mixing
-      !
+
       IF (CPPKEY_STRATAER) THEN
         IF (type_trac=='coag') THEN
@@ -837,14 +833,14 @@
 
       DO it = 1, nbtr
-        !
+
         IF (pbl_flg(it) /= 0) THEN
-          !
+
           CALL cltrac(pdtphys, coefh, t_seri, &
                   tr_seri(:, :, it), source(:, it), &
                   paprs, pplay, delp, &
                   d_tr_cl(:, :, it), d_tr_dry(:, it), flux_tr_dry(:, it))
-          !
+
           tr_seri(:, :, it) = tr_seri(:, :, it) + d_tr_cl(:, :, it)
-          !
+
           IF (CPPKEY_STRATAER) THEN
             IF (type_trac=='coag') THEN
@@ -862,13 +858,13 @@
             ENDIF
           END IF
-          !
+
         ENDIF
-        !
+
       ENDDO
-      !
+
     ELSE IF (iflag_vdf_trac==0) THEN
-      !
+
       !   Injection of source in the first model layer
-      !
+
       DO it = 1, nbtr
         d_tr_cl(:, 1, it) = source(:, it) * RG / delp(:, 1) * pdtphys
@@ -876,14 +872,14 @@
       ENDDO
       d_tr_cl(:, 2:klev, 1:nbtr) = 0.
-      !
+
     ELSE IF (iflag_vdf_trac==-1) THEN
-      !
+
       ! Nothing happens
       d_tr_cl = 0.
-      !
+
     ELSE
-      !
+
       CALL abort_physic('iflag_vdf_trac', 'cas non prevu', 1)
-      !
+
     ENDIF ! couche limite
 
@@ -902,8 +898,8 @@
       ql_incl = ql_incloud_ref
       ! choix du lessivage
-      !
+
       IF (iflag_lscav == 3 .OR. iflag_lscav == 4) THEN
         ! ********  Olivier Boucher version (3) possibly with modified ql_incl (4)
-        !
+
         DO it = 1, nbtr
 
@@ -971,5 +967,5 @@
                 zrho(i, k) = pplay(i, k) / t_seri(i, k) / RD
                 zdz(i, k) = (paprs(i, k) - paprs(i, k + 1)) / zrho(i, k) / RG
-                !
+
               ENDDO
             ENDDO
@@ -1005,5 +1001,5 @@
                 d_tr_lessi_impa(i, k, it) = d_tr_lessi_impa(i, k, it) + &
                         (1 - frac_impa(i, k)) * tr_seri(i, k, it)
-                !
+
                 ! Flux lessivage total
                 flestottr(i, k, it) = flestottr(i, k, it) - &
@@ -1045,5 +1041,4 @@
                         (1 - frac_impa(i, k)) * tr_seri(i, k, it)
 
-                !
                 ! Flux lessivage total
                 ! ------------------------------------------------------------
@@ -1053,5 +1048,5 @@
                                 (paprs(i, k) - paprs(i, k + 1)) / &
                                 (RG * pdtphys)
-                !
+
                 ! Mise a jour des traceurs due a l'impaction,nucleation
                 ! ----------------------------------------------------------------------
@@ -1064,5 +1059,5 @@
         ! *********   end old version
       ENDIF  !  iflag_lscav  .EQ. 1, 2, 3 or 4
-      !
+
     ENDIF !  lessivage
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/qcheck.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/qcheck.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/qcheck.F90	(revision 5099)
@@ -1,8 +1,8 @@
 FUNCTION qcheck(klon,klev,paprs,q,ql,aire)
   IMPLICIT none
-  !
+
   ! Calculer et imprimer l'eau totale. A utiliser pour verifier
   ! la conservation de l'eau
-  !
+
   include "YOMCST.h"
   INTEGER,INTENT(IN) :: klon,klev
@@ -11,5 +11,5 @@
   REAL qtotal, zx, qcheck
   INTEGER i, k
-  !
+
   zx = 0.0
   DO i = 1, klon
@@ -23,7 +23,7 @@
      ENDDO
   ENDDO
-  !
+
   qcheck = qtotal/zx
-  !
+
 END FUNCTION qcheck
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/qsat_seawater.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/qsat_seawater.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/qsat_seawater.F90	(revision 5099)
@@ -1,8 +1,8 @@
 !-------------------------------------------------------------------------------
-!
+
 !     ######################################
 REAL      FUNCTION QSAT_SEAWATER(PT,PP) 
 !     ######################################
-!
+
 !!****  *QSATW * - function to compute saturation vapor humidity from
 !!                 temperature
@@ -12,6 +12,6 @@
 !       The purpose of this function is to compute the saturation vapor 
 !     pressure from temperature over saline seawater
-!      
-!
+
+
 !!**  METHOD
 !!    ------
@@ -59,17 +59,16 @@
 !!      Original    6/04/2005 
 !-------------------------------------------------------------------------------
-!
+
 !*       0.    DECLARATIONS
 !              ------------
-!
+
 USE MODD_CSTS
 USE dimphy
 USE indice_sol_mod
-!
+
 IMPLICIT NONE
-!
+
 !*       0.1   Declarations of arguments and results
-!
-!
+
 
 REAL, DIMENSION(klon), INTENT(IN)                :: PT     ! Temperature
@@ -82,18 +81,17 @@
                                                         ! water (kg/kg)
 
-!
 !*       0.2   Declarations of local variables
-!
+
 REAL, DIMENSION(SIZE(PT))                   :: ZFOES  ! saturation vapor 
                                                         ! pressure
                                                         ! (Pascal) 
-!
+
 REAL, DIMENSION(SIZE(PT))                   :: ZWORK1
 REAL                                        :: ZWORK2
 !REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !-------------------------------------------------------------------------------
-!
+
 !IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:QSATSEAW_1D',0,ZHOOK_HANDLE)
-!
+
 !ZFOES  = 1 !PSAT(PT(:))
 !ZFOES  = 0.98*ZFOES
@@ -103,17 +101,17 @@
 ! impact on the computation of surface latent heat flux under strong wind 
 ! conditions (Zeng et al, 1998). 
-!
+
 ZWORK1 = ZFOES/PP
 ZWORK2    = XRD/XRV
-!
+
 !*       2.    COMPUTE SATURATION HUMIDITY
 !              ---------------------------
-!
+
 PQSAT = ZWORK2*ZWORK1 / (1.+(ZWORK2-1.)*ZWORK1)
-!
+
 !IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:QSATSEAW_1D',1,ZHOOK_HANDLE)
 !-------------------------------------------------------------------------------
-!
+
 END FUNCTION QSAT_SEAWATER
-!
+
 !-------------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/qsat_seawater2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/qsat_seawater2.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/qsat_seawater2.F90	(revision 5099)
@@ -1,8 +1,8 @@
 !-------------------------------------------------------------------------------
-!
+
 !     ######################################
 REAL      FUNCTION QSAT_SEAWATER2(PT,PP,PSSS) 
 !     ######################################
-!
+
 !!****  *QSATW * - function to compute saturation vapor humidity from
 !!                 temperature
@@ -12,6 +12,6 @@
 !       The purpose of this function is to compute the saturation vapor 
 !     pressure from temperature over saline seawater
-!      
-!
+
+
 !!**  METHOD
 !!    ------
@@ -45,17 +45,17 @@
 !!      Original    19/03/2014 
 !-------------------------------------------------------------------------------
-!
+
 !*       0.    DECLARATIONS
 !              ------------
-!
+
 USE MODD_CSTS, ONLY : XRD, XRV
 USE dimphy
 USE indice_sol_mod
-!
+
 IMPLICIT NONE
-!
+
 !*       0.1   Declarations of arguments and results
-!
-!
+
+
 REAL, DIMENSION(klon), INTENT(IN)                :: PT     ! Temperature
                                                         ! (Kelvin)
@@ -68,37 +68,37 @@
                                                         ! with respect to
                                                         ! water (kg/kg)
-!
+
 !*       0.2   Declarations of local variables
-!
+
 REAL, DIMENSION(SIZE(PT))                   :: ZFOES  ! saturation vapor
                                                         ! pressure
                                                         ! (Pascal)
-!
+
 REAL, DIMENSION(SIZE(PT))                   :: ZWORK1
 REAL                                        :: ZWORK2
 !REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !-------------------------------------------------------------------------------
-!
+
 !IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:QSATSEAW2_1D',0,ZHOOK_HANDLE)
-!
+
 !*       1.    COMPUTE SATURATION VAPOR PRESSURE
 !              ---------------------------------
-!
+
 ZFOES(:) = EXP( 24.4543 -67.4509*(100.0/PT(:)) -4.8489*LOG(PT(:)/100.0)   &
                 -5.44E-04*(PSSS(:)/1.00472) ) !see Sharqawy et al (2010) Eq32 p368
 ZFOES(:) = ZFOES(:)*1013.25E+02             !convert from atm to Pa
-!
+
 ZWORK1(:) = ZFOES(:)/PP(:)
 ZWORK2    = XRD/XRV
-!
+
 !*       2.    COMPUTE SATURATION SPECIFIC HUMIDITY
 !              ------------------------------------
-!
+
 PQSATA(:) = ZWORK2*ZWORK1(:) / (1.0+(ZWORK2-1.0)*ZWORK1(:))
-!
+
 !IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:QSATSEAW2_1D',1,ZHOOK_HANDLE)
 !-------------------------------------------------------------------------------
-!
+
 END FUNCTION QSAT_SEAWATER2
-!
+
 !-------------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/qsatseaw_1D.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/qsatseaw_1D.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/qsatseaw_1D.F90	(revision 5099)
@@ -1,8 +1,8 @@
 !-------------------------------------------------------------------------------
-!
+
 !     ######################################
 REAL       FUNCTION QSATSEAW_1D(PT,PP) 
 !     ######################################
-!
+
 !!****  *QSATW * - function to compute saturation vapor humidity from
 !!                 temperature
@@ -12,6 +12,6 @@
 !       The purpose of this function is to compute the saturation vapor 
 !     pressure from temperature over saline seawater
-!      
-!
+
+
 !!**  METHOD
 !!    ------
@@ -59,8 +59,8 @@
 !!      Original    6/04/2005 
 !-------------------------------------------------------------------------------
-!
+
 !*       0.    DECLARATIONS
 !              ------------
-!
+
 USE MODD_CSTS
 USE dimphy
@@ -70,6 +70,6 @@
 
 !*       0.1   Declarations of arguments and results
-!
-!
+
+
 REAL, DIMENSION(klon), INTENT(IN)                :: PT     ! Temperature
                                                         ! (Kelvin)
@@ -80,34 +80,34 @@
                                                         ! with respect to
                                                         ! water (kg/kg)
-!
+
 !*       0.2   Declarations of local variables
-!
+
 REAL, DIMENSION(SIZE(PT))                   :: ZFOES  ! saturation vapor 
                                                         ! pressure
                                                         ! (Pascal) 
-!
+
 INTEGER                         :: JJ   ! loop index
 !REAL(KIND=JPRB) :: ZHOOK_HANDLE
 !-------------------------------------------------------------------------------
-!
+
 !IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:QSATSEAW_1D',0,ZHOOK_HANDLE)
 !DO JJ = 1, SIZE(PT)
 !*       1.    COMPUTE SATURATION VAPOR PRESSURE
 !              ---------------------------------
-!
+
 ZFOES = 0.98*EXP( XALPW - XBETAW/PT - XGAMW*LOG(PT)  )
 ! vapor pressure reduction of 2% over saline seawater could have a significant 
 ! impact on the computation of surface latent heat flux under strong wind 
 ! conditions (Zeng et al, 1998). 
-!
+
 !*       2.    COMPUTE SATURATION HUMIDITY
 !              ---------------------------
-!
+
 PQSAT = XRD/XRV*ZFOES/PP /(1.+(XRD/XRV-1.)*ZFOES/PP)  
-!
+
 !ENDDO
 !IF (LHOOK) CALL DR_HOOK('MODE_THERMOS:QSATSEAW_1D',1,ZHOOK_HANDLE)
 !-------------------------------------------------------------------------------
-!
+
 END FUNCTION QSATSEAW_1D
 !------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.160.98.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.160.98.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.160.98.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=78,kflev=klev) ! 78*199
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.192.143.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.192.143.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.192.143.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
        INTEGER kdlon, kflev
       PARAMETER (kdlon=10,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.32.24.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.32.24.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.32.24.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=klon,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.48.32.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.48.32.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.48.32.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=149,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.72.46.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.72.46.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.72.46.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=1621,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.96.72.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.96.72.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.96.72.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=487,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.defaut.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.defaut.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.defaut.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=klon,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddim.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER kdlon, kflev
       PARAMETER (kdlon=149,kflev=klev)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/raddimlw.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/raddimlw.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/raddimlw.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       INTEGER NUA
       PARAMETER (NUA=24)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radepsi.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radepsi.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radepsi.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       REAL(KIND=8) ZEELOG, ZEPSC, ZEPSCO, ZEPSCQ, ZEPSCT, ZEPSCW
       REAL(KIND=8) ZEPSEC, ZEPSCR
@@ -12,5 +12,5 @@
       PARAMETER (ZEPSEC = 1.0E-12)
       PARAMETER (ZEPSCR = 1.0E-10)
-!
+
       REAL(KIND=8) REPSCT
       PARAMETER (REPSCT=1.0E-10)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radio_decay.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radio_decay.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radio_decay.F90	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 ! $Id $
-!
+
 SUBROUTINE radio_decay(radio,rnpb,dtime,tautr,tr,d_tr) 
-!
+
 ! Caluclate radioactive decay for all tracers with radio(it)=true
-!
+
   USE dimphy
   USE infotrac_phy, ONLY : nbtr
@@ -15,7 +15,7 @@
 !        Cas particulier pour le couple radon-plomb : Le radon decroit en plomb
 !-----------------------------------------------------------------------
-!
+
 ! Entrees
-!
+
   LOGICAL,DIMENSION(nbtr),INTENT(IN)        :: radio ! .true. = traceur radioactif  
   LOGICAL,INTENT(IN)                        :: rnpb  ! .true. = decroissance RN = source PB
@@ -23,11 +23,11 @@
   REAL,DIMENSION(nbtr),INTENT(IN)           :: tautr ! Constante de decroissance radioactive
   REAL,DIMENSION(klon,klev,nbtr),INTENT(IN) :: tr    ! Concentrations traceurs U/kgA
-!
+
 ! Sortie
-!
+
   REAL,DIMENSION(klon,klev,nbtr),INTENT(OUT) :: d_tr  ! Tendance de decroissance radioactive
-!
+
 ! Locales
-!
+
   INTEGER  :: i,k,it
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 module radlwsw_m
 
@@ -119,5 +119,5 @@
     !                   droplet concentration, thus larger droplets, thus generally cdltaupi cldtaupd
     !                   it is needed for the diagnostics of the aerosol indirect radiative forcing      
-    !
+
     !                  OUTPUTS
     ! heat-----output-R- echauffement atmospherique (visible) (K/jour)
@@ -133,8 +133,8 @@
     ! solswai---output-R- ray. solaire net absorbe a la surface (aerosol ind)
     ! topswai---output-R- ray. solaire absorbe au sommet de l'atm. (aerosol ind)
-    !
+
     ! heat_volc-----output-R- echauffement atmospherique  du au forcage volcanique (visible) (K/s)
     ! cool_volc-----output-R- refroidissement dans l'IR du au forcage volcanique (K/s)
-    !
+
     ! ATTENTION: swai and swad have to be interpreted in the following manner:
     ! ---------
@@ -146,5 +146,5 @@
     ! ok_ade=T & ok_aie=T -aerosol indirect forcing is F_{AI} = topsw-topswai
     !                        aerosol direct forcing is F_{AD} = topswai-topswad
-    !
+
     ! --------- RRTM: output RECMWFL
     ! ZEMTD (KPROMA,KLEV+1)         ; TOTAL DOWNWARD LONGWAVE EMISSIVITY
@@ -185,5 +185,5 @@
     ! 8 = SS    
     ! 9 = NO3    
-    ! 
+
     ! ====================================================================
 
@@ -511,5 +511,4 @@
     ZSOLSWCF_AERO(:,:) =0. !ym missing init  
 
-    !
     ! AI 02.2021
 #ifdef CPP_ECRAD
@@ -555,7 +554,7 @@
        ENDDO
     ENDDO
-    !
+
     zdist = dist
-    !
+
     PSCT = solaire/zdist/zdist
 
@@ -592,5 +591,5 @@
                 PALBP_NEW(i,kk)=alb_dir(iof+i,kk)
              ENDDO
-             !
+
           ENDIF
           !albedo SB <<<
@@ -636,5 +635,5 @@
              ! present-day aerosol concentrations whereas the quantities without the
              ! "A" at the end are for pre-industial (natural-only) aerosol concentrations
-             !
+
              PTAUA(i,1,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! 1e-12 serait instable
              PTAUA(i,2,k) = MAX(cldtaupd(iof+i,k), 1.0e-05)! pour 32-bit machines
@@ -650,5 +649,5 @@
 #endif
        ENDIF
-       !
+
        DO k = 1, kflev+1
           DO i = 1, kdlon
@@ -656,5 +655,5 @@
           ENDDO
        ENDDO
-       !
+
 !!!!! Modif MPL 6.01.09 avec RRTM, on passe de 5 a 6 
        DO kk = 1, 6
@@ -675,9 +674,9 @@
           ENDDO
        ENDDO
-       !
+
        !===== iflag_rrtm ================================================
-       !      
+
        IF (iflag_rrtm == 0) THEN       !!!! remettre 0 juste pour tester l'ancien rayt via rrtm
-          !
+
           !--- Mise a zero des tableaux output du rayonnement LW-AR4 ----------              
           DO k = 1, kflev+1
@@ -800,5 +799,5 @@
              ENDDO
           ENDDO
-          !
+
        ELSE IF (iflag_rrtm == 1) then  
 #ifdef CPP_RRTM
@@ -828,42 +827,42 @@
              ENDDO
           ENDDO
-          !
+
           !--OB
           !--aerosol TOT  - anthropogenic+natural - index 2
           !--aerosol NAT  - natural only          - index 1
-          !
+
           DO i = 1, kdlon
              DO k = 1, kflev
                 DO kk=1, NSW
-                   !
+
                    PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk)
                    PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk)
                    PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk)
-                   !
+
                    PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk)
                    PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk)
                    PCGA_NAT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,1,kk)
-                   !
+
                 ENDDO
              ENDDO
           ENDDO
           !-end OB
-          !
+
           !--C. Kleinschmitt
           !--aerosol TOT  - anthropogenic+natural - index 2
           !--aerosol NAT  - natural only          - index 1
-          !
+
           DO i = 1, kdlon
              DO k = 1, kflev
                 DO kk=1, NLW
-                   !
+
                    PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk)
                    PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk)
-                   !
+
                 ENDDO
              ENDDO
           ENDDO
           !-end C. Kleinschmitt
-          !      
+
           DO i = 1, kdlon
              ZCTRSO(i,1)=0.
@@ -939,5 +938,5 @@
           !    s   ZFLUX_i  , ZFLUC_i , ZFSDWN_i, ZFSUP_i , ZFCDWN_i,ZFCUP_i)
           !    s   'RECMWF ')
-          !
+
           IF (lldebug) THEN
              CALL writefield_phy('paprs_i',paprs_i,klev+1)
@@ -1098,5 +1097,5 @@
              ENDIF
           ENDDO
-          !
+
           DO i = 1, kdlon
              zsolsw(i)    = ZSWFT(i,1)
@@ -1106,5 +1105,5 @@
              ztopsw0(i)   = ZSWFT0_i(i,klev+1)
              !        ztopsw0(i)   = ZFSDN0(i,klev+1)-ZFSUP0(i,klev+1)
-             !         
+
              !        zsollw(i)    = ZFLDN(i,1)      -ZFLUP(i,1)
              !        zsollw0(i)   = ZFLDN0(i,1)     -ZFLUP0(i,1)
@@ -1115,5 +1114,5 @@
              ztoplw(i)    = ZLWFT(i,klev+1)*(-1)
              ztoplw0(i)   = ZLWFT0_i(i,klev+1)*(-1)
-             !         
+
              IF (fract(i) == 0.) THEN
 !!!!! A REVOIR MPL (20090630) ca n a pas de sens quand fract=0
@@ -1191,5 +1190,5 @@
              ENDDO
           ENDDO
-          !
+
           ! AI ATTENTION Aerosols A REVOIR
           DO i = 1, kdlon
@@ -1197,9 +1196,9 @@
                 DO kk= 1, naero_spc
                    !      DO kk=1, NSW
-                   !
+
                    !      PTAU_TOT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,2,kk)
                    !      PPIZA_TOT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,2,kk)
                    !      PCGA_TOT(i,kflev+1-k,kk)=cg_aero_sw_rrtm(i,k,2,kk)
-                   !
+
                    !      PTAU_NAT(i,kflev+1-k,kk)=tau_aero_sw_rrtm(i,k,1,kk)
                    !      PPIZA_NAT(i,kflev+1-k,kk)=piz_aero_sw_rrtm(i,k,1,kk)
@@ -1207,22 +1206,22 @@
                    !       ZAEROSOL(i,kflev+1-k,kk)=m_allaer(i,k,kk)
                    ZAEROSOL(i,kflev+1-k,kk)=m_allaer(i,k,kk)
-                   !
+
                 ENDDO
              ENDDO
           ENDDO
           !-end OB
-          !
+
           !      DO i = 1, kdlon
           !      DO k = 1, kflev
           !      DO kk=1, NLW
-          !
+
           !      PTAU_LW_TOT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,2,kk)
           !      PTAU_LW_NAT(i,kflev+1-k,kk)=tau_aero_lw_rrtm(i,k,1,kk)
-          !
+
           !      ENDDO
           !      ENDDO
           !      ENDDO
           !-end C. Kleinschmitt
-          !      
+
           DO i = 1, kdlon
              ZCTRSO(i,1)=0.
@@ -1485,5 +1484,5 @@
                 ZSWFT0_i(i,k+1) = ZSWFT0_ii(i,klev+1-k)*fract(i)
                 ZLWFT0_i(i,k+1) = ZLWFT0_ii(i,klev+1-k)
-                !
+
                 ZFLUP(i,k+1)  = ZFLUX_i(i,1,klev+1-k)
                 ZFLDN(i,k+1)  = -1.*ZFLUX_i(i,2,klev+1-k)
@@ -1540,5 +1539,5 @@
              ENDIF
           ENDDO
-          !
+
           DO i = 1, kdlon
              zsolsw(i)    = ZSWFT(i,1)
@@ -1550,5 +1549,5 @@
              ztoplw(i)    = ZLWFT(i,klev+1)*(-1)
              ztoplw0(i)   = ZLWFT0_i(i,klev+1)*(-1)
-             !         
+
              zsollwdown(i)= -1.*ZFLDN(i,1)
           ENDDO
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radopt.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radopt.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radopt.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       LOGICAL LEVOIGT
       PARAMETER (LEVOIGT=.FALSE.)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/read_map2D.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/read_map2D.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/read_map2D.F90	(revision 5099)
@@ -31,16 +31,16 @@
   IF (is_mpi_root .AND. is_omp_root) THEN
      ierr = NF90_OPEN(trim(filename), NF90_NOWRITE, nid)
-     IF (ierr /= NF90_NOERR) CALL write_err_mess('Problem in opening file')
+     IF (ierr /= nf90_noerr) CALL write_err_mess('Problem in opening file')
 
      ierr = NF90_INQ_VARID(nid, trim(varname), nvarid)
-     IF (ierr /= NF90_NOERR) CALL write_err_mess('The variable is absent in file')
+     IF (ierr /= nf90_noerr) CALL write_err_mess('The variable is absent in file')
      
      start=(/1,1,timestep/)
      count=(/nbp_lon,nbp_lat,1/)
-     ierr = NF90_GET_VAR(nid, nvarid, var_glo2D,start,count)
-     IF (ierr /= NF90_NOERR) CALL write_err_mess('Problem in reading varaiable')
+     ierr = nf90_get_var(nid, nvarid, var_glo2D,start,count)
+     IF (ierr /= nf90_noerr) CALL write_err_mess('Problem in reading varaiable')
 
      ierr = NF90_CLOSE(nid)
-     IF (ierr /= NF90_NOERR) CALL write_err_mess('Problem in closing file')
+     IF (ierr /= nf90_noerr) CALL write_err_mess('Problem in closing file')
 
      ! Inverse latitude order
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_interp.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_interp.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_interp.F90	(revision 5099)
@@ -1,11 +1,11 @@
 ! $Id$
-!
+
 SUBROUTINE readaerosol_interp(id_aero, itap, pdtphys, r_day, first, pplay, paprs, t_seri, mass_out, pi_mass_out, load_src)
-!
+
 ! This routine will return the mass concentration at actual day(mass_out) and 
 ! the pre-industrial values(pi_mass_out) for aerosol corresponding to "id_aero".
 ! The mass concentrations for all aerosols are saved in this routine but each
 ! call to this routine only treats the aerosol "id_aero".
-!
+
 ! 1) Read in data for the whole year, only at first time step
 ! 2) Interpolate to the actual day, only at new day
@@ -29,5 +29,4 @@
   INCLUDE "clesphys.h"
 
-!
 ! Input:
 !****************************************************************************************
@@ -40,5 +39,5 @@
   REAL, DIMENSION(klon,klev+1),INTENT(IN):: paprs  ! pression between model layers
   REAL, DIMENSION(klon,klev), INTENT(IN) :: t_seri ! air temperature
-!      
+
 ! Output:      
 !****************************************************************************************
@@ -46,5 +45,5 @@
   REAL, INTENT(OUT) :: pi_mass_out(klon,klev) ! Mass of preindustrial aerosol (monthly mean data,from file) [ug AIBCM/m3]
   REAL, INTENT(OUT) :: load_src(klon) ! Load of aerosol (monthly mean data,from file) [kg/m3]
-!      
+
 ! Local Variables:
 !****************************************************************************************
@@ -97,5 +96,5 @@
 !****************************************************************************************
 ! Initialization
-!
+
 !****************************************************************************************
 
@@ -167,5 +166,5 @@
 ! 1) Read in data : corresponding to the actual year and preindustrial data. 
 !    Only for the first day of the year.
-!
+
 !****************************************************************************************
   IF ( (first .OR. iday==0) .AND. lnewday ) THEN 
@@ -270,5 +269,5 @@
 
 !    Calendar initialisation
-!
+
      DO i = 2, 13
        month_len(i) = REAL(ioget_mon_len(year_cur, i-1))
@@ -291,5 +290,5 @@
 ! - 2) Interpolate to the actual day.
 ! - 3) Interpolate to the model vertical grid.
-!
+
 !****************************************************************************************
 
@@ -297,5 +296,5 @@
 !****************************************************************************************
 ! 2) Interpolate to the actual day
-! 
+
 !****************************************************************************************
     ! Find which months and days to use for time interpolation
@@ -385,5 +384,5 @@
 !****************************************************************************************
 ! 3) Interpolate to the model vertical grid (target grid)
-!
+
 !****************************************************************************************
 
@@ -527,5 +526,5 @@
 !****************************************************************************************
 ! 4) Test for negative mass values
-!
+
 !****************************************************************************************
      IF (MINVAL(var_day(:,:,id_aero)) < 0.) THEN
@@ -571,5 +570,5 @@
 !****************************************************************************************
 ! Copy output from saved variables
-!
+
 !****************************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_mod.F90	(revision 5099)
@@ -1,4 +1,4 @@
 ! $Id: readaerosol.F90 3436 2019-01-22 16:26:21Z emillour $
-!
+
 MODULE readaerosol_mod
 
@@ -20,10 +20,10 @@
 !****************************************************************************************
 ! This routine will read the aersosol from file. 
-!
+
 ! Read a year data with get_aero_fromfile depending on aer_type : 
 ! - actuel   : read year 1980
 ! - preind   : read natural data
 ! - scenario : read one or two years and do eventually linare time interpolation
-!
+
 ! Return pointer, pt_out, to the year read or result from interpolation
 !****************************************************************************************
@@ -57,5 +57,5 @@
 !****************************************************************************************
 ! Read data depending on aer_type
-!
+
 !****************************************************************************************
 
@@ -200,5 +200,5 @@
         IF (is_mpi_root) THEN
     
-          IF (nf90_open(TRIM(file_aerosol), NF90_NOWRITE, ncid) /= NF90_NOERR) THEN
+          IF (nf90_open(TRIM(file_aerosol), NF90_NOWRITE, ncid) /= nf90_noerr) THEN
             CALL check_err( nf90_open(TRIM(file_so4), NF90_NOWRITE, ncid), "pb open "//trim(file_so4) )
           ENDIF
@@ -217,6 +217,6 @@
           ALLOCATE(lat_src(nbp_lat_src))
           CALL check_err( nf90_get_var(ncid, varid, lat_src(:)),"pb get lat" )
-          IF (nf90_inq_dimid(ncid, 'lev', dimid) /= NF90_NOERR) THEN
-            IF (nf90_inq_dimid(ncid, 'presnivs', dimid)/= NF90_NOERR) THEN
+          IF (nf90_inq_dimid(ncid, 'lev', dimid) /= nf90_noerr) THEN
+            IF (nf90_inq_dimid(ncid, 'presnivs', dimid)/= nf90_noerr) THEN
                CALL check_err(nf90_inq_dimid(ncid, 'PRESNIVS', dimid),'dimension lev,PRESNIVS or presnivs not in file')
             ENDIF
@@ -253,5 +253,5 @@
 ! Read 12 month aerosol from file and distribute to local process on physical grid. 
 ! Vertical levels, klev_src, may differ from model levels if new file format.
-!
+
 ! For mpi_root and master thread :
 ! 1) Open file 
@@ -261,5 +261,5 @@
 ! 5) Transform the global field from 2D(nbp_lon,nbp_lat) to 1D(klon_glo)
 !     - Also the levels and the latitudes have to be inversed
-!
+
 ! For all processes and threads :
 ! 6) Scatter global field(klon_glo) to local process domain(klon)
@@ -399,10 +399,10 @@
 !****************************************************************************************
        ierr = nf90_inq_dimid(ncid, 'lev', dimid)
-       IF (ierr /= NF90_NOERR) THEN
+       IF (ierr /= nf90_noerr) THEN
           ! Coordinate axe lev not found. Check for presnivs.
           ierr = nf90_inq_dimid(ncid, 'presnivs', dimid)
-          IF (ierr /= NF90_NOERR) THEN
+          IF (ierr /= nf90_noerr) THEN
              ierr = nf90_inq_dimid(ncid, 'PRESNIVS', dimid)
-             IF (ierr /= NF90_NOERR) THEN
+             IF (ierr /= nf90_noerr) THEN
                 ! Dimension PRESNIVS not found either
                 CALL abort_physic('get_aero_fromfile', 'dimension lev,PRESNIVS or presnivs not in file',1)
@@ -444,5 +444,5 @@
 !**************************************************************************************************
        ierr = nf90_inq_dimid(ncid, 'TIME',dimid)
-       if (ierr /= NF90_NOERR) THEN
+       if (ierr /= nf90_noerr) THEN
           ierr = nf90_inq_dimid(ncid, 'time_counter', dimid)
        ENDIF
@@ -459,5 +459,5 @@
           !CALL check_err( nf90_inq_varid(ncid, TRIM(varname), varid),"pb inq var "//TRIM(varname) )
           print *,'readaerosol ', TRIM(varname)
-          IF ( nf90_inq_varid(ncid, TRIM(varname), varid) /= NF90_NOERR ) THEN 
+          IF ( nf90_inq_varid(ncid, TRIM(varname), varid) /= nf90_noerr ) THEN
             ! Variable is not there
             WRITE(lunout,*) 'Attention '//TRIM(varname)//' is not in aerosol input file'
@@ -479,5 +479,5 @@
           ! Get variable id
           !CALL check_err( nf90_inq_varid(ncid, "load_"//TRIM(varname), varid) ,"pb inq var load_"//TRIM(varname))
-          IF ( nf90_inq_varid(ncid, "load_"//TRIM(varname), varid) /= NF90_NOERR ) THEN 
+          IF ( nf90_inq_varid(ncid, "load_"//TRIM(varname), varid) /= nf90_noerr ) THEN
             WRITE(lunout,*) 'Attention load_'//TRIM(varname)//' is not in aerosol input file'
             load_glo2D(:,:,:)=0.0
@@ -723,5 +723,5 @@
     CHARACTER(len=*), INTENT (IN), OPTIONAL :: text
 
-    IF (status /= NF90_NOERR) THEN
+    IF (status /= nf90_noerr) THEN
        WRITE(lunout,*) 'Error in get_aero_fromfile, netcdf error code = ',status
        IF (PRESENT(text)) THEN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_optic.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_optic.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosol_optic.F90	(revision 5099)
@@ -1,4 +1,4 @@
 ! $Id$
-!
+
 SUBROUTINE readaerosol_optic(debut, flag_aerosol, itap, rjourvrai, &
      pdtphys, pplay, paprs, t_seri, rhcl, presnivs, &
@@ -10,6 +10,5 @@
 ! 1) recevie the aerosols(already read and interpolated) corresponding to flag_aerosol
 ! 2) calculate the optical properties for the aerosols
-!
-  
+
   USE dimphy
   USE aero_mod
@@ -75,5 +74,5 @@
 !****************************************************************************************
 ! 1) Get aerosol mass
-!    
+
 !****************************************************************************************
 ! Read and interpolate sulfate
@@ -141,7 +140,6 @@
   ENDIF
 
-!
 ! Store all aerosols in one variable
-!
+
   m_allaer(:,:,id_ASBCM_phy)  = bcsol(:,:)        ! ASBCM
   m_allaer(:,:,id_ASPOMM_phy) = pomsol(:,:)       ! ASPOMM
@@ -172,7 +170,7 @@
   m_allaer_pi(:,:,id_CSNO3M_phy) = 0.0
   m_allaer_pi(:,:,id_CINO3M_phy) = 0.0
-!
+
 ! Calculate the total mass of all soluble aersosols
-!
+
   mass_solu_aero(:,:)    = sulfate(:,:)    + bcsol(:,:)    + pomsol(:,:) + ssacu(:,:)
   mass_solu_aero_pi(:,:) = sulfate_pi(:,:) + bcsol_pi(:,:) + pomsol_pi(:,:) + ssacu_pi(:,:)
@@ -180,5 +178,5 @@
 !****************************************************************************************
 ! 2) Calculate optical properties for the aerosols
-!
+
 !****************************************************************************************
   DO k = 1, klev
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90	(revision 5099)
@@ -161,11 +161,11 @@
 !--keep memory of previous month
     mth_pre=mth_cur
-!
+
     IF (is_mpi_root.AND.is_omp_root) THEN
-!
+
     DEALLOCATE(tauaerstrat)
     DEALLOCATE(tauaerstrat_mois)
     DEALLOCATE(tauaerstrat_mois_glo)
-!
+
     ENDIF !-is_mpi_root and is_omp_root
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readchlorophyll.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readchlorophyll.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readchlorophyll.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 !--This routine is to be tested with MPI / OMP parallelism 
 !--OB 26/03/2018
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/reevap.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/reevap.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/reevap.F90	(revision 5099)
@@ -21,7 +21,7 @@
     include "FCTTRE.h"
     !IM 100106 BEG : pouvoir sortir les ctes de la physique
-    !
+
     ! Re-evaporer l'eau liquide nuageuse
-    !
+
 !print *,'rrevap ; fl_cor_ebil:',fl_cor_ebil,' iflag_ice_thermo:',iflag_ice_thermo,' RVTMP2',RVTMP2
     DO k = 1, klev  ! re-evaporation de l'eau liquide nuageuse
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regdim.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regdim.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regdim.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 !     Valid and equivalent for either free source form or fixed source form
       INTEGER i1_deb, i1_fin
@@ -11,5 +11,5 @@
       PARAMETER (i1_deb=16, i1_fin=30)
       PARAMETER (i2_deb=31, i2_fin=33)
-!
+
       INTEGER j_deb, j_fin
 !cc      PARAMETER (j_deb=29, j_fin=61)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90	(revision 5099)
@@ -5,5 +5,5 @@
   USE nrtype,            ONLY: pi
   USE netcdf,   ONLY: NF90_CLOBBER, NF90_FLOAT,     NF90_OPEN,   &
-                      NF90_NOWRITE, NF90_NOERR,     NF90_GET_ATT, NF90_GLOBAL
+                      NF90_NOWRITE, nf90_noerr,     NF90_GET_ATT, NF90_GLOBAL
   USE netcdf95, ONLY: NF95_DEF_DIM, NF95_INQ_DIMID, NF95_INQUIRE_DIMENSION,    &
        NF95_DEF_VAR, NF95_INQ_VARID, NF95_INQUIRE_VARIABLE, &
@@ -27,7 +27,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE regr_horiz_time_climoz(read_climoz,interpt)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Regrid horizontally and in time zonal or 3D ozone climatologies.
@@ -166,6 +166,6 @@
 
       CALL  NF95_OPEN("climoz.nc"  , NF90_NOWRITE, fID_in)
-      lprev=NF90_OPEN("climoz_m.nc", NF90_NOWRITE, fID_in_m)==NF90_NOERR
-      lnext=NF90_OPEN("climoz_p.nc", NF90_NOWRITE, fID_in_p)==NF90_NOERR
+      lprev=NF90_OPEN("climoz_m.nc", NF90_NOWRITE, fID_in_m)==nf90_noerr
+      lnext=NF90_OPEN("climoz_p.nc", NF90_NOWRITE, fID_in_p)==nf90_noerr
 
       !--- Get coordinates from the input file. Converts lon/lat in radians.
@@ -206,5 +206,5 @@
             CALL NF95_INQUIRE_DIMENSION(fID_in, dIDs(i), nclen=nmth_in)
             cal_in='gregorian'
-            IF(NF90_GET_ATT(fID_in, varid, 'calendar', cal_in)/=NF90_NOERR)        &  
+            IF(NF90_GET_ATT(fID_in, varid, 'calendar', cal_in)/=nf90_noerr)        &
             WRITE(lunout,*)'WARNING: missing "calendar" attribute for "'//       &
             TRIM(dim_nam)//'" in "climoz.nc". Choosing default: "gregorian".'
@@ -366,6 +366,6 @@
       DO m=1, read_climoz
         WRITE(msg,'(a,i0)')"regr_lat_time_climoz: field Nr.",m
-        IF(NF90_GET_ATT(fID_in,vID_in(m),"missing_value",NaN)/= NF90_NOERR) THEN
-          IF(NF90_GET_ATT(fID_in, vID_in(m),"_FillValue",NaN)/= NF90_NOERR) THEN
+        IF(NF90_GET_ATT(fID_in,vID_in(m),"missing_value",NaN)/= nf90_noerr) THEN
+          IF(NF90_GET_ATT(fID_in, vID_in(m),"_FillValue",NaN)/= nf90_noerr) THEN
             WRITE(lunout,*)TRIM(msg)//": no missing value attribute found."; CYCLE
           END IF
@@ -588,10 +588,10 @@
   first=.FALSE.
 END SUBROUTINE regr_horiz_time_climoz
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE prepare_out(fID_in, nlev_in, ntim_ou, fID_ou, vlevID, vtimID, &
                        vID_ou, ndims, cal_ou)
@@ -604,5 +604,5 @@
   USE mod_phys_lmdz_para, ONLY: is_mpi_root
   USE mod_grid_phy_lmdz, ONLY: klon_glo
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -698,26 +698,26 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE handle_err_copy_att(att_name)
-!
-!-------------------------------------------------------------------------------
-  USE netcdf, ONLY: NF90_NOERR, NF90_strerror
+
+!-------------------------------------------------------------------------------
+  USE netcdf, ONLY: nf90_noerr, NF90_strerror
 !-------------------------------------------------------------------------------
 ! Arguments:
   CHARACTER(LEN=*), INTENT(IN) :: att_name
 !-------------------------------------------------------------------------------
-  IF(ncerr /= NF90_NOERR) &
+  IF(ncerr /= nf90_noerr) &
     WRITE(lunout,*)TRIM(sub)//" prepare_out NF95_COPY_ATT "//TRIM(att_name)//  &
                       " -- "//TRIM(NF90_strerror(ncerr))
 
 END SUBROUTINE handle_err_copy_att
-!
+
 !-------------------------------------------------------------------------------
 
 END SUBROUTINE prepare_out
-!
+
 !-------------------------------------------------------------------------------
 
 END MODULE regr_horiz_time_climoz_m
-!
-!-------------------------------------------------------------------------------
+
+!-------------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90	(revision 5099)
@@ -73,5 +73,5 @@
 !  This quasi-triangular localization function ponderates alpha-law from one near
 !  the tropopause to zero each side apart.
-!
+
 ! * The following fields are on the global "dynamics" grid, as read from files:
   REAL,    SAVE, ALLOCATABLE :: v1 (:,:,:,:)       !--- Current  time ozone fields
@@ -107,13 +107,13 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE regr_pr_time_av(fID, nam, julien, Ploc, Pre_in, Pre_ou, v3, Pgnd_ou,&
                                              time_in, lon_in, lat_in, Ptrp_ou)
-!
+
 !-------------------------------------------------------------------------------
   USE dimphy,         ONLY: klon
   USE netcdf95,       ONLY: NF95_INQ_VARID, NF95_INQUIRE_VARIABLE, &
                             NF95_INQ_DIMID, NF95_INQUIRE_DIMENSION, nf95_get_var
-  USE netcdf,         ONLY: NF90_INQ_VARID, NF90_NOERR
+  USE netcdf,         ONLY: NF90_INQ_VARID, nf90_noerr
   USE assert_m,       ONLY: assert
   USE assert_eq_m,    ONLY: assert_eq
@@ -210,7 +210,7 @@
     !=== CHECK WHICH FIELDS ARE AVAILABLE IN THE INPUT FILE
     IF(lfirst) THEN
-      lPrSfile=lAdjTro.AND.NF90_INQ_VARID(fID,"ps"                     ,vID)==NF90_NOERR
-      lPrTfile=lAdjTro.AND.NF90_INQ_VARID(fID,"tropopause_air_pressure",vID)==NF90_NOERR
-      lO3Tfile=lAdjTro.AND.NF90_INQ_VARID(fID,"tro3_at_tropopause"     ,vID)==NF90_NOERR
+      lPrSfile=lAdjTro.AND.NF90_INQ_VARID(fID,"ps"                     ,vID)==nf90_noerr
+      lPrTfile=lAdjTro.AND.NF90_INQ_VARID(fID,"tropopause_air_pressure",vID)==nf90_noerr
+      lO3Tfile=lAdjTro.AND.NF90_INQ_VARID(fID,"tro3_at_tropopause"     ,vID)==nf90_noerr
       CALL NF95_INQ_DIMID(fID,"time",vID)
       CALL NF95_INQUIRE_DIMENSION(fID,vID,nclen=ntim_in)
@@ -409,7 +409,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 SUBROUTINE update_fields()
-!
+
 !-------------------------------------------------------------------------------
   IF(.NOT.linterp) THEN                 !=== DAILY FILES: NO TIME INTERPOLATION
@@ -463,12 +463,12 @@
 
 END SUBROUTINE update_fields
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE get_2Dfield(v,var)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Shortcut to get the "irec"th record of the surface field named "var"
@@ -494,12 +494,12 @@
 
 END SUBROUTINE get_2Dfield
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE get_3Dfields(v)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Shortcut to get the "irec"th record of the 3D fields named "nam"
@@ -526,13 +526,13 @@
 
 END SUBROUTINE get_3Dfields
-!
-!-------------------------------------------------------------------------------
-
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+
+!-------------------------------------------------------------------------------
+
 FUNCTION get_SigTrop(ih,it) RESULT(out)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -551,12 +551,12 @@
 
 END FUNCTION get_SigTrop
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 FUNCTION PTrop_chem(ih,it,it0,pres,o3,o3trop) RESULT(out)
-!
+
 !-------------------------------------------------------------------------------
 ! Purpose: Determine the tropopause using chemical criterium, ie the pressure
@@ -603,12 +603,12 @@
 
 END FUNCTION PTrop_chem
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 FUNCTION check_ozone(o3col, lon, lat, ilev0, layer, vmin, vmax) RESULT(out)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -654,12 +654,12 @@
 
 END FUNCTION check_ozone
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE unitc(val,unt,fac)
-!
+
 !-------------------------------------------------------------------------------
   IMPLICIT NONE
@@ -681,12 +681,12 @@
 
 END SUBROUTINE unitc
-!
-!-------------------------------------------------------------------------------
-
-
-!-------------------------------------------------------------------------------
-!
+
+!-------------------------------------------------------------------------------
+
+
+!-------------------------------------------------------------------------------
+
 SUBROUTINE msg(ll,str,sub)
-!
+
 !-------------------------------------------------------------------------------
   USE print_control_mod, ONLY: lunout
@@ -706,9 +706,9 @@
 
 END SUBROUTINE msg
-!
+
 !-------------------------------------------------------------------------------
 
 END SUBROUTINE regr_pr_time_av
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/screenc_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/screenc_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/screenc_mod.F90	(revision 5099)
@@ -1,17 +1,17 @@
-!
+
 MODULE screenc_mod
-!
+
 ! This module contains some procedures for calculation of the correction
 ! of temperature, specific humidity and wind at a reference level
-!
+
   USE cdrag_mod
   IMPLICIT NONE
 
 CONTAINS
-!
+
 !****************************************************************************************
-!
+
 !r original routine svn3623
-!
+
       SUBROUTINE screenc(klon, knon, nsrf, zxli, &
                          speed, temp, q_zref, zref, &
@@ -21,15 +21,15 @@
       IMPLICIT NONE
 !-----------------------------------------------------------------------
-! 
+
 ! Objet : calcul "correcteur" des anomalies du vent, de la temperature 
 !         potentielle et de l'humidite relative au niveau de reference zref et 
 !         par rapport au 1er niveau (pour u) ou a la surface (pour theta et q) 
 !         a partir des equations de Louis.
-!
+
 ! Reference : Hess, Colman et McAvaney (1995)
-!
+
 ! I. Musat, 01.07.2002
 !-----------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -50,10 +50,10 @@
 !                  et zref par rapport au Ri entre la sfce et la 1ere couche
 ! ri1-----input-R- nb. Richardson entre la surface et la 1ere couche 
-!
+
 ! pref----input-R- pression au niveau de reference
 ! delu----input-R- anomalie du vent par rapport au 1er niveau
 ! delte---input-R- anomalie de la temperature potentielle par rapport a la surface
 ! delq----input-R- anomalie de l'humidite relative par rapport a la surface
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       LOGICAL, intent(in) :: zxli, okri 
@@ -69,21 +69,21 @@
       REAL, dimension(klon), intent(in) :: tsol    
       REAL, DIMENSION(klon), INTENT(IN)    :: pat1 !pression premier lev      
-!
+
       REAL, dimension(klon), intent(out) :: pref, delu, delte, delq 
 !-----------------------------------------------------------------------
       include "YOMCST.h"
       include "flux_arp.h"
-!
+
 ! Variables locales  
       INTEGER :: i 
       REAL, dimension(klon) :: cdram, cdrah, cdran, zri1, gref,ycdragm,zri_zero
-!
+
 !------------------------------------------------------------------------- 
       DO i=1, knon
         gref(i) = zref*RG
       ENDDO 
-!
+
 ! Richardson at reference level 
-!
+
 !      CALL coefcdrag (klon, knon, nsrf, zxli, &
 !                    speed, temp, q_zref, gref, &
@@ -112,8 +112,8 @@
                   cdrah(i)
       ENDDO 
-!
+
       RETURN 
       END SUBROUTINE screenc
-!
+
       SUBROUTINE screencn(klon, knon, nsrf, zxli, &
                          speed, temp, q_zref, zref, &
@@ -124,15 +124,15 @@
       IMPLICIT NONE
 !-----------------------------------------------------------------------
-! 
+
 ! Objet : calcul "correcteur" des anomalies du vent, de la temperature 
 !         potentielle et de l'humidite relative au niveau de reference zref et 
 !         par rapport au 1er niveau (pour u) ou a la surface (pour theta et q) 
 !         a partir des equations de Louis.
-!
+
 ! Reference : Hess, Colman et McAvaney (1995)
-!
+
 ! I. Musat, 01.07.2002
 !-----------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -153,10 +153,10 @@
 !                  et zref par rapport au Ri entre la sfce et la 1ere couche
 ! ri1-----input-R- nb. Richardson entre la surface et la 1ere couche 
-!
+
 ! pref----input-R- pression au niveau de reference
 ! delu----input-R- anomalie du vent par rapport au 1er niveau
 ! delte---input-R- anomalie de la temperature potentielle par rapport a la surface
 ! delq----input-R- anomalie de l'humidite relative par rapport a la surface
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       LOGICAL, intent(in) :: zxli, okri 
@@ -171,5 +171,5 @@
       REAL, DIMENSION(klon), INTENT(IN) :: pat1 !pression premier lev      
       INTEGER, INTENT(IN)  :: iri1 ! Richardson de la 1ere couche
-!
+
       REAL, dimension(klon), intent(out) :: pref, delm, delh, zri1
 !171220     REAL, dimension(klon) :: cdram, cdrah, zri1 
@@ -178,16 +178,16 @@
       include "YOMCST.h"
       include "flux_arp.h"
-!
+
 ! Variables locales  
       INTEGER :: i 
       REAL, dimension(klon) :: cdran, gref,ycdragm
-!
+
 !------------------------------------------------------------------------- 
       DO i=1, knon
         gref(i) = zref*RG
       ENDDO 
-!
+
 ! Richardson at reference level 
-!
+
       CALL cdrag(knon, nsrf, &
                     speed, temp, q_zref, gref, &
@@ -201,5 +201,5 @@
                    (cdrah(i)*sqrt(cdrm(i)))
       ENDDO 
-!
+
       RETURN 
       END SUBROUTINE screencn
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/screenp_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/screenp_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/screenp_mod.F90	(revision 5099)
@@ -1,17 +1,17 @@
-!
+
 MODULE screenp_mod
-!
+
 ! This module contains some procedures for calculation of the first
 ! guess of temperature, specific humidity and wind at a reference level
 ! coefficients for turbulent diffusion at surface
-!
+
   IMPLICIT NONE
 
 CONTAINS
-!
+
 !****************************************************************************************
-!
+
 !r original routine
-!
+
       SUBROUTINE screenp(klon, knon, nsrf, &
                      speed, tair, qair, &
@@ -21,15 +21,15 @@
       IMPLICIT none
 !-------------------------------------------------------------------------
-!
+
 ! Objet : calcul "predicteur" des anomalies du vent, de la temperature 
 !         potentielle et de l'humidite relative au niveau de reference zref et 
 !         par rapport au 1er niveau (pour u) ou a la surface (pour theta et q) 
 !         a partir des relations de Dyer-Businger.
-!
+
 ! Reference : Hess, Colman et McAvaney (1995)
-!
+
 ! I. Musat, 01.07.2002
 !-------------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -46,9 +46,9 @@
 ! qstar---input-R- facteur d'echelle pour l'humidite relative
 ! zref----input-R- altitude de reference
-!
+
 ! delu----input-R- anomalie du vent par rapport au 1er niveau
 ! delte---input-R- anomalie de la temperature potentielle par rapport a la surface
 ! delq----input-R- anomalie de l'humidite relative par rapport a la surface
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       REAL, dimension(klon), intent(in) :: speed, tair, qair
@@ -57,7 +57,7 @@
       REAL, dimension(klon), intent(in) :: ustar, testar, qstar
       REAL, intent(in) :: zref
-!
+
       REAL, dimension(klon), intent(out) :: delu, delte, delq
-!
+
 !-------------------------------------------------------------------------
 ! Variables locales et constantes :
@@ -67,9 +67,9 @@
 !-------------------------------------------------------------------------
       DO i = 1, knon
-!
+
         IF (lmon(i)>=0.) THEN
-!
+
 ! STABLE CASE
-!
+
           IF (speed(i)>1.5.AND.lmon(i)<=1.0                        &
                         .AND. rugos(i)<=1.0) THEN
@@ -89,7 +89,7 @@
           ENDIF
         ELSE  
-!
+
 ! UNSTABLE CASE
-!
+
           IF (speed(i)>5.0.AND.abs(lmon(i))<=50.0) THEN
             xtmp = (1. - 16. * (zref/lmon(i)))**(1./4.)
@@ -116,9 +116,9 @@
           ENDIF
         ENDIF
-!
+
       ENDDO
       RETURN
       END SUBROUTINE screenp
-!
+
       SUBROUTINE screenpn(klon, knon, nsrf, &
                      speed, tair, qair, &
@@ -128,15 +128,15 @@
       IMPLICIT none
 !-------------------------------------------------------------------------
-!
+
 ! Objet : calcul "predicteur" des anomalies du vent, de la temperature 
 !         potentielle et de l'humidite relative au niveau de reference zref et 
 !         par rapport au 1er niveau (pour u) ou a la surface (pour theta et q) 
 !         a partir des relations de Dyer-Businger.
-!
+
 ! Reference : Hess, Colman et McAvaney (1995)
-!
+
 ! I. Musat, 01.07.2002
 !-------------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -149,9 +149,9 @@
 ! rugos---input-R- rugosite
 ! zref----input-R- altitude de reference
-!
+
 ! delu----input-R- anomalie du vent par rapport au 1er niveau
 ! delte---input-R- anomalie de la temperature potentielle par rapport a la surface
 ! delq----input-R- anomalie de l'humidite relative par rapport a la surface
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       REAL, dimension(klon), intent(in) :: speed, tair, qair
@@ -159,7 +159,7 @@
       REAL, dimension(klon), intent(in) :: zri1
       REAL, intent(in) :: zref
-!
+
       REAL, dimension(klon), intent(out) :: delu, delte, delq
-!
+
 !-------------------------------------------------------------------------
 ! Variables locales et constantes :
@@ -169,5 +169,5 @@
 !-------------------------------------------------------------------------
       DO i = 1, knon
-!
+
        IF (zri1(i)>=0.) THEN
           delu(i)  = 0.1 * speed(i)
@@ -179,5 +179,5 @@
           delq(i)  = 0.5 * (max(qair(i),0.0) - max(qsurf(i),0.0))
        ENDIF
-!
+
       ENDDO
       RETURN
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/slab_heat_transp_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/slab_heat_transp_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/slab_heat_transp_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 MODULE slab_heat_transp_mod
-!
+
 ! Slab ocean : temperature tendencies due to horizontal diffusion 
 ! and / or Ekman transport
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/soil.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/soil.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/soil.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
 SUBROUTINE soil(ptimestep, indice, knon, snow, ptsrf, qsol, &
      lon, lat, ptsoil, pcapcal, pfluxgrd)
@@ -13,17 +13,17 @@
 
 !=======================================================================
-!
+
 !   Auteur:  Frederic Hourdin     30/01/92
 !   -------
-!
+
 !   Object:  Computation of : the soil temperature evolution
 !   -------                   the surfacic heat capacity "Capcal"
 !                            the surface conduction flux pcapcal
-!
+
 !   Update: 2021/07 : soil thermal inertia, formerly a constant value,
 !   ------   can also be now a function of soil moisture (F Cheruy's idea)
 !            depending on iflag_inertie, read from physiq.def via conf_phys_m.F90
 !            ("Stage L3" Eve Rebouillat, with E Vignon, A Sima, F Cheruy)
-!
+
 !   Method: Implicit time integration
 !   -------
@@ -42,8 +42,8 @@
 !             with F0 = A + B (Ts(t))
 !                 Capcal = B*dt
-!           
+
 !   Interface:
 !   ----------
-!
+
 !   Arguments:
 !   ----------
@@ -58,5 +58,5 @@
 !   pcapcal(klon)        surfacic specific heat (W*m-2*s*K-1)
 !   pfluxgrd(klon)       surface diffusive flux from ground (Wm-2)
-!   
+
 !=======================================================================
   INCLUDE "YOMCST.h"
@@ -165,5 +165,5 @@
 !   ou le point de mer devienne point de glace au pas suivant
 !   on corrige si on a un point de terre avec ou sans glace
-!
+
 !   iophys can be used to write the ztherm_i variable in a phys.nc file
 !   and check the results; to do so, add "CALL iophys_ini" in physiq_mod
@@ -192,8 +192,8 @@
 !      knon, knindex, ztherm_i)
   ELSE IF (indice == is_ter) THEN
-     ! 
+
      ! La relation entre l'inertie thermique du sol et qsol change d'apres 
      !   iflag_inertie, defini dans physiq.def, et appele via comsoil.h
-     ! 
+
      DO ig = 1, knon
         ! iflag_inertie=0 correspond au cas inertie=constant, comme avant
@@ -233,5 +233,5 @@
           WRITE (lunout,*) "Le choix iflag_inertie = ",iflag_inertie," n'est pas defini. Veuillez choisir un entier entre 0 et 3" 
         ENDIF
-     !
+
      ! Fin de l'introduction de la relation entre l'inertie thermique du sol et qsol
      !-------------------------------------------
@@ -260,5 +260,5 @@
 ! Calculation of Cgrf and Dgrd coefficients using soil temperature from 
 ! previous time step.
-!
+
 ! These variables are recalculated on the local compressed grid instead 
 ! of saved in restart file.
@@ -289,5 +289,5 @@
 ! Computation of the soil temperatures using the Cgrd and Dgrd
 ! coefficient computed above
-!
+
 !-----------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/stdlevvar_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/stdlevvar_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/stdlevvar_mod.F90	(revision 5099)
@@ -1,8 +1,8 @@
-!
+
 MODULE stdlevvar_mod
-!
+
 ! This module contains main procedures for calculation
 ! of temperature, specific humidity and wind at a reference level
-!
+
   USE cdrag_mod
   USE screenp_mod
@@ -11,9 +11,9 @@
 
 CONTAINS
-!
+
 !****************************************************************************************
-!
+
 !r original routine svn3623
-!
+
       SUBROUTINE stdlevvar(klon, knon, nsrf, zxli, &
                            u1, v1, t1, q1, z1, &
@@ -22,17 +22,17 @@
       IMPLICIT NONE
 !-------------------------------------------------------------------------
-!
+
 ! Objet : calcul de la temperature et l'humidite relative a 2m et du 
 !         module du vent a 10m a partir des relations de Dyer-Businger et
 !         des equations de Louis.
-!
+
 ! Reference : Hess, Colman et McAvaney (1995)        
-!
+
 ! I. Musat, 01.07.2002
-!
+
 !AM On rajoute en sortie t et q a 10m pr le calcule d'hbtm2 dans clmain
-!
+
 !-------------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -49,5 +49,5 @@
 ! psol----input-R- pression au sol
 ! pat1----input-R- pression au 1er niveau du modele
-!
+
 ! t_2m---output-R- temperature de l'air a 2m
 ! q_2m---output-R- humidite relative a 2m
@@ -57,5 +57,5 @@
 ! q_10m--output-R- humidite specifique a 10m
 ! ustar--output-R- u*
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       LOGICAL, intent(in) :: zxli
@@ -64,5 +64,5 @@
       REAL, dimension(klon), intent(inout) :: z0m, z0h
       REAL, dimension(klon), intent(in) :: psol, pat1
-!
+
       REAL, dimension(klon), intent(out) :: t_2m, q_2m, ustar
       REAL, dimension(klon), intent(out) :: u_10m, t_10m, q_10m
@@ -75,7 +75,7 @@
 !IM PLUS
       include "YOETHF.h"
-!
+
 ! Quelques constantes et options:
-!
+
 ! RKAR : constante de von Karman
       REAL, PARAMETER :: RKAR=0.40
@@ -83,5 +83,5 @@
 !     INTEGER, parameter :: niter=6, ncon=niter-1
       INTEGER, parameter :: niter=2, ncon=niter-1
-!
+
 ! Variables locales
       INTEGER :: i, n
@@ -114,5 +114,5 @@
        ri1(i) = 0.0
       ENDDO
-!
+
       okri=.FALSE.
 !      CALL coefcdrag(klon, knon, nsrf, zxli, &
@@ -136,7 +136,7 @@
       ENDDO
      ENDIF
-!
+
 !---------Star variables----------------------------------------------------
-!
+
       DO i = 1, knon
         ri1(i) = zri1(i)
@@ -145,9 +145,9 @@
         zdte(i) = tpot(i) - ts1(i)
         zdq(i) = max(q1(i),0.0) - max(qsurf(i),0.0)
-!
-!
+
+
 !IM BUG BUG BUG       zdte(i) = max(zdte(i),1.e-10)
         zdte(i) = sign(max(abs(zdte(i)),1.e-10),zdte(i))
-!
+
         testar(i) = (cdrah(i) * zdte(i) * speed(i))/ustar(i)
         qstar(i) = (cdrah(i) * zdq(i) * speed(i))/ustar(i)
@@ -155,5 +155,5 @@
                   (RKAR * RG * testar(i))
       ENDDO
-!
+
 !----------First aproximation of variables at zref --------------------------
       zref = 2.0
@@ -162,5 +162,5 @@
                    ustar, testar, qstar, zref, &
                    delu, delte, delq)
-!
+
       DO i = 1, knon
         u_zref(i) = delu(i)
@@ -172,9 +172,9 @@
         temp_p(i) = temp(i)
       ENDDO
-!
+
 ! Iteration of the variables at the reference level zref : corrector calculation ; see Hess & McAvaney, 1995 
-!
+
       DO n = 1, niter
-!
+
         okri=.TRUE.
         CALL screenc(klon, knon, nsrf, zxli, &
@@ -183,16 +183,16 @@
                      ustar, testar, qstar, okri, ri1, &
                      pref, delu, delte, delq, s_pblh ,prain, tsol, pat1)
-!
+
         DO i = 1, knon
           u_zref(i) = delu(i)
           q_zref(i) = delq(i) + max(qsurf(i),0.0)
           te_zref(i) = delte(i) + ts1(i) 
-!
+
 ! return to normal temperature
-!
+
           temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA)
 !         temp(i) = te_zref(i) - (zref* RG)/RCPD/ &
 !                 (1 + RVTMP2 * max(q_zref(i),0.0))
-!
+
 !IM +++
 !         IF(temp(i).GT.350.) THEN
@@ -200,16 +200,16 @@
 !         ENDIF
 !IM ---
-!
+
         IF(n==ncon) THEN
           te_zref_con(i) = te_zref(i)
           q_zref_con(i) = q_zref(i)
         ENDIF 
-!
+
         ENDDO 
-!
+
       ENDDO 
-!
+
 ! verifier le critere de convergence : 0.25% pour te_zref et 5% pour qe_zref
-!
+
 !       DO i = 1, knon
 !         conv_te(i) = (te_zref(i) - te_zref_con(i))/te_zref_con(i)
@@ -222,9 +222,9 @@
 !IM ---
 !       ENDDO
-!
+
       DO i = 1, knon
         q_zref_c(i) = q_zref(i)
         temp_c(i) = temp(i)
-!
+
 !       IF(zri1(i).LT.0.) THEN
 !         IF(nsrf.EQ.1) THEN
@@ -239,8 +239,8 @@
 !         ok_corr(i)=1.
 !       ENDIF
-!
+
         ok_pred(i)=0.
         ok_corr(i)=1.
-!
+
         t_2m(i) = temp_p(i) * ok_pred(i) + temp_c(i) * ok_corr(i)
         q_2m(i) = q_zref_p(i) * ok_pred(i) + q_zref_c(i) * ok_corr(i)
@@ -255,8 +255,8 @@
 !IM ---
       ENDDO
-!
-!
+
+
 !----------First aproximation of variables at zref --------------------------
-!
+
       zref = 10.0
       CALL screenp(klon, knon, nsrf, speed, tpot, q1, &
@@ -264,5 +264,5 @@
                    ustar, testar, qstar, zref, &
                    delu, delte, delq)
-!
+
       DO i = 1, knon
         u_zref(i) = delu(i)
@@ -274,9 +274,9 @@
         u_zref_p(i) = u_zref(i)
       ENDDO
-!
+
 ! Iteration of the variables at the reference level zref : corrector ; see Hess & McAvaney, 1995 
-!
+
       DO n = 1, niter
-!
+
         okri=.TRUE.
         CALL screenc(klon, knon, nsrf, zxli, &
@@ -285,5 +285,5 @@
                      ustar, testar, qstar, okri, ri1, &
                      pref, delu, delte, delq, s_pblh ,prain, tsol, pat1)
-!
+
         DO i = 1, knon
           u_zref(i) = delu(i)
@@ -294,12 +294,12 @@
 !                   (1 + RVTMP2 * max(q_zref(i),0.0))
         ENDDO 
-!
-      ENDDO
-!
+
+      ENDDO
+
       DO i = 1, knon
         u_zref_c(i) = u_zref(i)
-!
+
         u_10m(i) = u_zref_p(i) * ok_pred(i) + u_zref_c(i) * ok_corr(i)
-!
+
 !AM
         q_zref_c(i) = q_zref(i)
@@ -309,8 +309,8 @@
 !MA
       ENDDO
-! 
+
       RETURN
       END subroutine stdlevvar
-!
+
       SUBROUTINE stdlevvarn(klon, knon, nsrf, zxli, &
                            u1, v1, t1, q1, z1, &
@@ -318,21 +318,21 @@
                            t_2m, q_2m, t_10m, q_10m, u_10m, ustar, &
                            n2mout)
-!
+
       USE ioipsl_getin_p_mod, ONLY : getin_p
       IMPLICIT NONE
 !-------------------------------------------------------------------------
-!
+
 ! Objet : calcul de la temperature et l'humidite relative a 2m et du 
 !         module du vent a 10m a partir des relations de Dyer-Businger et
 !         des equations de Louis.
-!
+
 ! Reference : Hess, Colman et McAvaney (1995)        
-!
+
 ! I. Musat, 01.07.2002
-!
+
 !AM On rajoute en sortie t et q a 10m pr le calcule d'hbtm2 dans clmain
-!
+
 !-------------------------------------------------------------------------
-!
+
 ! klon----input-I- dimension de la grille physique (= nb_pts_latitude X nb_pts_longitude)
 ! knon----input-I- nombre de points pour un type de surface
@@ -349,5 +349,5 @@
 ! psol----input-R- pression au sol
 ! pat1----input-R- pression au 1er niveau du modele
-!
+
 ! t_2m---output-R- temperature de l'air a 2m
 ! q_2m---output-R- humidite relative a 2m
@@ -358,5 +358,5 @@
 ! t_10m--output-R- temperature de l'air a 10m
 ! q_10m--output-R- humidite specifique a 10m
-!
+
       INTEGER, intent(in) :: klon, knon, nsrf
       LOGICAL, intent(in) :: zxli
@@ -365,9 +365,9 @@
       REAL, dimension(klon), intent(in) :: qsurf
       REAL, dimension(klon), intent(in) :: psol, pat1
-!
+
       REAL, dimension(klon), intent(out) :: t_2m, q_2m, ustar
       REAL, dimension(klon), intent(out) :: u_10m, t_10m, q_10m
       INTEGER, dimension(klon, 6), intent(out) :: n2mout
-!
+
       REAL, dimension(klon) :: u_2m
       REAL, dimension(klon) :: cdrm2m, cdrh2m, ri2m
@@ -384,7 +384,7 @@
 !IM PLUS
       include "YOETHF.h"
-!
+
 ! Quelques constantes et options:
-!
+
 ! RKAR : constante de von Karman
       REAL, PARAMETER :: RKAR=0.40
@@ -394,5 +394,5 @@
       INTEGER, parameter :: niter=2, ncon=niter
 !     INTEGER, parameter :: niter=6, ncon=niter
-!
+
 ! Variables locales
       INTEGER :: i, n
@@ -419,5 +419,5 @@
       REAL, dimension(klon) :: u_zref_c, te_zref_c, temp_c, q_zref_c
       REAL, dimension(klon) :: ok_pred, ok_corr
-!
+
       REAL, dimension(klon) :: cdrm10m, cdrh10m, ri10m
       REAL, dimension(klon) :: cdmn10m, cdhn10m, fm10m, fh10m
@@ -435,10 +435,10 @@
 !------------------------------------------------------------------------- 
       CEPDUE=0.1
-!
+
 ! n2mout : compteur des pas de temps ou t2m,q2m ou u2m sont en dehors des intervalles
 !          [tsurf, temp], [qsurf, q1] ou [0, speed]
 ! n10mout : compteur des pas de temps ou t10m,q10m ou u10m sont en dehors des intervalles
 !          [tsurf, temp], [qsurf, q1] ou [0, speed]
-!
+
       n2mout(:,:)=0
       n10mout(:,:)=0
@@ -448,5 +448,5 @@
        ri1(i) = 0.0
       ENDDO
-!
+
       okri=.FALSE.
       CALL cdrag(knon, nsrf, &
@@ -456,5 +456,4 @@
                      cdram, cdrah, zri1, pref, prain, tsol, pat1)
 
-!
       DO i = 1, knon
         ri1(i) = zri1(i)
@@ -462,13 +461,13 @@
         zdu2 = MAX(CEPDUE*CEPDUE, speed(i)**2)
         ustar(i) = sqrt(cdram(i) * zdu2)
-!
-      ENDDO
-!
+
+      ENDDO
+
 !----------First aproximation of variables at zref --------------------------
       zref = 2.0
-!
+
 ! calcul first-guess en utilisant dans les calculs à 2m
 ! le Richardson de la premiere couche atmospherique 
-!
+
        CALL screencn(klon, knon, nsrf, zxli, &
                      speed, tpot, q1, zref, &
@@ -478,5 +477,5 @@
                      pref_new, delm_new, delh_new, ri2m, &
                      s_pblh, prain, tsol, pat1      )
-!
+
        DO i = 1, knon
          u_zref(i) = delm_new(i)*speed(i)
@@ -487,11 +486,11 @@
          te_zref(i) = delh_new(i)*tpot(i) + ts1(i)*(1-delh_new(i))
          te_zref_p(i) = te_zref(i)
-!
+
 ! return to normal temperature
          temp(i) = te_zref(i) * (psol(i)/pref_new(i))**(-RKAPPA)
          temp_p(i) = temp(i)
-!
+
 ! compteurs ici
-!
+
          ok_t2m_toosmall(i)=te_zref(i)<tpot(i).AND. &
    te_zref(i)<ts1(i)
@@ -503,5 +502,5 @@
    q_zref(i)>qsurf(i)
          ok_u2m_toobig(i)=u_zref(i)>speed(i)
-!
+
          IF(ok_t2m_toosmall(i).OR.ok_t2m_toobig(i)) THEN
              n2mout(i,1)=n2mout(i,1)+1
@@ -513,5 +512,5 @@
              n2mout(i,5)=n2mout(i,5)+1
          ENDIF
-!
+
          IF(ok_t2m_toosmall(i).OR.ok_t2m_toobig(i).OR. &
    ok_q2m_toosmall(i).OR.ok_q2m_toobig(i).OR. &
@@ -526,16 +525,16 @@
              te_zref(i) = delh_new(i)*tpot(i) + ts1(i)*(1-delh_new(i))
              te_zref_p(i) = te_zref(i)
-!
+
 ! return to normal temperature
              temp(i) = te_zref(i) * (psol(i)/pref_new(i))**(-RKAPPA)
              temp_p(i) = temp(i)
          ENDIF 
-!
+
        ENDDO
-!
+
 ! Iteration of the variables at the reference level zref : corrector calculation ; see Hess & McAvaney, 1995 
-!
+
       DO n = 1, niter
-!
+
         okri=.TRUE.
         CALL screencn(klon, knon, nsrf, zxli, &
@@ -546,5 +545,5 @@
                      pref, delm, delh, ri2m, &
                      s_pblh, prain, tsol, pat1      )
-!
+
         DO i = 1, knon
           u_zref(i) = delm(i)*speed(i)
@@ -552,10 +551,10 @@
              max(qsurf(i),0.0)*(1-delh(i))
           te_zref(i) = delh(i)*tpot(i) + ts1(i)*(1-delh(i))
-!
+
 ! return to normal temperature
           temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA)
-!
+
 ! compteurs ici
-!
+
           ok_t2m_toosmall(i)=te_zref(i)<tpot(i).AND. &
    te_zref(i)<ts1(i)
@@ -567,5 +566,5 @@
    q_zref(i)>qsurf(i)
           ok_u2m_toobig(i)=u_zref(i)>speed(i)
-!
+
           IF(ok_t2m_toosmall(i).OR.ok_t2m_toobig(i)) THEN
               n2mout(i,2)=n2mout(i,2)+1
@@ -577,5 +576,5 @@
               n2mout(i,6)=n2mout(i,6)+1
           ENDIF
-!
+
           IF(ok_t2m_toosmall(i).OR.ok_t2m_toobig(i).OR. &
    ok_q2m_toosmall(i).OR.ok_q2m_toobig(i).OR. &
@@ -589,34 +588,34 @@
               temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA)
           ENDIF
-!
-!
+
+
           IF(n==ncon) THEN
             te_zref_con(i) = te_zref(i)
             q_zref_con(i) = q_zref(i)
           ENDIF 
-!
+
         ENDDO 
-!
+
       ENDDO 
-!
+
       DO i = 1, knon
         q_zref_c(i) = q_zref(i)
         temp_c(i) = temp(i)
-!
+
         ok_pred(i)=0.
         ok_corr(i)=1.
-!
+
         t_2m(i) = temp_p(i) * ok_pred(i) + temp_c(i) * ok_corr(i)
         q_2m(i) = q_zref_p(i) * ok_pred(i) + q_zref_c(i) * ok_corr(i)
-!
+
         u_zref_c(i) = u_zref(i)
         u_2m(i) = u_zref_p(i) * ok_pred(i) + u_zref_c(i) * ok_corr(i)
       ENDDO
-!
-!
+
+
 !----------First aproximation of variables at zref --------------------------
-!
+
       zref = 10.0
-!
+
        CALL screencn(klon, knon, nsrf, zxli, &
                      speed, tpot, q1, zref, &
@@ -626,5 +625,5 @@
                      pref_new, delm_new, delh_new, ri10m, &
                      s_pblh, prain, tsol, pat1      )
-!
+
        DO i = 1, knon
          u_zref(i) = delm_new(i)*speed(i)
@@ -634,7 +633,7 @@
          temp(i) = te_zref(i) * (psol(i)/pref_new(i))**(-RKAPPA)
          u_zref_p(i) = u_zref(i)
-!
+
 ! compteurs ici
-!
+
          ok_t10m_toosmall(i)=te_zref(i)<tpot(i).AND. &
    te_zref(i)<ts1(i)
@@ -646,5 +645,5 @@
    q_zref(i)>qsurf(i)
          ok_u10m_toobig(i)=u_zref(i)>speed(i)
-!
+
          IF(ok_t10m_toosmall(i).OR.ok_t10m_toobig(i)) THEN
              n10mout(i,1)=n10mout(i,1)+1
@@ -656,5 +655,5 @@
              n10mout(i,5)=n10mout(i,5)+1
          ENDIF
-!
+
          IF(ok_t10m_toosmall(i).OR.ok_t10m_toobig(i).OR. &
    ok_q10m_toosmall(i).OR.ok_q10m_toobig(i).OR. &
@@ -669,11 +668,11 @@
              temp(i) = te_zref(i) * (psol(i)/pref_new(i))**(-RKAPPA)
          ENDIF 
-!
+
        ENDDO
-!
+
 ! Iteration of the variables at the reference level zref : corrector calculation ; see Hess & McAvaney, 1995 
-!
+
       DO n = 1, niter
-!
+
         okri=.TRUE.
         CALL screencn(klon, knon, nsrf, zxli, &
@@ -684,5 +683,5 @@
                      pref, delm, delh, ri10m, &
                      s_pblh, prain, tsol, pat1      )
-!
+
         DO i = 1, knon
           u_zref(i) = delm(i)*speed(i)
@@ -690,10 +689,10 @@
              max(qsurf(i),0.0)*(1-delh(i))
           te_zref(i) = delh(i)*tpot(i) + ts1(i)*(1-delh(i))
-!
+
 ! return to normal temperature
           temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA)
-!
+
 ! compteurs ici
-!
+
           ok_t10m_toosmall(i)=te_zref(i)<tpot(i).AND. &
    te_zref(i)<ts1(i)
@@ -705,5 +704,5 @@
    q_zref(i)>qsurf(i)
           ok_u10m_toobig(i)=u_zref(i)>speed(i)
-!
+
           IF(ok_t10m_toosmall(i).OR.ok_t10m_toobig(i)) THEN
               n10mout(i,2)=n10mout(i,2)+1
@@ -715,5 +714,5 @@
               n10mout(i,6)=n10mout(i,6)+1
           ENDIF
-!
+
           IF(ok_t10m_toosmall(i).OR.ok_t10m_toobig(i).OR. &
    ok_q10m_toosmall(i).OR.ok_q10m_toobig(i).OR. &
@@ -727,29 +726,29 @@
               temp(i) = te_zref(i) * (psol(i)/pref(i))**(-RKAPPA)
           ENDIF
-!
-!
+
+
           IF(n==ncon) THEN
             te_zref_con(i) = te_zref(i)
             q_zref_con(i) = q_zref(i)
           ENDIF 
-!
+
         ENDDO 
-!
+
       ENDDO 
-!
+
       DO i = 1, knon
         q_zref_c(i) = q_zref(i)
         temp_c(i) = temp(i)
-!
+
         ok_pred(i)=0.
         ok_corr(i)=1.
-!
+
         t_10m(i) = temp_p(i) * ok_pred(i) + temp_c(i) * ok_corr(i)
         q_10m(i) = q_zref_p(i) * ok_pred(i) + q_zref_c(i) * ok_corr(i)
-!
+
         u_zref_c(i) = u_zref(i)
         u_10m(i) = u_zref_p(i) * ok_pred(i) + u_zref_c(i) * ok_corr(i)
       ENDDO
-!
+
       RETURN
       END subroutine stdlevvarn
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/stratocu_if.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/stratocu_if.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/stratocu_if.F90	(revision 5099)
@@ -10,5 +10,5 @@
 ! ou une forte inversion est presente
 ! On peut dire qu'il represente la convection peu profonde
-!
+
 ! Arguments:
 ! klon-----input-I- nombre de points a traiter
@@ -16,10 +16,10 @@
 ! pplay----input-R- pression au milieu de chaque couche (en Pa)
 ! t--------input-R- temperature (K)
-!
+
 ! weak_inversion-----logical
 !======================================================================
-!
+
 ! Arguments:
-!
+
     INTEGER, INTENT(IN)                       :: klon,klev
     REAL, DIMENSION(klon, klev+1), INTENT(IN) ::  paprs
@@ -29,13 +29,12 @@
     
     REAL, DIMENSION(klon), INTENT(OUT)  :: weak_inversion
-!
+
 ! Quelques constantes et options:
-!
+
     REAL seuil_inversion ! au-dela l'inversion est consideree trop faible
 !    PARAMETER (seuil=-0.1)
 
-!
 ! Variables locales:
-!
+
     INTEGER i, k, invb(klon)
     REAL zl2(klon)
@@ -44,7 +43,5 @@
     INCLUDE "YOMCST.h"
 
-!
 ! Chercher la zone d'inversion forte
-!
 
     DO i = 1, klon
@@ -65,8 +62,6 @@
     ENDDO
 
+! Introduire une diffusion:
 
-!
-! Introduire une diffusion:
-!
     DO i = 1, klon
        IF ( (pctsrf(i,is_oce) < 0.5) .OR. &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/stratosphere_mask.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/stratosphere_mask.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/stratosphere_mask.F90	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE stratosphere_mask(missing_val, pphis, t_seri, pplay, xlat)
 
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
+
 ! determination of tropopause height and temperature from gridded temperature data
-!
+
 ! reference: Reichler, T., M. Dameris, and R. Sausen (GRL, 10.1029/2003GL018240, 2003)
 ! modified: 6/28/06 tjr
@@ -13,5 +13,5 @@
 ! committed to LMDz by O. Boucher (2016) with a mistake 
 ! mistake corrected by O. Boucher (2017-12-11)
-!
+
 ! input:  temp(nlon,nlat,nlev)  3D-temperature field 
 !         ps(nlon,nlat)         2D-surface pressure field
@@ -23,5 +23,5 @@
 !         pliml                 lower limit for tropopause pressure 
 !         gamma                 tropopause criterion, e.g. -0.002 K/m
-!
+
 ! output: p_tropopause(klon)    tropopause pressure in Pa with missing values
 !         t_tropopause(klon)    tropopause temperature in K with missing values
@@ -29,5 +29,5 @@
 !         stratomask            stratospheric mask withtout missing values
 !         ifil                  # of undetermined values
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
@@ -83,7 +83,7 @@
   ENDIF
   ENDDO
-!
+
 ENDIF
-!
+
 DO i=1, klon
 DO k=1, klev
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_bucket_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_bucket_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_bucket_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 MODULE surf_land_bucket_mod
-!
+
 ! Surface land bucket module
-!
+
 ! This module is used when no external land model is choosen.
-!
+
   IMPLICIT NONE
 
@@ -46,5 +46,5 @@
 !****************************************************************************************
 ! Bucket calculations for surface. 
-!
+
     INCLUDE "clesphys.h"
     INCLUDE "dimsoil.h"
@@ -121,5 +121,5 @@
     REAL :: coeff_rel_diag
 #endif 
-!
+
 !****************************************************************************************
 
@@ -148,13 +148,11 @@
 #endif
 
-!
 !* Read from limit.nc : albedo(alb_lim), length of rugosity(z0_new)
-!
+
     CALL limit_read_rug_alb(itime, dtime, jour,&
          knon, knindex, &
          z0_new, alb_lim)
-!
+
 !* Calcultaion of fluxes 
-!
 
 ! calculate total absorbed radiance at surface
@@ -234,7 +232,7 @@
 #endif    
 #endif    
-!
+
 !* Calculate snow height, run_off, age of snow
-!      
+
     CALL fonte_neige( knon, is_ter, knindex, dtime, &
          tsurf, precip_rain, precip_snow, &
@@ -299,7 +297,6 @@
 #endif
 
-!
 !* Calculate the age of snow
-!
+
     CALL albsno(klon,knon,dtime,agesno(:),alb_neig(:), precip_snow(:))  
     
@@ -311,16 +308,14 @@
     END DO
 
-!
 !* Return albedo : 
 !    alb1_new and alb2_new are here given the same values
-!
+
     alb1_new(:) = 0.0
     alb2_new(:) = 0.0
     alb1_new(1:knon) = alb_lim(1:knon)
     alb2_new(1:knon) = alb_lim(1:knon)
-       
-!
+
 !* Calculate the rugosity
-!
+
     DO i = 1, knon
        z0_new(i) = MAX(1.5e-05,SQRT(z0_new(i)**2 + rugoro(i)**2))
@@ -337,10 +332,9 @@
     ENDIF
 
-!
 !* End
-!
+
   END SUBROUTINE surf_land_bucket
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE surf_land_bucket_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_mod.F90	(revision 5099)
@@ -1,3 +1,3 @@
-!
+
 MODULE surf_land_mod
 
@@ -5,7 +5,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land(itime, dtime, date0, jour, knon, knindex, &
        rlon, rlat, yrmu0, &
@@ -202,10 +202,10 @@
 !**************************************************************************************** 
 ! Choice between call to vegetation model (ok_veget=true) or simple calculation below
-!
+
 !****************************************************************************************
    IF (ok_veget) THEN
 !****************************************************************************************
 !  Call model sechiba in model ORCHIDEE
-!
+
 !****************************************************************************************
        p1lay_tmp(:)      = 0.0
@@ -213,14 +213,14 @@
        p1lay_tmp(1:knon) = p1lay(1:knon)/100.
        pref_tmp(1:knon)  = pref(1:knon)/100.
-! 
+
 !* Calculate incoming flux for SW and LW interval: swdown
-!
+
        swdown(:) = 0.0
        DO i = 1, knon
           swdown(i) = swnet(i)/(1-albedo(i))
        END DO
-!
+
 !* Calculate potential air temperature
-!
+
        epot_air(:) = 0.0
        DO i = 1, knon
@@ -259,7 +259,7 @@
 #endif
 #endif
-!  
+
 !* Add contribution of relief to surface roughness
-!  
+
        DO i=1,knon
           z0m(i) = MAX(1.5e-05,SQRT(z0m(i)**2 + rugoro(i)**2))
@@ -269,5 +269,5 @@
 !****************************************************************************************
 ! No extern vegetation model choosen, call simple bucket calculations instead.
-!
+
 !****************************************************************************************
 #ifdef ISO
@@ -430,9 +430,7 @@
 #endif
 
-!
-!****************************************************************************************
-!  
+!****************************************************************************************
+
 END MODULE surf_land_mod
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_mod.F90	(revision 5099)
@@ -1,3 +1,3 @@
-!
+
 MODULE surf_land_orchidee_mod
 #ifndef ORCHIDEE_NOOPENMP
@@ -6,12 +6,12 @@
 #ifndef ORCHIDEE_NOUNSTRUCT
 #ifndef ORCHIDEE_NOLIC
-!
+
 ! This module controles the interface towards the model ORCHIDEE.
-!
+
 ! Compatibility with ORCHIDIEE :
 ! The current version can be used with ORCHIDEE/trunk from revision 7757. 
 ! This interface is used if none of the cpp keys ORCHIDEE_NOOPENMP, 
 ! ORCHIDEE_NOZ0H, ORCHIDEE_NOFREIN or ORCHIDEE_NOLIC is set.
-!
+
 ! Subroutines in this module : surf_land_orchidee
 !                              Init_orchidee_index
@@ -37,7 +37,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land_orchidee(itime, dtime, date0, knon, &
        knindex, rlon, rlat, yrmu0, pctsrf, &
@@ -61,10 +61,10 @@
     USE time_phylmdz_mod, ONLY: itau_phy 
 #endif
-!    
+
 ! Cette routine sert d'interface entre le modele atmospherique et le 
 ! modele de sol continental. Appel a sechiba
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps
@@ -99,5 +99,5 @@
 !   ps           pression au sol
 !   radsol       rayonnement net aus sol (LW + SW)
-!
+
 ! output:
 !   evap         evaporation totale
@@ -112,8 +112,8 @@
 !   z0h_new      surface roughness for heat
 !   qsurf        air moisture at surface
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "dimpft.h"
-!
+
 ! Parametres d'entree
 !****************************************************************************************
@@ -235,5 +235,5 @@
     !$OMP THREADPRIVATE(ind_cell)
     INTEGER :: begin, end
-!
+
 ! Fin definition
 !****************************************************************************************
@@ -393,7 +393,7 @@
        
        ENDIF
-!
+
 ! Allouer et initialiser le tableau des voisins et des fraction de continents
-!
+
        IF (( .NOT. ALLOCATED(contfrac))) THEN
           ALLOCATE(contfrac(knon), stat = error)
@@ -434,7 +434,5 @@
  
        ENDIF
-         
-
-!
+
 !  Allocation et calcul resolutions
        IF ( (.NOT.ALLOCATED(resolution))) THEN
@@ -465,7 +463,7 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-!
+
 ! carbon_cycle_cpl not possible with this interface and version of ORHCHIDEE
-!
+
 ! >> PC
 !       IF (carbon_cycle_cpl) THEN
@@ -476,8 +474,7 @@
        
     ENDIF                          ! (fin debut) 
- 
-! 
+
 ! Appel a la routine sols continentaux
-!
+
     IF (lafin) lrestart_write = .TRUE.
     IF (check) WRITE(lunout,*)'lafin ',lafin,lrestart_write
@@ -617,5 +614,5 @@
 
 !* Send to coupler
-!
+
     IF (type_ocean=='couple') THEN
        CALL cpl_send_land_fields(itime, knon, knindex, &
@@ -656,7 +653,7 @@
     
   END SUBROUTINE surf_land_orchidee
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE Init_orchidee_index(knon,knindex,offset,ktindex)
   USE mod_surf_para
@@ -695,7 +692,5 @@
   END SUBROUTINE Init_orchidee_index
 
-!
 !************************* ***************************************************************
-! 
 
   SUBROUTINE Get_orchidee_communicator(orch_comm, orch_mpi_size, orch_mpi_rank, orch_omp_size,orch_omp_rank)
@@ -710,5 +705,5 @@
     INTEGER             :: color
     INTEGER             :: i,ierr
-!
+
 ! End definition
 !****************************************************************************************
@@ -742,7 +737,6 @@
     
   END SUBROUTINE Get_orchidee_communicator
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
 
   SUBROUTINE Init_neighbours(knon,neighbours,knindex,pctsrf)
@@ -773,5 +767,5 @@
     REAL, DIMENSION(klon_glo)            :: pctsrf_glo
     INTEGER                              :: ktindex(klon)
-!
+
 ! End definition
 !****************************************************************************************
@@ -785,5 +779,5 @@
       neighbours_glo(:,:)=-1
 !  Initialisation des offset    
-!
+
 ! offset bord ouest
        off_ini(1,1) = - nbp_lon   ; off_ini(2,1) = - nbp_lon + 1     ; off_ini(3,1) = 1
@@ -798,7 +792,7 @@
        off_ini(4,3) =  1          ; off_ini(5,3) = nbp_lon           ; off_ini(6,3) = nbp_lon - 1
        off_ini(7,3) = -1          ; off_ini(8,3) = - nbp_lon - 1
-!
+
 ! Attention aux poles
-!
+
        DO igrid = 1, knon_glo
           index = ktindex_glo(igrid)
@@ -845,7 +839,6 @@
   END SUBROUTINE Init_neighbours
 
-!
-!****************************************************************************************
-!
+!****************************************************************************************
+
 #endif
 #endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nofrein_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nofrein_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nofrein_mod.F90	(revision 5099)
@@ -1,17 +1,17 @@
-!
+
 ! $Id$
-!
-!
+
+
 MODULE surf_land_orchidee_nofrein_mod
 #ifdef ORCHIDEE_NOFREIN
-!
+
 ! This module controles the interface towards the model ORCHIDEE.
-!
+
 ! Compatibility with ORCHIDIEE :
 ! This module is compiled only if cpp key ORCHIDEE_NOFREIN is defined. 
 ! The current version can be used with ORCHIDEE/trunk from revision 3525-4465 
 ! (it can be used for later revisions also but it is not needed.)
-! 
-!
+
+
 ! Subroutines in this module : surf_land_orchidee
 !                              Init_orchidee_index
@@ -35,7 +35,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land_orchidee(itime, dtime, date0, knon, &
        knindex, rlon, rlat, yrmu0, pctsrf, &
@@ -60,10 +60,10 @@
     USE time_phylmdz_mod, ONLY: itau_phy 
 #endif
-!    
+
 ! Cette routine sert d'interface entre le modele atmospherique et le 
 ! modele de sol continental. Appel a sechiba
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps
@@ -98,6 +98,6 @@
 !   ps           pression au sol
 !   radsol       rayonnement net aus sol (LW + SW)
-!   
-!
+
+
 ! output:
 !   evap         evaporation totale
@@ -112,11 +112,9 @@
 !   z0h_new      surface roughness for heat
 !   qsurf        air moisture at surface
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "dimpft.h"
     INCLUDE "compbl.h"
 
-  
-!
 ! Parametres d'entree
 !****************************************************************************************
@@ -218,5 +216,5 @@
     INTEGER :: orch_omp_rank
     INTEGER :: orch_omp_size
-!
+
 ! Fin definition
 !****************************************************************************************
@@ -316,7 +314,7 @@
        CALL bcast(lon_scat)
        CALL bcast(lat_scat)
-!
+
 ! Allouer et initialiser le tableau des voisins et des fraction de continents
-!
+
        IF ( (.NOT.ALLOCATED(neighbours))) THEN
           ALLOCATE(neighbours(knon,8), stat = error)
@@ -343,5 +341,4 @@
        CALL Init_neighbours(knon,neighbours,knindex,pctsrf(:,is_ter))
 
-!
 !  Allocation et calcul resolutions
        IF ( (.NOT.ALLOCATED(resolution))) THEN
@@ -369,7 +366,7 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-!
+
 ! carbon_cycle_cpl not possible with this interface and version of ORHCHIDEE
-!
+
        IF (carbon_cycle_cpl) THEN
           abort_message='carbon_cycle_cpl not yet possible with this interface of ORCHIDEE'
@@ -378,9 +375,7 @@
        
     ENDIF                          ! (fin debut) 
- 
-
-! 
+
 ! Appel a la routine sols continentaux
-!
+
     IF (lafin) lrestart_write = .TRUE.
     IF (check) WRITE(lunout,*)'lafin ',lafin,lrestart_write
@@ -461,5 +456,5 @@
 
 !* Send to coupler
-!
+
     IF (type_ocean=='couple') THEN
        CALL cpl_send_land_fields(itime, knon, knindex, &
@@ -482,7 +477,7 @@
     
   END SUBROUTINE surf_land_orchidee
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE Init_orchidee_index(knon,knindex,offset,ktindex)
   USE mod_surf_para
@@ -521,7 +516,5 @@
   END SUBROUTINE Init_orchidee_index
 
-!
 !************************* ***************************************************************
-! 
 
   SUBROUTINE Get_orchidee_communicator(orch_comm,orch_omp_size,orch_omp_rank)
@@ -534,5 +527,5 @@
     INTEGER             :: color
     INTEGER             :: i,ierr
-!
+
 ! End definition
 !****************************************************************************************
@@ -566,7 +559,6 @@
     
   END SUBROUTINE Get_orchidee_communicator
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
 
   SUBROUTINE Init_neighbours(knon,neighbours,knindex,pctsrf)
@@ -597,5 +589,5 @@
     REAL, DIMENSION(klon_glo)            :: pctsrf_glo
     INTEGER                              :: ktindex(klon)
-!
+
 ! End definition
 !****************************************************************************************
@@ -609,5 +601,5 @@
       neighbours_glo(:,:)=-1
 !  Initialisation des offset    
-!
+
 ! offset bord ouest
        off_ini(1,1) = - nbp_lon   ; off_ini(2,1) = - nbp_lon + 1     ; off_ini(3,1) = 1
@@ -622,8 +614,8 @@
        off_ini(4,3) =  1          ; off_ini(5,3) = nbp_lon           ; off_ini(6,3) = nbp_lon - 1
        off_ini(7,3) = -1          ; off_ini(8,3) = - nbp_lon - 1
-!
-!
+
+
 ! Attention aux poles
-!
+
        DO igrid = 1, knon_glo
           index = ktindex_glo(igrid)
@@ -671,7 +663,6 @@
   END SUBROUTINE Init_neighbours
 
-!
-!****************************************************************************************
-!
+!****************************************************************************************
+
 #endif
 END MODULE surf_land_orchidee_nofrein_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nolic_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nolic_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nolic_mod.F90	(revision 5099)
@@ -1,13 +1,13 @@
-!
+
 MODULE surf_land_orchidee_nolic_mod
 #ifdef ORCHIDEE_NOLIC
-!
+
 ! This module controles the interface towards the model ORCHIDEE.
-!
+
 ! Compatibility with ORCHIDIEE :
 ! This module is compiled only if cpp key ORCHIDEE_NOLIC is defined. 
 ! The current version can be used with ORCHIDEE/trunk from revision 4465-7757. 
 ! (it can be used for later revisions also but it is not needed.)
-! 
+
 ! Subroutines in this module : surf_land_orchidee
 !                              Init_orchidee_index
@@ -33,7 +33,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land_orchidee(itime, dtime, date0, knon, &
        knindex, rlon, rlat, yrmu0, pctsrf, &
@@ -57,10 +57,10 @@
     USE time_phylmdz_mod, ONLY: itau_phy 
 #endif
-!    
+
 ! Cette routine sert d'interface entre le modele atmospherique et le 
 ! modele de sol continental. Appel a sechiba
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps
@@ -95,5 +95,5 @@
 !   ps           pression au sol
 !   radsol       rayonnement net aus sol (LW + SW)
-!
+
 ! output:
 !   evap         evaporation totale
@@ -108,8 +108,8 @@
 !   z0h_new      surface roughness for heat
 !   qsurf        air moisture at surface
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "dimpft.h"
-!
+
 ! Parametres d'entree
 !****************************************************************************************
@@ -228,5 +228,5 @@
     !$OMP THREADPRIVATE(ind_cell)
     INTEGER :: begin, end
-!
+
 ! Fin definition
 !****************************************************************************************
@@ -386,7 +386,7 @@
        
        ENDIF
-!
+
 ! Allouer et initialiser le tableau des voisins et des fraction de continents
-!
+
        IF (( .NOT. ALLOCATED(contfrac))) THEN
           ALLOCATE(contfrac(knon), stat = error)
@@ -427,7 +427,5 @@
  
        ENDIF
-         
-
-!
+
 !  Allocation et calcul resolutions
        IF ( (.NOT.ALLOCATED(resolution))) THEN
@@ -458,7 +456,7 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-!
+
 ! carbon_cycle_cpl not possible with this interface and version of ORHCHIDEE
-!
+
 ! >> PC
 !       IF (carbon_cycle_cpl) THEN
@@ -469,8 +467,7 @@
        
     ENDIF                          ! (fin debut) 
- 
-! 
+
 ! Appel a la routine sols continentaux
-!
+
     IF (lafin) lrestart_write = .TRUE.
     IF (check) WRITE(lunout,*)'lafin ',lafin,lrestart_write
@@ -609,5 +606,5 @@
 
 !* Send to coupler
-!
+
     IF (type_ocean=='couple') THEN
        CALL cpl_send_land_fields(itime, knon, knindex, &
@@ -645,7 +642,7 @@
     
   END SUBROUTINE surf_land_orchidee
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE Init_orchidee_index(knon,knindex,offset,ktindex)
   USE mod_surf_para
@@ -684,7 +681,5 @@
   END SUBROUTINE Init_orchidee_index
 
-!
 !************************* ***************************************************************
-! 
 
   SUBROUTINE Get_orchidee_communicator(orch_comm, orch_mpi_size, orch_mpi_rank, orch_omp_size,orch_omp_rank)
@@ -699,5 +694,5 @@
     INTEGER             :: color
     INTEGER             :: i,ierr
-!
+
 ! End definition
 !****************************************************************************************
@@ -731,7 +726,6 @@
     
   END SUBROUTINE Get_orchidee_communicator
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
 
   SUBROUTINE Init_neighbours(knon,neighbours,knindex,pctsrf)
@@ -762,5 +756,5 @@
     REAL, DIMENSION(klon_glo)            :: pctsrf_glo
     INTEGER                              :: ktindex(klon)
-!
+
 ! End definition
 !****************************************************************************************
@@ -774,5 +768,5 @@
       neighbours_glo(:,:)=-1
 !  Initialisation des offset    
-!
+
 ! offset bord ouest
        off_ini(1,1) = - nbp_lon   ; off_ini(2,1) = - nbp_lon + 1     ; off_ini(3,1) = 1
@@ -787,7 +781,7 @@
        off_ini(4,3) =  1          ; off_ini(5,3) = nbp_lon           ; off_ini(6,3) = nbp_lon - 1
        off_ini(7,3) = -1          ; off_ini(8,3) = - nbp_lon - 1
-!
+
 ! Attention aux poles
-!
+
        DO igrid = 1, knon_glo
           index = ktindex_glo(igrid)
@@ -834,7 +828,6 @@
   END SUBROUTINE Init_neighbours
 
-!
-!****************************************************************************************
-!
+!****************************************************************************************
+
 #endif
 END MODULE surf_land_orchidee_nolic_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_noopenmp_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Header$
-!
+
 MODULE surf_land_orchidee_noopenmp_mod
-!
+
 ! This module is compiled only if CPP key ORCHIDEE_NOOPENMP is defined.
 ! This module should be used with ORCHIDEE sequentiel or parallele MPI version 
@@ -9,7 +9,7 @@
 
 #ifdef ORCHIDEE_NOOPENMP
-!
+
 ! This module controles the interface towards the model ORCHIDEE
-!
+
 ! Subroutines in this module : surf_land_orchidee
 !                              Init_orchidee_index
@@ -32,7 +32,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land_orchidee(itime, dtime, date0, knon, &
        knindex, rlon, rlat, yrmu0, pctsrf, &
@@ -46,10 +46,10 @@
        emis_new, z0_new, z0h_new, qsurf, &
        veget, lai, height)
-!    
+
 ! Cette routine sert d'interface entre le modele atmospherique et le 
 ! modele de sol continental. Appel a sechiba
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps
@@ -84,6 +84,6 @@
 !   ps           pression au sol
 !   radsol       rayonnement net aus sol (LW + SW)
-!   
-!
+
+
 ! output:
 !   evap         evaporation totale
@@ -98,5 +98,5 @@
 !   z0h_new      surface roughness, it is the same as z0_new
 !   qsurf        air moisture at surface
-!
+
     USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, fco2_land_inst, fco2_lu_inst
     USE indice_sol_mod
@@ -110,5 +110,5 @@
     INCLUDE "YOMCST.h"
     INCLUDE "dimpft.h"  
-!
+
 ! Parametres d'entree
 !****************************************************************************************
@@ -211,5 +211,5 @@
     REAL, ALLOCATABLE, DIMENSION(:), SAVE     :: riverflow
     !$OMP THREADPRIVATE(riverflow)
-!
+
 ! Fin definition
 !****************************************************************************************
@@ -305,7 +305,6 @@
        CALL bcast(lat_scat) 
 
-!
 ! Allouer et initialiser le tableau des voisins et des fraction de continents
-!
+
        IF ( (.NOT.ALLOCATED(neighbours))) THEN
           ALLOCATE(neighbours(knon,8), stat = error)
@@ -332,5 +331,4 @@
        CALL Init_neighbours(knon,neighbours,knindex,pctsrf(:,is_ter))
 
-!
 !  Allocation et calcul resolutions
        IF ( (.NOT.ALLOCATED(resolution))) THEN
@@ -359,5 +357,4 @@
        ENDIF
 
-!
 ! Allocate variables needed for carbon_cycle_mod
        IF ( carbon_cycle_cpl ) THEN
@@ -381,7 +378,6 @@
     ENDIF                          ! (fin debut) 
 
-! 
 ! Appel a la routine sols continentaux
-!
+
     IF (lafin) lrestart_write = .TRUE.
     IF (check) WRITE(lunout,*)'lafin ',lafin,lrestart_write
@@ -405,7 +401,6 @@
 !  write(*,*)'Cdrag = ',minval(cdrag),maxval(cdrag)
 
-!
 ! Init Orchidee
-!
+
 !  if (pole_nord) then 
 !    offset=0
@@ -507,5 +502,5 @@
 
 !* Send to coupler
-!
+
     IF (type_ocean=='couple') THEN
        CALL cpl_send_land_fields(itime, knon, knindex, &
@@ -538,7 +533,7 @@
 #endif    
   END SUBROUTINE surf_land_orchidee
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE Init_orchidee_index(knon,orch_comm,knindex,offset,ktindex)
     
@@ -566,5 +561,5 @@
     INTEGER                               :: mpi_size_orch
     INTEGER                               :: ierr 
-!
+
 ! End definition
 !****************************************************************************************
@@ -600,7 +595,7 @@
 
   END SUBROUTINE  Init_orchidee_index
-!
-!****************************************************************************************
-! 
+
+!****************************************************************************************
+
   SUBROUTINE Get_orchidee_communicator(knon,orch_comm)
   USE lmdz_mpi
@@ -611,5 +606,5 @@
     INTEGER             :: color
     INTEGER             :: ierr
-!
+
 ! End definition
 !****************************************************************************************
@@ -626,7 +621,7 @@
     
   END SUBROUTINE Get_orchidee_communicator
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE Init_neighbours(knon,neighbours,ktindex,pctsrf)
     
@@ -660,6 +655,5 @@
     INTEGER, ALLOCATABLE, DIMENSION(:,:) :: neighbours_g
     REAL, DIMENSION(klon_glo)            :: pctsrf_g
-    
-!
+
 ! End definition
 !****************************************************************************************
@@ -698,5 +692,5 @@
     IF (is_mpi_root) THEN
 !  Initialisation des offset    
-!
+
 ! offset bord ouest
        off_ini(1,1) = - nbp_lon  ; off_ini(2,1) = - nbp_lon + 1; off_ini(3,1) = 1
@@ -711,8 +705,8 @@
        off_ini(4,3) =  1   ; off_ini(5,3) = nbp_lon          ; off_ini(6,3) = nbp_lon - 1
        off_ini(7,3) = -1   ; off_ini(8,3) = - nbp_lon - 1
-!
-!
+
+
 ! Attention aux poles
-!
+
        DO igrid = 1, knon_g
           index = ktindex_g(igrid)
@@ -759,7 +753,6 @@
     
   END SUBROUTINE Init_neighbours
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
 
 #endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nounstruct_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nounstruct_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_nounstruct_mod.F90	(revision 5099)
@@ -1,13 +1,13 @@
-!
+
 MODULE surf_land_orchidee_nounstruct_mod
 #ifndef ORCHIDEE_NOZ0H
 #ifdef ORCHIDEE_NOUNSTRUCT
-!
+
 ! This module controles the interface towards the model ORCHIDEE.
-!
+
 ! Compatibility with ORCHIDIEE :
 ! The current version can be used with ORCHIDEE/trunk from revision xxxx.
 ! This module is compiled only if cpp key ORCHIDEE_NOUNSTRUCT is defined.
-!
+
 ! Subroutines in this module : surf_land_orchidee
 !                              Init_orchidee_index
@@ -31,7 +31,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land_orchidee(itime, dtime, date0, knon, &
        knindex, rlon, rlat, yrmu0, pctsrf, &
@@ -56,10 +56,10 @@
     USE time_phylmdz_mod, ONLY: itau_phy 
 #endif
-!    
+
 ! Cette routine sert d'interface entre le modele atmospherique et le 
 ! modele de sol continental. Appel a sechiba
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps
@@ -94,6 +94,6 @@
 !   ps           pression au sol
 !   radsol       rayonnement net aus sol (LW + SW)
-!   
-!
+
+
 ! output:
 !   evap         evaporation totale
@@ -108,11 +108,8 @@
 !   z0h_new      surface roughness for heat
 !   qsurf        air moisture at surface
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "dimpft.h"
 
-
-  
-!
 ! Parametres d'entree
 !****************************************************************************************
@@ -214,5 +211,5 @@
     INTEGER :: orch_omp_rank
     INTEGER :: orch_omp_size
-!
+
 ! Fin definition
 !****************************************************************************************
@@ -307,7 +304,7 @@
        CALL bcast(lon_scat)
        CALL bcast(lat_scat)
-!
+
 ! Allouer et initialiser le tableau des voisins et des fraction de continents
-!
+
        IF ( (.NOT.ALLOCATED(neighbours))) THEN
           ALLOCATE(neighbours(knon,8), stat = error)
@@ -334,5 +331,4 @@
        CALL Init_neighbours(knon,neighbours,knindex,pctsrf(:,is_ter))
 
-!
 !  Allocation et calcul resolutions
        IF ( (.NOT.ALLOCATED(resolution))) THEN
@@ -360,7 +356,7 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-!
+
 ! carbon_cycle_cpl not possible with this interface and version of ORHCHIDEE
-!
+
        IF (carbon_cycle_cpl) THEN
           abort_message='carbon_cycle_cpl not yet possible with this interface of ORCHIDEE'
@@ -369,9 +365,7 @@
        
     ENDIF                          ! (fin debut) 
- 
-
-! 
+
 ! Appel a la routine sols continentaux
-!
+
     IF (lafin) lrestart_write = .TRUE.
     IF (check) WRITE(lunout,*)'lafin ',lafin,lrestart_write
@@ -459,5 +453,5 @@
 
 !* Send to coupler
-!
+
     IF (type_ocean=='couple') THEN
        CALL cpl_send_land_fields(itime, knon, knindex, &
@@ -480,7 +474,7 @@
     
   END SUBROUTINE surf_land_orchidee
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE Init_orchidee_index(knon,knindex,offset,ktindex)
   USE mod_surf_para
@@ -519,7 +513,5 @@
   END SUBROUTINE Init_orchidee_index
 
-!
 !************************* ***************************************************************
-! 
 
   SUBROUTINE Get_orchidee_communicator(orch_comm,orch_omp_size,orch_omp_rank)
@@ -532,5 +524,5 @@
     INTEGER             :: color
     INTEGER             :: i,ierr
-!
+
 ! End definition
 !****************************************************************************************
@@ -564,7 +556,6 @@
     
   END SUBROUTINE Get_orchidee_communicator
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
 
   SUBROUTINE Init_neighbours(knon,neighbours,knindex,pctsrf)
@@ -595,5 +586,5 @@
     REAL, DIMENSION(klon_glo)            :: pctsrf_glo
     INTEGER                              :: ktindex(klon)
-!
+
 ! End definition
 !****************************************************************************************
@@ -607,5 +598,5 @@
       neighbours_glo(:,:)=-1
 !  Initialisation des offset    
-!
+
 ! offset bord ouest
        off_ini(1,1) = - nbp_lon   ; off_ini(2,1) = - nbp_lon + 1     ; off_ini(3,1) = 1
@@ -620,8 +611,8 @@
        off_ini(4,3) =  1          ; off_ini(5,3) = nbp_lon           ; off_ini(6,3) = nbp_lon - 1
        off_ini(7,3) = -1          ; off_ini(8,3) = - nbp_lon - 1
-!
-!
+
+
 ! Attention aux poles
-!
+
        DO igrid = 1, knon_glo
           index = ktindex_glo(igrid)
@@ -669,7 +660,6 @@
   END SUBROUTINE Init_neighbours
 
-!
-!****************************************************************************************
-!
+!****************************************************************************************
+
 #endif
 #endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_noz0h_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_noz0h_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_land_orchidee_noz0h_mod.F90	(revision 5099)
@@ -1,8 +1,8 @@
-!
+
 MODULE surf_land_orchidee_noz0h_mod
 #ifdef ORCHIDEE_NOZ0H
-!
+
 ! This module controles the interface towards the model ORCHIDEE.
-!
+
 ! Compatibility with ORCHIDIEE :
 ! This module is compiled only if CPP key ORCHIDEE_NOZ0H is defined.
@@ -12,5 +12,5 @@
 ! This interface can also be used with ORCHIDEE/trunk revision 1078-2960 if changing 
 ! coszang=yrmu0 into sinang=yrmu0 at 2 places later below in this module. 
-!
+
 ! Subroutines in this module : surf_land_orchidee
 !                              Init_orchidee_index
@@ -34,7 +34,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
+
   SUBROUTINE surf_land_orchidee(itime, dtime, date0, knon, &
        knindex, rlon, rlat, yrmu0, pctsrf, &
@@ -58,10 +58,10 @@
     USE time_phylmdz_mod, ONLY: itau_phy 
 #endif
-!    
+
 ! Cette routine sert d'interface entre le modele atmospherique et le 
 ! modele de sol continental. Appel a sechiba
-!
+
 ! L. Fairhead 02/2000
-!
+
 ! input:
 !   itime        numero du pas de temps
@@ -96,6 +96,6 @@
 !   ps           pression au sol
 !   radsol       rayonnement net aus sol (LW + SW)
-!   
-!
+
+
 ! output:
 !   evap         evaporation totale
@@ -110,9 +110,9 @@
 !   z0h_new      surface roughness, it is a copy from z0_new
 !   qsurf        air moisture at surface
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "dimpft.h"  
     INCLUDE "compbl.h"
-!
+
 ! Parametres d'entree
 !****************************************************************************************
@@ -213,5 +213,5 @@
     INTEGER :: orch_omp_rank
     INTEGER :: orch_omp_size
-!
+
 ! Fin definition
 !****************************************************************************************
@@ -311,7 +311,7 @@
        CALL bcast(lon_scat)
        CALL bcast(lat_scat)
-!
+
 ! Allouer et initialiser le tableau des voisins et des fraction de continents
-!
+
        IF ( (.NOT.ALLOCATED(neighbours))) THEN
           ALLOCATE(neighbours(knon,8), stat = error)
@@ -338,5 +338,4 @@
        CALL Init_neighbours(knon,neighbours,knindex,pctsrf(:,is_ter))
 
-!
 !  Allocation et calcul resolutions
        IF ( (.NOT.ALLOCATED(resolution))) THEN
@@ -364,7 +363,7 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-!
+
 ! carbon_cycle_cpl not possible with this interface and version of ORHCHIDEE
-!
+
        IF (carbon_cycle_cpl) THEN
           abort_message='carbon_cycle_cpl not yet possible with this interface of ORCHIDEE'
@@ -373,9 +372,7 @@
        
     ENDIF                          ! (fin debut) 
- 
-
-! 
+
 ! Appel a la routine sols continentaux
-!
+
     IF (lafin) lrestart_write = .TRUE.
     IF (check) WRITE(lunout,*)'lafin ',lafin,lrestart_write
@@ -459,5 +456,5 @@
 
 !* Send to coupler
-!
+
     IF (type_ocean=='couple') THEN
        CALL cpl_send_land_fields(itime, knon, knindex, &
@@ -480,7 +477,7 @@
     
   END SUBROUTINE surf_land_orchidee
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE Init_orchidee_index(knon,knindex,offset,ktindex)
   USE mod_surf_para
@@ -519,7 +516,5 @@
   END SUBROUTINE Init_orchidee_index
 
-!
 !************************* ***************************************************************
-! 
 
   SUBROUTINE Get_orchidee_communicator(orch_comm,orch_omp_size,orch_omp_rank)
@@ -532,5 +527,5 @@
     INTEGER             :: color
     INTEGER             :: i,ierr
-!
+
 ! End definition
 !****************************************************************************************
@@ -564,7 +559,6 @@
     
   END SUBROUTINE Get_orchidee_communicator
-!
-!****************************************************************************************
-!  
+
+!****************************************************************************************
 
   SUBROUTINE Init_neighbours(knon,neighbours,knindex,pctsrf)
@@ -595,5 +589,5 @@
     REAL, DIMENSION(klon_glo)            :: pctsrf_glo
     INTEGER                              :: ktindex(klon)
-!
+
 ! End definition
 !****************************************************************************************
@@ -607,5 +601,5 @@
       neighbours_glo(:,:)=-1
 !  Initialisation des offset    
-!
+
 ! offset bord ouest
        off_ini(1,1) = - nbp_lon   ; off_ini(2,1) = - nbp_lon + 1     ; off_ini(3,1) = 1
@@ -620,8 +614,8 @@
        off_ini(4,3) =  1          ; off_ini(5,3) = nbp_lon           ; off_ini(6,3) = nbp_lon - 1
        off_ini(7,3) = -1          ; off_ini(8,3) = - nbp_lon - 1
-!
-!
+
+
 ! Attention aux poles
-!
+
        DO igrid = 1, knon_glo
           index = ktindex_glo(igrid)
@@ -669,7 +663,6 @@
   END SUBROUTINE Init_neighbours
 
-!
-!****************************************************************************************
-!
+!****************************************************************************************
+
 #endif
 END MODULE surf_land_orchidee_noz0h_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_landice_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_landice_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_landice_mod.F90	(revision 5099)
@@ -1,3 +1,3 @@
-!
+
 MODULE surf_landice_mod
   
@@ -5,7 +5,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE surf_landice(itime, dtime, knon, knindex, &
        rlon, rlat, debut, lafin, &
@@ -242,5 +242,5 @@
 !****************************************************************************************
 ! Calculate total absorbed radiance at surface
-!
+
 !****************************************************************************************
     radsol(:) = 0.0
@@ -347,5 +347,5 @@
 !****************************************************************************************
 ! Soil calculations
-! 
+
 !****************************************************************************************
 
@@ -368,5 +368,5 @@
 !****************************************************************************************
 ! Calulate fluxes
-!
+
 !****************************************************************************************
 !    beta(:) = 1.0
@@ -420,8 +420,7 @@
 !****************************************************************************************
 ! Calculate albedo
-!
-!****************************************************************************************
-
-!
+
+!****************************************************************************************
+
 !IM: plusieurs choix/tests sur l'albedo des "glaciers continentaux"
 !       alb1(1 : knon)  = 0.6 !IM cf FH/GK 
@@ -438,5 +437,5 @@
 !****************************************************************************************
 ! Rugosity
-!
+
 !****************************************************************************************
 
@@ -599,5 +598,5 @@
 !****************************************************************************************
 ! Calculate snow amount
-!    
+
 !****************************************************************************************
     IF (ok_bs) THEN
@@ -711,7 +710,7 @@
 
   END SUBROUTINE surf_landice
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE surf_landice_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_ocean_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_ocean_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_ocean_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE surf_ocean_mod
 
@@ -7,7 +7,7 @@
 
 CONTAINS
-  !
+
   !******************************************************************************
-  !
+
   SUBROUTINE surf_ocean(rlon, rlat, swnet, lwnet, alb1, &
        windsp, rmu0, fder, tsurf_in, &
@@ -45,5 +45,5 @@
     USE limit_read_mod
     USE config_ocean_skin_m, ONLY: activate_ocean_skin
-    !
+
     ! This subroutine will make a call to ocean_XXX_noice according to the ocean mode (force, 
     ! slab or couple). The calculations of albedo and rugosity for the ocean surface are 
@@ -196,5 +196,5 @@
     !******************************************************************************
     ! Calculate total net radiance at surface
-    !
+
     !******************************************************************************
     radsol(1:klon) = 0.0 ! initialisation a priori inutile
@@ -294,16 +294,16 @@
     IF (iflag_albedo==0) THEN
        !--old parametrizations of ocean surface albedo
-       !
+
        IF (iflag_cycle_diurne>=1) THEN
-          !
+
           CALL alboc_cd(rmu0,alb_eau)
-          !
+
           !--ad-hoc correction for model radiative balance tuning
           !--now outside alboc_cd routine
           alb_eau(1:klon) = fmagic*alb_eau(1:klon) + pmagic
           alb_eau(1:klon)=MIN(MAX(alb_eau(1:klon),0.0),1.0)
-          !
+
        ELSE
-          !
+
           CALL alboc(REAL(jour),rlat,alb_eau)
           !--ad-hoc correction for model radiative balance tuning
@@ -311,7 +311,7 @@
           alb_eau(1:klon) = fmagic*alb_eau(1:klon) + pmagic
           alb_eau(1:klon)=MIN(MAX(alb_eau(1:klon),0.04),0.60)
-          !
+
        ENDIF
-       !
+
        DO i =1, knon
           DO  k=1,nsw
@@ -323,11 +323,11 @@
        alb_dif_new(1:knon,:)=alb_dir_new(1:knon,:)
        !IM 09122015 end
-       !
+
     ELSE IF (iflag_albedo==1) THEN
        !--new parametrization of ocean surface albedo by Sunghye Baek
        !--albedo for direct and diffuse radiation are different
-       !
+
        CALL ocean_albedo(knon,rmu0,knindex,windsp,SFRWL,alb_dir_new,alb_dif_new)
-       !
+
        !--ad-hoc correction for model radiative balance tuning
        alb_dir_new(1:knon,:) = fmagic*alb_dir_new(1:knon,:) + pmagic
@@ -335,5 +335,5 @@
        alb_dir_new(1:knon,:)=MIN(MAX(alb_dir_new(1:knon,:),0.0),1.0)
        alb_dif_new(1:knon,:)=MIN(MAX(alb_dif_new(1:knon,:),0.0),1.0)
-       !
+
     ELSE IF (iflag_albedo==2) THEN
        ! F. Codron albedo read from limit.nc
@@ -399,4 +399,4 @@
   END SUBROUTINE surf_ocean
   !****************************************************************************
-  !
+
 END MODULE surf_ocean_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surf_seaice_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surf_seaice_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surf_seaice_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE surf_seaice_mod
 
@@ -7,7 +7,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE surf_seaice( & 
        rlon, rlat, swnet, lwnet, alb1, fder, &
@@ -38,9 +38,8 @@
 #endif
 
-!
 ! This subroutine will make a call to ocean_XXX_ice according to the ocean mode (force, 
 ! slab or couple). The calculation of rugosity for the sea-ice surface is also done
 ! in here because it is the same calculation for the different modes of ocean.
-!
+
     INCLUDE "dimsoil.h"
     INCLUDE "clesphys.h"
@@ -125,5 +124,5 @@
 !****************************************************************************************
 ! Calculate total net radiance at surface
-!
+
 !****************************************************************************************
     radsol(:) = 0.0
@@ -134,5 +133,5 @@
 !****************************************************************************************
 ! Switch according to type of ocean (couple, slab or forced)
-!
+
 !****************************************************************************************
     IF (type_ocean == 'couple') THEN
@@ -182,5 +181,5 @@
 !****************************************************************************************
 ! Calculate rugosity
-!
+
 !****************************************************************************************
 
@@ -213,7 +212,7 @@
 
   END SUBROUTINE surf_seaice
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE surf_seaice_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/surface_data.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/surface_data.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/surface_data.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE surface_data
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/sw_aeroAR4.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/sw_aeroAR4.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/sw_aeroAR4.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 SUBROUTINE SW_AEROAR4(PSCT, PRMU0, PFRAC, &
      PPMB, PDP, &
@@ -28,30 +28,30 @@
   INCLUDE "YOMCST.h"
   INCLUDE "clesphys.h"
-  !
+
   !     ------------------------------------------------------------------
-  !
+
   !     PURPOSE.
   !     --------
-  !
+
   !          THIS ROUTINE COMPUTES THE SHORTWAVE RADIATION FLUXES IN TWO
   !     SPECTRAL INTERVALS FOLLOWING FOUQUART AND BONNEL (1980).
-  !
+
   !     METHOD.
   !     -------
-  !
+
   !          1. COMPUTES ABSORBER AMOUNTS                 (SWU)
   !          2. COMPUTES FLUXES IN 1ST SPECTRAL INTERVAL  (SW1S)
   !          3. COMPUTES FLUXES IN 2ND SPECTRAL INTERVAL  (SW2S)
-  !
+
   !     REFERENCE.
   !     ----------
-  !
+
   !        SEE RADIATION'S PART OF THE ECMWF RESEARCH DEPARTMENT
   !        DOCUMENTATION, AND FOUQUART AND BONNEL (1980)
-  !
+
   !     AUTHOR.
   !     -------
   !        JEAN-JACQUES MORCRETTE  *ECMWF*
-  !
+
   !     MODIFICATIONS.
   !     --------------
@@ -62,7 +62,7 @@
   !        2012-09     O. BOUCHER - reorganise aerosol cases with ok_ade, ok_aie, flag_aerosol
   !     ------------------------------------------------------------------
-  !
+
   !* ARGUMENTS:
-  !
+
   REAL(KIND=8) PSCT  ! constante solaire (valeur conseillee: 1370)
 
@@ -95,7 +95,7 @@
   REAL(KIND=8) PTOPSW0(KDLON)     ! SHORTWAVE FLUX AT T.O.A. (CLEAR-SKY)
   REAL(KIND=8) PSOLSW0(KDLON)     ! SHORTWAVE FLUX AT SURFACE (CLEAR-SKY)
-  !
+
   !* LOCAL VARIABLES:
-  !
+
   real, parameter:: dobson_u = 2.1415e-05 ! Dobson unit, in kg m-2
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tend_to_tke.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tend_to_tke.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tend_to_tke.F90	(revision 5099)
@@ -2,13 +2,13 @@
 ! tend_to_tke.F90
 !*************
-!
+
 ! Subroutine that adds a tendency on the TKE created by the 
 ! fluxes of momentum retrieved from the wind speed tendencies
 ! of the physics.
-! 
+
 ! The basic concept is the following:
 ! the TKE equation writes  de/dt = -u'w' du/dz -v'w' dv/dz +g/theta dtheta/dz +......
-!
-!
+
+
 ! We expect contributions to the term u'w' and v'w' that do not come from the Yamada
 ! scheme, for instance: gravity waves, drag from high vegetation..... These contributions
@@ -16,9 +16,9 @@
 ! we explicitely calculate the fluxes, integrating the wind speed 
 !                        tendency from the top of the atmospher
-!
-!
-!
+
+
+
 ! contacts: Frederic Hourdin, Etienne Vignon
-!
+
 ! History:
 !---------
@@ -28,6 +28,6 @@
 ! dupliuqer les lignes
 ! on enleve le pas de temps qui disprait dans les calculs
-!
-!
+
+
 !**************************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/time_phylmdz_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/time_phylmdz_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/time_phylmdz_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE time_phylmdz_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tracco2i_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tracco2i_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tracco2i_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
 MODULE tracco2i_mod
-!
+
 ! This module does the work for the interactive CO2 tracers
 ! Authors: Patricia Cadule and Olivier Boucher
-!
+
 ! Purpose and description:
 !  -----------------------
@@ -11,5 +11,5 @@
 ! Compute global CO2 mixing ratio for radiation scheme if option is activated
 ! Redistribute CO2 evenly over the atmosphere if transport is desactivated
-!
+
 CONTAINS
 
@@ -292,5 +292,5 @@
 !    PRINT *, 'tracco2i_mod.F90 --- MAXVAL(source(:,id_CO2)) ',MAXVAL(source(:,id_CO2))
 !    PRINT *, 'tracco2i_mod.F90 --- MINVAL(source(:,id_CO2)) ',MINVAL(source(:,id_CO2))
-!
+
 !--build final source term for CO2
     source(:,id_CO2)=fco2_ff(:)+fco2_bb(:)+fco2_land(:)+fco2_ocean(:)-fco2_ocean_cor(:)-fco2_land_cor(:)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tracinca_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tracinca_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tracinca_mod.F90	(revision 5099)
@@ -1,8 +1,8 @@
 !$Id $
-!
+
 MODULE tracinca_mod
-!
+
 ! This module prepares and calls the INCA main subroutines. 
-!
+
   IMPLICIT NONE  
 
@@ -71,5 +71,5 @@
 
 ! EN ENTREE ...
-!
+
 !Configuration grille,temps:
     INTEGER,INTENT(IN) :: nstep      ! Appel physique
@@ -97,5 +97,5 @@
     INTEGER,DIMENSION(klon),INTENT(IN)     :: ibas_con
     REAL,DIMENSION(klon),INTENT(IN)        :: albsol  ! albedo surface
-!
+
 !Convection:
 !----------
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/traclmdz_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/traclmdz_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/traclmdz_mod.F90	(revision 5099)
@@ -1,10 +1,9 @@
 !$Id $
-!
+
 MODULE traclmdz_mod
 
-! 
 ! In this module all tracers specific to LMDZ are treated. This module is used 
 ! only if running without any other chemestry model as INCA or REPROBUS.  
-!
+
   IMPLICIT NONE
 
@@ -15,8 +14,8 @@
   REAL,DIMENSION(:),ALLOCATABLE,SAVE   :: hsoltr   ! Epaisseur equivalente du reservoir de sol
 !$OMP THREADPRIVATE(hsoltr)
-!
+
 !Radioelements:
 !--------------
-!
+
   REAL,DIMENSION(:),ALLOCATABLE,SAVE   :: tautr    ! Constante de decroissance radioactive
 !$OMP THREADPRIVATE(tautr)
@@ -166,6 +165,5 @@
 !!    endif
     aerosol(:) = .FALSE.  ! Tous les traceurs sont des gaz par defaut
-    
-!
+
 ! Recherche des traceurs connus : Be7, O3, CO2,...
 ! --------------------------------------------
@@ -241,5 +239,4 @@
     END DO
 
-!
 ! Valeurs specifiques pour les traceurs Rn222 et Pb210
 ! ----------------------------------------------
@@ -256,5 +253,4 @@
     END IF
 
-!
 ! Check if all tracers have restart values
 ! ----------------------------------------------
@@ -323,5 +319,5 @@
 
 ! Input arguments
-!
+
 !Configuration grille,temps:
     INTEGER,INTENT(IN) :: nstep      ! nombre d'appels de la physiq
@@ -332,5 +328,4 @@
     REAL, INTENT(IN):: xlon(:) ! dim(klon) longitude
 
-!
 !Physique: 
 !--------
@@ -343,5 +338,5 @@
 !Couche limite:
 !--------------
-!
+
     REAL,DIMENSION(klon),INTENT(IN)      :: cdragh     ! coeff drag pour T et Q
     REAL,DIMENSION(klon,klev),INTENT(IN) :: coefh      ! coeff melange CL (m**2/s)
@@ -380,9 +375,9 @@
     REAL                           :: zrho     ! Masse Volumique de l'air KgA/m3
     REAL                           :: amn, amx
-!
+
 !=================================================================
 !  Ajout de la production en  Be7 (Beryllium) srcbe U/s/kgA
 !=================================================================
-!
+
     IF ( id_be /= 0 ) THEN
        DO k = 1, klev
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tracreprobus_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tracreprobus_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tracreprobus_mod.F90	(revision 5099)
@@ -1,6 +1,5 @@
 MODULE tracreprobus_mod
-!
+
 ! This module prepares and calls the Reprobus main subroutine 
-!
 
 CONTAINS
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.F90	(revision 5099)
@@ -8,7 +8,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 FUNCTION dyn_tropopause(t, ts, paprs, pplay, rot, itrop, thet0, pvor0)
-!
+
 !-------------------------------------------------------------------------------
   USE assert_m,     ONLY: assert
@@ -122,7 +122,7 @@
 
 !-------------------------------------------------------------------------------
-!
+
 FUNCTION smooth(v,w)
-!
+
 !-------------------------------------------------------------------------------
 ! Arguments:
@@ -141,5 +141,5 @@
 
 END FUNCTION smooth
-!
+
 !-------------------------------------------------------------------------------
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/write_histREGDYN.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/write_histREGDYN.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/write_histREGDYN.h	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       if (ok_regdyn) then
       
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/write_histday_seri.h
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/write_histday_seri.h	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/write_histday_seri.h	(revision 5099)
@@ -1,21 +1,21 @@
-!
+
 ! $Header$
-!
+
       IF (is_sequential) THEN
       
       IF (type_run.EQ."AMIP") THEN
-!
+
       ndex2d = 0
       itau_w = itau_phy + itap + start_time * day_step_phy
-!
+
 ! Champs 2D:
-!
+
       pi = ACOS(-1.)
       pir = 4.0*ATAN(1.0) / 180.0
-!
+
       DO i=1, klon
        zx_tmp_fi2d(i)=(topsw(i)-toplw(i))
       ENDDO
-!
+
       ok_msk=.FALSE.
       msk(1:klon)=pctsrf(1:klon,is_ter)
@@ -23,18 +23,18 @@
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat, zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"bilTOA",itau_w, &
                      zx_tmp_2d,nbp_lon*nbp_lat,ndex2d)
-!
+
       ok_msk=.FALSE.
       CALL moyglo_pondaire(klon, bils, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat, zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"bils",itau_w, &
                      zx_tmp_2d,nbp_lon*nbp_lat,ndex2d)
-!
+
       DO k=1, klev
       DO i=1, klon
@@ -43,15 +43,15 @@
       ENDDO
       ENDDO
-!
+
       CALL moyglo_pondaima(klon, klev, zx_tmp_fi3d,  &
            cell_area, paprs, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat, zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"ecin",itau_w, &
                      zx_tmp_2d,nbp_lon*nbp_lat,ndex2d) 
-!
-!
-!
+
+
+
       CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,cell_area,zx_tmp_2d)
       airetot=0.
@@ -60,5 +60,5 @@
       ENDDO
 !     IF(itap.EQ.1) PRINT*,'airetotphy=',airetot
-!
+
       airetot=0.
       DO j=1, nbp_lat
@@ -67,50 +67,50 @@
        ENDDO
       ENDDO
-!
+
 !     IF(itap.EQ.1) PRINT*,'airetotij=',airetot,
 !    $ '4piR2',4.*pi*RA*RA
-!
+
       zx_tmp_fi2d(1:klon)=aam/airetot
       CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"momang",itau_w,zx_tmp_2d, &
                      nbp_lon*nbp_lat,ndex2d)
-!
+
       zx_tmp_fi2d(1:klon)=torsfc/airetot
       CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"torsfc",itau_w,zx_tmp_2d, &
                      nbp_lon*nbp_lat,ndex2d)
-!
+
 !IM 151004 END
-!
+
       CALL moyglo_pondmass(klon, klev, t_seri, &
            cell_area, paprs, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1,klon,nbp_lon,nbp_lat,zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"tamv",itau_w, &
                      zx_tmp_2d,nbp_lon*nbp_lat,ndex2d)
-!
+
       ok_msk=.FALSE.
       CALL moyglo_pondaire(klon, paprs(:,1), cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat, zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"psol",itau_w, &
                      zx_tmp_2d,nbp_lon*nbp_lat,ndex2d)
-!
+
       ok_msk=.FALSE.
       CALL moyglo_pondaire(klon, evap, cell_area,  &
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat, zx_tmp_fi2d,zx_tmp_2d)
       CALL histwrite(nid_day_seri,"evap",itau_w, &
                      zx_tmp_2d,nbp_lon*nbp_lat,ndex2d)
-!
+
 !     DO i=1, klon
 !      zx_tmp_fi2d(i)=SnowFrac(i,is_ter)
 !     ENDDO
-!
+
 !     ok_msk=.TRUE.
 !     msk(1:klon)=pctsrf(1:klon,is_ter)
@@ -118,14 +118,14 @@
 !    .                     ok_msk, msk, moyglo)
 !     zx_tmp_fi2d(1:klon)=moyglo
-!
+
 !     CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat,zx_tmp_fi2d,zx_tmp_2d)
 !     CALL histwrite(nid_day_seri,"SnowFrac",
 !    .               itau_w,zx_tmp_2d,nbp_lon*nbp_lat,ndex2d) 
-!
+
 !     DO i=1, klon
 !IM 080904    zx_tmp_fi2d(i)=zsnow_mass(i)/330.*rowl
 !      zx_tmp_fi2d(i)=zsnow_mass(i)
 !     ENDDO
-!
+
 !IM 140904   ok_msk=.FALSE.
 !     ok_msk=.TRUE.
@@ -134,13 +134,13 @@
 !    .     ok_msk, msk, moyglo)
 !     zx_tmp_fi2d(1:klon)=moyglo
-!
+
 !     CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat,zx_tmp_fi2d,zx_tmp_2d)
 !     CALL histwrite(nid_day_seri,"snow_depth",itau_w,
 !    .               zx_tmp_2d,nbp_lon*nbp_lat,ndex2d)
-!
+
       DO i=1, klon
        zx_tmp_fi2d(i)=ftsol(i,is_oce)
       ENDDO
-!
+
       ok_msk=.TRUE.
       msk(1:klon)=pctsrf(1:klon,is_oce)
@@ -148,17 +148,17 @@
            ok_msk, msk, moyglo)
       zx_tmp_fi2d(1:klon)=moyglo
-!
+
       CALL gr_fi_ecrit(1, klon,nbp_lon,nbp_lat, zx_tmp_fi2d, zx_tmp_2d)
       CALL histwrite(nid_day_seri,"tsol_"//clnsurf(is_oce), &
                      itau_w,zx_tmp_2d,nbp_lon*nbp_lat,ndex2d) 
-!
+
 !=================================================================
 !=================================================================
 !=================================================================
-!
+
       if (ok_sync) then
         call histsync(nid_day_seri)
       endif
-!
+
       ENDIF !fin test sur type_run.EQ."AMIP"
       
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
 MODULE wx_pbl_mod
-!
+
 ! Split Planetary Boundary Layer
-!
+
 ! This module manages the splitting of the boundary layer between two regions; the (w) 
 ! region (inside cold pools) and the (x) region (outside cold pools)
-!
+
   USE dimphy
 
@@ -11,7 +11,7 @@
 
 CONTAINS
-!
+
 !****************************************************************************************
-!
+
 SUBROUTINE wx_pbl0_merge(knon, ypplay, ypaprs,  &
                                  sigw, dTs_forcing, dqs_forcing,  &
@@ -29,5 +29,4 @@
                                  yt1, yq1, yu1, yv1 &
                                  )
-!
 
     USE wx_pbl_var_mod
@@ -35,10 +34,10 @@
     USE print_control_mod, ONLY: prt_level,lunout
     USE indice_sol_mod, ONLY: is_oce
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "FCTTRE.h"
     INCLUDE "YOETHF.h"
     INCLUDE "clesphys.h"
-!
+
     INTEGER,                      INTENT(IN)        :: knon    ! number of grid cells
     REAL, DIMENSION(knon,klev),   INTENT(IN)        :: ypplay  ! mid-layer pressure (Pa)
@@ -60,5 +59,5 @@
     REAL, DIMENSION(knon),        INTENT(OUT)       :: yt1, yq1, yu1, yv1  ! Apparent T, q, u, v at first level, as
                                                                            !seen by surface modules
-!
+
 ! Local variables
     INTEGER                    :: j
@@ -70,16 +69,16 @@
     REAL                       :: dd_t 
     REAL                       :: dd_q 
-!
+
     REAL                       :: LambdaTs, LambdaQs, LambdaUs, LambdaVs 
-!
+
     REAL, DIMENSION(knon)      :: sigx       ! fractional area of (x) region
-!
-!
+
+
    sigx(1:knon) = 1.-sigw(1:knon)
-!                                           
-!
+
+
         DO j=1,knon
-!
-!
+
+
 ! Compute w-x differences
        dd_t = yt_w(j,1) - yt_x(j,1)
@@ -87,17 +86,17 @@
        dd_u = yu_w(j,1) - yu_x(j,1)
        dd_v = yv_w(j,1) - yv_x(j,1)
-!
+
 ! Merged exchange coefficients
          dd_Kh = Kech_h_w(j) - Kech_h_x(j)
          dd_Kq = Kech_q_w(j) - Kech_q_x(j)
          dd_Km = Kech_m_w(j) - Kech_m_x(j)
-!
+
        LambdaTs = dd_KTp(j)/Kech_Tp(j)
        LambdaQs = dd_KQs(j)/Kech_Qs(j)
        LambdaUs = dd_KUp(j)/Kech_Up(j)
        LambdaVs = dd_KVp(j)/Kech_Vp(j)
-!
+
 ! Calcul des coef A, B \'equivalents dans la couche 1
-!
+
 ! The dTs_forcing and dqs_forcing terms are added for diagnostic purpose ; they should be zero in normal operation.
        AcoefT(j) = AcoefT_x(j) + sigw(j)*(1.+sigx(j)*LambdaTs)*(dd_AT(j) - C_p(j)*dTs_forcing(j))
@@ -105,6 +104,6 @@
        AcoefU(j) = AcoefU_x(j) + sigw(j)*(1.+sigx(j)*LambdaUs)*dd_AU(j)
        AcoefV(j) = AcoefV_x(j) + sigw(j)*(1.+sigx(j)*LambdaVs)*dd_AV(j)
-!                                           
-!
+
+
 !!       BcoefT(j) = (sigw(j)*Kech_h_w(j)*Kech_T_pw(j)*BcoefT_w(j) + &
 !!                sigx(j)*Kech_h_x(j)*Kech_T_px(j)*BcoefT_x(j) )/(Kech_h(j)*Kech_Tp(j))
@@ -115,5 +114,5 @@
 !!       BcoefV(j) = (sigw(j)*Kech_m_w(j)*Kech_V_pw(j)*BcoefV_w(j) + &
 !!                sigx(j)*Kech_m_x(j)*Kech_V_px(j)*BcoefV_x(j) )/(Kech_m(j)*Kech_Vp(j))
-!
+
 !!  Print *,'YYYYpbl0: BcoefT_x, sigw, sigx, dd_Kh, dd_KTp, Kech_h_w ', &
 !!                     BcoefT_x, sigw, sigx, dd_Kh, dd_KTp, Kech_h_w
@@ -129,12 +128,12 @@
                                   Kech_m_w(j)*Kech_V_pw(j)*dd_BV(j))/(Kech_m(j)*Kech_Vp(j))
 !>jyg
-!
-!
+
+
 ! Calcul des cdrag \'equivalents dans la couche 
-!
+
        ycdragm(j) = ycdragm_x(j) + sigw(j)*dd_Cdragm(j)
        ycdragh(j) = ycdragh_x(j) + sigw(j)*dd_Cdragh(j)
        ycdragq(j) = ycdragq_x(j) + sigw(j)*dd_Cdragq(j)
-!
+
 ! Calcul de T, q, u et v \'equivalents dans la couche 1
 !!       yt1(j) = yt_x(j,1) + sigw(j)*dd_t*(1.+sigx(j)*dd_Kh/KCT)
@@ -166,14 +165,13 @@
                                  dTs_ins, dqsatsrf_ins &
                                  )
-!
 
     USE wx_pbl_var_mod
 
     USE print_control_mod, ONLY: prt_level,lunout
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "FCTTRE.h"
     INCLUDE "YOETHF.h"
-!
+
     INTEGER,                      INTENT(IN)        :: knon    ! number of grid cells
     REAL,                         INTENT(IN)        :: dtime   ! time step size (s)
@@ -187,5 +185,5 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: BT_x, BT_w
     REAL, DIMENSION(knon),        INTENT(IN)        :: AcoefT0, AcoefQ0, BcoefT0, BcoefQ0
-!
+
     REAL, DIMENSION(knon),        INTENT(OUT)       :: AcoefT, AcoefQ, BcoefT, BcoefQ
     REAL, DIMENSION(knon),        INTENT(OUT)       :: HTphiT_b, dd_HTphiT, HTphiQ_b, dd_HTphiQ, HTRn_b, dd_HTRn
@@ -194,5 +192,5 @@
     REAL, DIMENSION(knon),        INTENT(OUT)       :: Gamma_phiT, Gamma_phiQ
     REAL, DIMENSION(knon),        INTENT(OUT)       :: dTs_ins, dqsatsrf_ins
-!
+
 ! Local variables
     REAL, DIMENSION(knon)      :: qsat_x
@@ -200,5 +198,5 @@
     REAL, DIMENSION(knon)      :: dqsatdT_x
     REAL, DIMENSION(knon)      :: dqsatdT_w
-!
+
     REAL, DIMENSION(knon)      :: T10_x
     REAL, DIMENSION(knon)      :: T10_w
@@ -213,5 +211,5 @@
     REAL, DIMENSION(knon)      :: Rps_x
     REAL, DIMENSION(knon)      :: Rps_w
-!
+
     REAL, DIMENSION(knon)      :: HTphiT_x
     REAL, DIMENSION(knon)      :: HTphiT_w
@@ -220,5 +218,5 @@
     REAL, DIMENSION(knon)      :: HTRn_x
     REAL, DIMENSION(knon)      :: HTRn_w
-!
+
     REAL, DIMENSION(knon)      :: HQphiT_x
     REAL, DIMENSION(knon)      :: HQphiT_w
@@ -227,5 +225,5 @@
     REAL, DIMENSION(knon)      :: HQRn_x
     REAL, DIMENSION(knon)      :: HQRn_w
-!
+
     REAL, DIMENSION(knon)      :: HQphiT_b
     REAL, DIMENSION(knon)      :: dd_HQphiT
@@ -234,19 +232,18 @@
     REAL, DIMENSION(knon)      :: HQRn_b
     REAL, DIMENSION(knon)      :: dd_HQRn
-!
 
     REAL, DIMENSION(knon)    :: sigx
-!
+
     REAL, DIMENSION(knon)    :: Ts, T1
 !!!    REAL, DIMENSION(knon)    :: qsat, dqsat_dT
 !!!    REAL, DIMENSION(knon)    :: phiT0
-!
+
 !!!    REAL, DIMENSION(knon)    :: Cp, Lv
     REAL, DIMENSION(knon)    :: tau, Inert 
-!
+
     REAL                     :: dd_Kh
     REAL                     :: zdelta, zcvm5, zcor
     REAL                     :: qsat
-!
+
     INTEGER                  :: j
 
@@ -263,5 +260,5 @@
 !   Rp1_w = 4 eps_1 Rsigma T10_w^3                        Rp1_x = 4 eps_1 Rsigma T10_x^3
 !   Rps_w = 4 Rsigma Ts0_w^3                              Rps_x = 4 Rsigma Ts0_x^3
-!
+
 !   phiT0_b = sigw phiT0_w + sigx phiT0_x
 !   dphiT0 = phiT0_w - phiT0_x
@@ -270,6 +267,6 @@
 !   Rn0_b = sigw Rn0_w + sigx Rn0_x
     dRn0 = Rn0_w - Rn0_x
-!
-!
+
+
 !----------------------------------------------------------------------------
 !  Elementary enthalpy equations
@@ -286,5 +283,5 @@
 !   Radiation equation
 !     HTRn_w = Rp1_w Kech_T_pw BcoefT_w dtime + Rps_w    HTRn_x = Rp1_x Kech_T_px BcoefT_x dtime + Rps_x
-!
+
 !----------------------------------------------------------------------------
 !  Elementary moisture equations
@@ -305,5 +302,5 @@
 !     HQRn_w = (Rp1_w Kech_T_pw BcoefT_w dtime + Rps_w) QQ_w
 !                                         HQRn_x = (Rp1_x Kech_T_px BcoefT_x dtime + Rps_x) QQ_x
-!
+
 !----------------------------------------------------------------------------
 ! Mean values and w-x differences
@@ -312,10 +309,10 @@
 !  HTphiQ_b = sigw HTphiQ_w + sigx HTphiQ_x               dd_HTphiQ = HTphiQ_w - HTphiQ_x
 !  HTRn_b   = sigw HTRn_w   + sigx HTRn_x                 dd_HTRn   = HTRn_w   - HTRn_x
-!
+
 !  QQ_b     = sigw QQ_w     + sigx QQ_x                   dd_QQ     = QQ_w     - QQ_x
 !  HQphiT_b = sigw HQphiT_w + sigx HQphiT_x               dd_HQphiT = HQphiT_w - HQphiT_x
 !  HQphiQ_b = sigw HQphiQ_w + sigx HQphiQ_x               dd_HQphiQ = HQphiQ_w - HQphiQ_x
 !  HQRn_b   = sigw HQRn_w   + sigx HQRn_x                 dd_HQRn   = HQRn_w   - HQRn_x
-!
+
 !----------------------------------------------------------------------------
 !  Equations
@@ -323,5 +320,5 @@
 ! (1 - g_T) dTs    = dTs_ins    + Gamma_phiT phiT
 ! (1 - g_Q) dqsatsrf = dqsatsrf_ins + Gamma_phiQ phiQ
-!
+
 ! Feedback Gains
 ! --------------
@@ -331,15 +328,15 @@
 !         (sigx - sigw - sigw sigx dd_HQphiQ/HQphiQ_b)   &
 !                          [ dd_QQ/QQ_b + (sqrt(tau)/(I QQ_b))(dd_HQphiT + Lv dd_HQphiQ + dd_HQRn) ]
-!
+
 !  Ts, qs Coupling coefficients                /
 !  ----------------------------
 ! Gamma_phiT = (sqrt(tau)/(I HTphiT_b)) (dd_HTphiT + Lv dd_HTphiQ + dd_HTRn)
 ! Gamma_phiQ = (1/(HQphiQ_b QQ_b)) [ dd_QQ +  (sqrt(tau)/(I )) (dd_HQphiT + Lv dd_HQphiQ + dd_HQRn) ]
-!
+
 !  Insensitive changes
 !  -------------------
 ! dTs_ins    = (1 - g_T) dTs0    - Gamma_phiT phiT0_b
 ! dqsatsrf_ins = (1 - g_Q) dqsatsrf0 - Gamma_phiQ phiQ0_b
-!
+
 !----------------------------------------------------------------------------
 !  Effective coefficients Acoef and Bcoef
@@ -353,11 +350,11 @@
 ! AcoefT = AcoefT0 - sigw sigx (dd_KTp/Kech_Tp) Cp dTs_ins/(1 - g_T)
 ! BcoefT = BcoefT0 - sigw sigx (dd_KTp/Kech_Tp) Cp Gamma_phiT/(1 - g_T)/dtime
-!
+
 ! AcoefQ = AcoefQ0 - sigw sigx (dd_KQp/Kech_Qp) dqs_ins/(1 - g_Q)
 ! BcoefQ = BcoefQ0 - sigw sigx (dd_KQp/Kech_Qp) Gamma_phiq/(1 - g_Q)/dtime
-!
+
 !==============================================================================
-!
-!
+
+
 !  Parameters
 !  ----------
@@ -369,28 +366,28 @@
 !   C_p(1:knon) = RCpd
 !   L_v(1:knon) = RLvtt
-!
+
 !      print *,' AAAA wx_pbl_dTs, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
-!
-!
+
+
    T10_x(1:knon) = (AT_x(1:knon)/C_p(1:knon) - Kech_h_x(1:knon)*BT_x(1:knon)*dtime*Ts0_x(1:knon))/  &
                    (1 - Kech_h_x(1:knon)*BT_x(1:knon)*dtime)
    T10_w(1:knon) = (AT_w(1:knon)/C_p(1:knon) - Kech_h_w(1:knon)*BT_w(1:knon)*dtime*Ts0_w(1:knon))/  &
                    (1 - Kech_h_w(1:knon)*BT_w(1:knon)*dtime)
-!
+
    phiT0_x(1:knon) = Kech_T_px(1:knon)*(AT_x(1:knon) - C_p(1:knon)*Ts0_x(1:knon))
    phiT0_w(1:knon) = Kech_T_pw(1:knon)*(AT_w(1:knon) - C_p(1:knon)*Ts0_w(1:knon))
-!
+
    phiQ0_x(1:knon) = Kech_Q_sx(1:knon)*(beta(1:knon)*AQ_x(1:knon) - qsatsrf0_x(1:knon))
    phiQ0_w(1:knon) = Kech_Q_sw(1:knon)*(beta(1:knon)*AQ_w(1:knon) - qsatsrf0_w(1:knon))
-!
+
    Rn0_x(1:knon) = eps_1*Rsigma*T10_x(1:knon)**4 - Rsigma*Ts0_x(1:knon)**4
    Rn0_w(1:knon) = eps_1*Rsigma*T10_w(1:knon)**4 - Rsigma*Ts0_w(1:knon)**4
-!
+
    Rp1_x(1:knon) = 4*eps_1*Rsigma*T10_x(1:knon)**3
    Rp1_w(1:knon) = 4*eps_1*Rsigma*T10_w(1:knon)**3
-!
+
    Rps_x(1:knon) = 4*Rsigma*Ts0_x(1:knon)**3
    Rps_w(1:knon) = 4*Rsigma*Ts0_w(1:knon)**3
-!
+
 !  DFlux_DT coefficients
 !  ---------------------
@@ -404,5 +401,5 @@
      HTRn_x(1:knon) = Rp1_x(1:knon)*Kech_T_px(1:knon)*BT_x(1:knon)*dtime + Rps_x(1:knon)
      HTRn_w(1:knon) = Rp1_w(1:knon)*Kech_T_pw(1:knon)*BT_w(1:knon)*dtime + Rps_w(1:knon)  
-!
+
 !  DFluxDQ coefficients
 !  ---------------------
@@ -416,5 +413,5 @@
      HQRn_x(1:knon) = (Rp1_x(1:knon)*Kech_T_px(1:knon)*BT_x(1:knon)*dtime + Rps_x(1:knon))*QQ_x(1:knon)
      HQRn_w(1:knon) = (Rp1_w(1:knon)*Kech_T_pw(1:knon)*BT_w(1:knon)*dtime + Rps_w(1:knon))*QQ_w(1:knon)
-!
+
 ! Mean values and w-x differences
 ! -------------------------------
@@ -422,27 +419,27 @@
   phiQ0_b(1:knon) = sigw(1:knon)*phiQ0_w(1:knon) + sigx(1:knon)*phiQ0_x(1:knon)          
   Rn0_b(1:knon)   = sigw(1:knon)*Rn0_w(1:knon)   + sigx(1:knon)*Rn0_x(1:knon)          
-!
+
   dphiT0(1:knon) = phiT0_w(1:knon) - phiT0_x(1:knon)           
   dphiQ0(1:knon) = phiQ0_w(1:knon) - phiQ0_x(1:knon)          
   dRn0(1:knon)   = Rn0_w(1:knon)   - Rn0_x(1:knon)          
-!
+
   HTphiT_b(1:knon) = sigw(1:knon)*HTphiT_w(1:knon) + sigx(1:knon)*HTphiT_x(1:knon)           
   dd_HTphiT(1:knon) = HTphiT_w(1:knon) - HTphiT_x(1:knon)
-!
+
   HTphiQ_b(1:knon) = sigw(1:knon)*HTphiQ_w(1:knon) + sigx(1:knon)*HTphiQ_x(1:knon)          
   dd_HTphiQ(1:knon) = HTphiQ_w(1:knon) - HTphiQ_x(1:knon)
-!
+
   HTRn_b(1:knon)   = sigw(1:knon)*HTRn_w(1:knon)   + sigx(1:knon)*HTRn_x(1:knon)           
   dd_HTRn(1:knon)   = HTRn_w(1:knon)   - HTRn_x(1:knon)
-!
+
   HQphiT_b(1:knon) = sigw(1:knon)*HQphiT_w(1:knon) + sigx(1:knon)*HQphiT_x(1:knon)          
   dd_HQphiT(1:knon) = HQphiT_w(1:knon) - HQphiT_x(1:knon)
-!
+
   HQphiQ_b(1:knon) = sigw(1:knon)*HQphiQ_w(1:knon) + sigx(1:knon)*HQphiQ_x(1:knon)          
   dd_HQphiQ(1:knon) = HQphiQ_w - HQphiQ_x(1:knon)
-!
+
   HQRn_b(1:knon)   = sigw(1:knon)*HQRn_w(1:knon)   + sigx(1:knon)*HQRn_x(1:knon)             
   dd_HQRn(1:knon)   = HQRn_w(1:knon)   - HQRn_x(1:knon)
-!
+
 ! Feedback Gains
 ! --------------
@@ -451,5 +448,5 @@
                  + (dd_HTphiT(1:knon) + L_v(1:knon)*dd_HTphiQ(1:knon) + dd_HTRn(1:knon))  &
                  * (sigx(1:knon) - sigw(1:knon) - sigw(1:knon)*sigx(1:knon)*dd_HTphiT(1:knon)/HTphiT_b(1:knon)) )
-!
+
 !!!! DO j = 1,knon
 !!!!  IF (mod(j,20) .eq.0) THEN
@@ -484,5 +481,5 @@
   Gamma_phiT(1:knon) = (sqrt(tau(1:knon))/(Inert(1:knon)*HTphiT_b(1:knon)))  &
                      * (dd_HTphiT(1:knon) + L_v(1:knon)*dd_HTphiQ(1:knon) + dd_HTRn(1:knon))
-! 
+
   Gamma_phiQ(1:knon) = (1./(Kech_Qs(1:knon)*QQ_b(1:knon))) * &
                         ( dd_QQ(1:knon)   &
@@ -499,12 +496,12 @@
 !!                       + (sqrt(tau(1:knon))/(Inert(1:knon)))  &
 !!                       * (dd_HQphiT(1:knon) + L_v(1:knon)*dd_HQphiQ(1:knon) + dd_HQRn(1:knon)) )
-!
+
 !  Insensitive changes
 !  -------------------
   dTs_ins(1:knon)    = (sqrt(tau(1:knon))/Inert(1:knon))*  &
                        (dphiT0(1:knon) + L_v(1:knon)*dphiQ0(1:knon) + dRn0(1:knon))
-!
+
   dqsatsrf_ins(1:knon) = (beta(1:knon)/QQ_b(1:knon))*dTs_ins(1:knon)
-!
+
    IF (prt_level >= 10) THEN
       print *,'wx_pbl_merge, tau         ', tau
@@ -516,9 +513,9 @@
       print *,'wx_pbl_merge, dqsatdT0_w, dqsatdT0_x ', (dqsatdT0_w(j), dqsatdT0_x(j),j=1,knon)
    ENDIF
-!
+
 !----------------------------------------------------------------------------
-!  
+
 !------------------------------------------------------------------------------
-!  
+
 !    Effective coefficients Acoef and Bcoef
 !    --------------------------------------
@@ -566,5 +563,4 @@
                        dTs, delta_qsurf &
                        )
-!
 
     USE wx_pbl_var_mod
@@ -572,7 +568,7 @@
     USE print_control_mod, ONLY: prt_level,lunout
     USE indice_sol_mod, ONLY: is_oce
-!
+
     INCLUDE "YOMCST.h"
-!
+
     INTEGER,                      INTENT(IN)        :: knon    ! number of grid cells
     INTEGER,                      INTENT(IN)        :: nsrf    ! surface type
@@ -586,5 +582,5 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiT, phiQ, phiU, phiV
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiQ0_b, phiT0_b
-!
+
     REAL, DIMENSION(knon),        INTENT(OUT)       :: phiT_x, phiT_w
     REAL, DIMENSION(knon),        INTENT(OUT)       :: phiQ_x, phiQ_w
@@ -595,10 +591,10 @@
     REAL, DIMENSION(knon),        INTENT(OUT)       :: dTs           ! Temperature difference at surface
     REAL, DIMENSION(knon),        INTENT(OUT)       :: delta_qsurf
-!
+
 !! Local variables
     INTEGER                    :: j
     REAL, DIMENSION(knon)      :: dphiT, dphiQ, dphiU, dphiV
     REAL, DIMENSION(knon)      :: q1_x, q1_w
-!
+
     REAL, DIMENSION(knon)      :: sigx       ! fractional area of (x) region
 
@@ -612,5 +608,5 @@
 !!!!!! dphiU = (dd_KUp/KUp) phiU + (     dd_AU          )*KxKwUp/KUp
 !!!!!! dphiV = (dd_KVp/KVp) phiV + (     dd_AV          )*KxKwVp/KVp
-! 
+
 ! (1 - g_T) (dTs-dTs0)    = dTs_ins-dTs0    + Gamma_phiT (phiT-phiT0)
 ! (1 - g_Q) dqsatsrf = dqsatsrf_ins + Gamma_phiQ phiQ
@@ -619,12 +615,12 @@
 ! dphiU = (dd_KUp/KUp) phiU + (     dd_AU          )*KxKwUp/KUp
 ! dphiV = (dd_KVp/KVp) phiV + (     dd_AV          )*KxKwVp/KVp
-! 
+
 !!
         sigx(:) = 1.-sigw(:)
-!
+
 !      print *,' AAAA wx_pbl_split, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
-!
+
    IF (iflag_split == 2 .AND. nsrf /= is_oce) THEN
-!
+
 !   Delta_tsurf and  Delta_qsurf computation
 !   -----------------------------------------
@@ -633,5 +629,5 @@
         print *,' wx_pbl_split, dqsatsrf_ins, Gamma_phiQ, g_q ', dqsatsrf_ins, Gamma_phiQ, g_q
       ENDIF
-!
+
       DO j = 1,knon
         dTs(j)    = dTs0(j) + (dTs_ins(j) - dTs0(j) + Gamma_phiT(j)*(phiT(j)-phiT0_b(j)) )/(1 - g_T(j)) 
@@ -639,5 +635,5 @@
                        Gamma_phiQ(j)*(phiQ(j)-phiQ0_b(j)) )/(1 - g_Q(j)) 
       ENDDO ! j = 1,knon
-!
+
         IF (prt_level >=10 ) THEN
           print *,' wx_pbl_split, dqsatsrf0, QQ_b ', dqsatsrf0, QQ_b
@@ -649,5 +645,5 @@
         dqsatsrf(:) = 0.
    ENDIF ! (iflag_split .EQ. 2 .AND. nsrf .NE. is_oce)
-!
+
      DO j = 1,knon
        dphiT(j) = (phiT(j)*dd_KTp(j) + (        dd_AT(j) - C_p(j)*dTs(j))*KxKwTp(j))/Kech_Tp(j)
@@ -655,5 +651,5 @@
        dphiU(j) = (phiU(j)*dd_KUp(j) +          dd_AU(j)                 *KxKwUp(j))/Kech_Up(j)
        dphiV(j) = (phiV(j)*dd_KVp(j) +          dd_AV(j)                 *KxKwVp(j))/Kech_Vp(j)
-!
+
        phiT_x(j)=phiT(j) - sigw(j)*dphiT(j)
        phiT_w(j)=phiT(j) + sigx(j)*dphiT(j)
@@ -664,9 +660,9 @@
        phiV_x(j)=phiV(j) - sigw(j)*dphiV(j)
        phiV_w(j)=phiV(j) + sigx(j)*dphiV(j)
-!
+
        philat_x(j)=phiQ_x(j)*RLVTT
        philat_w(j)=phiQ_w(j)*RLVTT
      ENDDO ! j = 1,knon
-!
+
      DO j = 1,knon
        q1_x(j) = AQ_x(j) + BQ_x(j)*phiQ_x(j)*dtime
@@ -676,20 +672,20 @@
        delta_qsurf(j) = (1.-beta(j))*(q1_w(j) - q1_x(j)) + dqsatsrf(j)
      ENDDO ! j = 1,knon
-!
+
 !!  Do j = 1,knon
 !!     print *,'XXXsplit : j, q1_x(j), AQ_x(j), BQ_x(j), phiQ_x(j) ', j, q1_x(j), AQ_x(j), BQ_x(j), phiQ_x(j)
 !!     print *,'XXXsplit : j, q1_w(j), AQ_w(j), BQ_w(j), phiQ_w(j) ', j, q1_w(j), AQ_w(j), BQ_w(j), phiQ_w(j)
 !!  ENDDO
-!
+
         IF (prt_level >=10 ) THEN
           print *,' wx_pbl_split, phiT, dphiT, dTs ', phiT, dphiT, dTs
           print *,' wx_pbl_split, phiQ, dphiQ, dqsatsrf ', phiQ, dphiQ, dqsatsrf
         ENDIF
-!
+
         IF (prt_level >=10 ) THEN
 !!          print *,' wx_pbl_split, verif dqsatsrf = beta dqsatdT0 dTs '
 !!          print *,' wx_pbl_split, dqsatsrf, dqsatdT0*dTs ', dqsatsrf, dqsatdT0*dTs
         ENDIF
-!
+
 !!    IF (knon .NE. 0) THEN
 !!       call  iophys_ecrit('sigw', 1,'sigw', '.',sigw)
@@ -703,5 +699,5 @@
 !!       call  iophys_ecrit('q1_x', 1,'q1_x', '.',q1_x)
 !!    ENDIF  ! (knon .NE. 0)
-!
+
         RETURN
 
@@ -721,14 +717,13 @@
                                phiQ_x9, phiQ_w9 &
                                )
-!
 
     USE wx_pbl_var_mod
 
     USE print_control_mod, ONLY: prt_level,lunout
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "FCTTRE.h"
     INCLUDE "YOETHF.h"
-!
+
     INTEGER,                      INTENT(IN)        :: knon         ! number of grid cells
     REAL,                         INTENT(IN)        :: dtime        ! time step size (s)
@@ -744,10 +739,10 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: BcoefT_x, BcoefT_w
     REAL, DIMENSION(knon),        INTENT(IN)        :: AcoefT0, AcoefQ0, BcoefT0, BcoefQ0
-!
+
     REAL, DIMENSION(knon),        INTENT(IN)        :: AcoefT, AcoefQ, BcoefT, BcoefQ
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiT_b9, phiQ_b9
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiT_x9, phiT_w9
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiQ_x9, phiQ_w9
-!
+
 !! Local variables
     INTEGER                    :: j
@@ -782,8 +777,8 @@
 !  Input : Ts0_b, dTs0, Ts_b, dTs, qsatsrf_b, dqsatsrf, 
 !          phiT_b, phiQ_b, phiT_w, phiT_x, phiQ_w, phiQ_x, 
-!          
+
 !          AcoefT, AcoefQ, AcoefT_w, AcoefQ_w, AcoefT_x, AcoefQ_x,
 !          BcoefT, BcoefQ, BcoefT_w, BcoefQ_w, BcoefT_x, BcoefQ_x
-! 
+
 !  C_p T1_w = AcoefT_w + BcoefT_w phiT_w Delta t          C_p T1_x = AcoefT_x + BcoefT_x phiT_x Delta t
 !  q1_w = AQ_w + BQ_w phiQ_w Delta t                      q1_x = AQ_x + BQ_x phiQ_x Delta t
@@ -806,5 +801,5 @@
 
 !----------------------------------------------------------------------------
-!
+
 !!
         sigx(:) = 1.-sigw(:)
@@ -819,5 +814,5 @@
       print *,' AAAA wx_pbl_check, C_p(j), qsat0(j), Ts0(j) : ', C_p(:), qsat0(:), Ts0(:)
     ENDIF ! (prt_level >=10 )
-!
+
    DO j = 1, knon
       zdelta = MAX(0.,SIGN(1.,RTT-Ts0_b9(j)))
@@ -831,49 +826,49 @@
       dqsatdT01(j) = fqsat*FOEDE(Ts0_b9(j),zdelta,zcvm5,qsat01(j),zcor)
    ENDDO
-!
+
 !--------------------------------------------------------------------------------------------------
         IF (prt_level >=10 ) THEN
-!
+
           DO j = 1, knon
-!
+
    print *,'wx_pbl_check: Kech_h, Kech_q ', Kech_h(j), Kech_q(j)
-!
+
   Ta(j) = (AcoefT(j) + BcoefT(j)*phiT_b9(j)*dtime)/C_p(j)
   qa(j) = AcoefQ(j) + BcoefQ(j)*phiQ_b9(j)*dtime
     print *, 'wx_pbl_check: j, Ta, qa ', Ta(j), qa(j)
-!
+
   qsat_bs(j) = qsat01(j) + dqsatdT01(j)*(Ts_b9(j)-Ts0_b9(j))
-!
+
    print *,'wx_pbl_check: qsat01, qsat_bs ', j,qsat01(j), qsat_bs(j)
-!
+
   Ts_x(j) = Ts_b9(j) - sigw(j)*dTs9(j)
   Ts_w(j) = Ts_b9(j) + sigx(j)*dTs9(j)
     print *, 'wx_pbl_check: j, Ts_b9, Ts_w, Ts_x ', j, Ts_b9(j), Ts_w(j), Ts_x(j)
-!
+
   qsat_x(j) = qsat0_x(j) + dqsatdT0_x(j)*(Ts_x(j)-Ts0_x(j))
   qsat_w(j) = qsat0_w(j) + dqsatdT0_w(j)*(Ts_w(j)-Ts0_w(j))
-!
+
    print *,'wx_pbl_check: qsat0_w, qsat0_x, qsat_w, qsat_x ', qsat0_w(j), qsat0_x(j), qsat_w(j), qsat_x(j)
-!
+
   T1_x(j) = (AcoefT_x(j) + BcoefT_x(j)*phiT_x9(j)*dtime) / C_p(j)
   T1_w(j) = (AcoefT_w(j) + BcoefT_w(j)*phiT_w9(j)*dtime) / C_p(j)
     print *, 'wx_pbl_check: j, T1_w, T1_x ', j, T1_w(j), T1_x(j)
-!
+
   q1_x(j) = AQ_x(j) + BQ_x(j)*phiQ_x9(j)*dtime
   q1_w(j) = AQ_w(j) + BQ_w(j)*phiQ_w9(j)*dtime
     print *, 'wx_pbl_check: j, q1_w, q1_x ', j, q1_w(j), q1_x(j)
-!
+
    qsatsrf_x(j) = beta(j)*qsat_x(j)
    qsatsrf_w(j) = beta(j)*qsat_w(j) 
    qsatsrf_b(j) = sigw(j)*qsatsrf_w(j) + sigx(j)*qsatsrf_x(j)
-!
+
    dqsatsrf1 = qsatsrf_w(j) - qsatsrf_x(j)
     print *, 'wx_pbl_check: j, qsatsrf_w, qsatsrf_x, dqsatsrf1, dqsatsrf9 ', &
                           qsatsrf_w(j), qsatsrf_x(j), dqsatsrf1, dqsatsrf9(j)
-!
+
    qsurf_x(j) = (1-beta(j))*q1_x(j) + qsatsrf_x(j)
    qsurf_w(j) = (1-beta(j))*q1_w(j) + qsatsrf_w(j)
     print *, 'wx_pbl_check: j, qsurf_w, qsurf_x ', j, qsurf_w(j), qsurf_x(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test qsat01 = qsat0    et   dqsatdT01 = dqsatdT0
@@ -881,5 +876,5 @@
    print *, 'wx_pbl_check: j, qsat01(j), qsat0(j) ', j, qsat01(j), qsat0(j)
    print *, 'wx_pbl_check: j, dqsatdT01(j), dqsatdT0(j) ', j, dqsatdT01(j), dqsatdT0(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test Kexh_Q_sw = Kech_q_w/(1.-beta*Kech_q_w*BcoefQ)   Kexh_Q_sx = Kech_q_x/(1.-beta*Kech_q_x*BcoefQ)
@@ -889,5 +884,5 @@
     print *, 'wx_pbl_check: j, Kech_Q_sx1, Kech_Q_sx(j)', j, Kech_Q_sx1, Kech_Q_sx(j)
     print *, 'wx_pbl_check: j, Kech_Q_sw1, Kech_Q_sw(j)', j, Kech_Q_sw1, Kech_Q_sw(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiT_w = Kech_h_w*C_p(j)*(T1_w(j)-Ts_w(j))        phiT_x = Kech_h_x*C_p(j)*(T1_x(j)-Ts_x(j))
@@ -895,5 +890,5 @@
     phiT_x1 = Kech_h_x(j)*C_p(j)*(T1_x(j)-Ts_x(j))
     phiT_w1 = Kech_h_w(j)*C_p(j)*(T1_w(j)-Ts_w(j))
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiT_w = Kech_T_pw*(AcoefT_w(j)-C_p(j)*Ts_w(j))   phiT_x = Kech_T_px*(AcoefT_x(j)-C_p(j)*Ts_x(j))
@@ -903,5 +898,5 @@
     print *, 'wx_pbl_check: j, phiT_w1, phiT_w2, phiT_w9 ', j, phiT_w1, phiT_w2, phiT_w9(j)
     print *, 'wx_pbl_check: j, phiT_x1, phiT_x2, phiT_x9 ', j, phiT_x1, phiT_x2, phiT_x9(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiq_w = Kech_q_w ( beta q1_w - qsatsrf_w)    phiq_x = Kech_q_x ( beta q1_x - qsatsrf_x))
@@ -909,5 +904,5 @@
     phiq_x1 = Kech_q_x(j)*( beta(j)*q1_x(j) - qsatsrf_x(j))
     phiq_w1 = Kech_q_w(j)*( beta(j)*q1_w(j) - qsatsrf_w(j))
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test  phiq_w = Kech_Q_sw (beta AQ_w -qsatsrf_w)     phiq_x = Kech_Q_sx (beta AQ_x -qsatsrf_x)
@@ -915,5 +910,5 @@
     phiq_x2 = Kech_Q_sx(j)*(beta(j)*AQ_x(j) -qsatsrf_x(j))
     phiq_w2 = Kech_Q_sw(j)*(beta(j)*AQ_w(j) -qsatsrf_w(j))
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiq_w = Kech_q_w ( q1_w - qsurf_w)    phiq_x = Kech_q_x ( q1_x - qsurf_x))
@@ -923,5 +918,5 @@
     print *, 'wx_pbl_check: j, phiQ_w1, phiQ_w2, phiQ_w3, phiQ_w9 ', j, phiQ_w1, phiQ_w2, phiQ_w3, phiQ_w9(j)
     print *, 'wx_pbl_check: j, phiQ_x1, phiQ_x2, phiQ_x3, phiQ_x9 ', j, phiQ_x1, phiQ_x2, phiQ_x3, phiQ_x9(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiT_b = Kech_h C_p (Ta - Ts_b)
@@ -929,5 +924,5 @@
    phiT_b1 = Kech_h(j)*C_p(j)*(Ta(j) - Ts_b9(j))
    print *, 'wx_pbl_check: j, phiT_b1, PhiT_b9 ', j, phiT_b1, PhiT_b9(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiQ_b = beta Kech_q (qa - qsat_bs)
@@ -936,6 +931,6 @@
    phiQ_b1 = beta(j)*Kech_q(j)*(qa(j) - qsat_bs(j))
    print *, 'wx_pbl_check: j, beta, evap_pot, phiQ_b1, PhiQ_b9 ', j, beta(j), evap_pot, phiQ_b1, PhiQ_b9(j)
-!
-!
+
+
           ENDDO  ! j = 1, knon
           
@@ -965,14 +960,13 @@
                                phiQ_x9, phiQ_w9  &
                                )
-!
 
     USE wx_pbl_var_mod
 
     USE print_control_mod, ONLY: prt_level,lunout
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "FCTTRE.h"
     INCLUDE "YOETHF.h"
-!
+
     INTEGER,                      INTENT(IN)        :: knon         ! number of grid cells
     REAL,                         INTENT(IN)        :: dtime        ! time step size (s)
@@ -989,5 +983,5 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: BcoefT_x, BcoefT_w
     REAL, DIMENSION(knon),        INTENT(IN)        :: AcoefT0, AcoefQ0, BcoefT0, BcoefQ0
-!
+
     REAL, DIMENSION(knon),        INTENT(IN)        :: AcoefT, AcoefQ, BcoefT, BcoefQ
     REAL, DIMENSION(knon),        INTENT(IN)        :: HTphiT_b, dd_HTphiT, HTphiQ_b, dd_HTphiQ, HTRn_b, dd_HTRn
@@ -999,5 +993,5 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiT_x9, phiT_w9
     REAL, DIMENSION(knon),        INTENT(IN)        :: phiQ_x9, phiQ_w9
-!
+
 !! Local variables
     INTEGER                    :: j
@@ -1035,8 +1029,8 @@
 !  Input : Ts0_b, dTs0, Ts_b, dTs, qsatsrf_b, dqsatsrf, 
 !          phiT_b, phiQ_b, phiT_w, phiT_x, phiQ_w, phiQ_x, 
-!          
+
 !          AcoefT, AcoefQ, AcoefT_w, AcoefQ_w, AcoefT_x, AcoefQ_x,
 !          BcoefT, BcoefQ, BcoefT_w, BcoefQ_w, BcoefT_x, BcoefQ_x
-! 
+
 !  Ts_w = Ts_b + sigx dTs                                 Ts_x = Ts_b - sigw dTs
 !  T1_w = AcoefT_w + BcoefT_w phiT_w Delta t              T1_x = AcoefT_x + BcoefT_x phiT_x Delta t
@@ -1054,5 +1048,5 @@
 
 !----------------------------------------------------------------------------
-!
+
 !!
         sigx(:) = 1.-sigw(:)
@@ -1066,30 +1060,30 @@
                              dd_HTphiT, dd_HTphiQ, dd_HTRn 
    ENDIF ! (prt_level >=10 )
-!
+
 ! Compute the three qsat and dqsatdTs
 ! ---------------------------------------------
 !!      print *,' AAAA wx_pbl_dts_check, C_p(j), qsat0(j), Ts0(j) : ',  &
 !!                                      (C_p(j), qsat0(j), Ts0(j), j = 1,knon)
-!
-!
+
+
 !--------------------------------------------------------------------------------------------------
         IF (prt_level >=10 ) THEN
-!
+
           DO j = 1, knon
   Ts_x(j) = Ts_b9(j) - sigw(j)*dTs9(j)
   Ts_w(j) = Ts_b9(j) + sigx(j)*dTs9(j)
     print *, 'wx_pbl_dts_check: j, Ts_b9, Ts_w, Ts_x ', j, Ts_b9(j), Ts_w(j), Ts_x(j)
-!
+
   qsat_x(j) = qsat0_x(j) + dqsatdT0_x(j)*(Ts_x(j)-Ts0_x(j))
   qsat_w(j) = qsat0_w(j) + dqsatdT0_w(j)*(Ts_w(j)-Ts0_w(j))
-!
+
   T1_x(j) = (AcoefT_x(j) + BcoefT_x(j)*phiT_x9(j)*dtime) / C_p(j)
   T1_w(j) = (AcoefT_w(j) + BcoefT_w(j)*phiT_w9(j)*dtime) / C_p(j)
     print *, 'wx_pbl_dts_check: j, T1_w, T1_x ', j, T1_w(j), T1_x(j)
-!
+
   q1_x(j) = AQ_x(j) + BQ_x(j)*phiQ_x9(j)*dtime
   q1_w(j) = AQ_w(j) + BQ_w(j)*phiQ_w9(j)*dtime
     print *, 'wx_pbl_dts_check: j, q1_w, q1_x ', j, q1_w(j), q1_x(j)
-!
+
     Rn_x(j) = eps_1*Rsigma*T1_x(j)**4 - Rsigma*Ts_x(j)**4
     Rn_w(j) = eps_1*Rsigma*T1_w(j)**4 - Rsigma*Ts_w(j)**4
@@ -1100,11 +1094,11 @@
                        )*(dTs9(j)-dTs09(j)) &
                     + dd_HTRn(j)/HTphiT_b(j)*(phiT_b9(j)-phiT0_b9(j))
-!
+
           print *,'wx_pbl_dts_check, dphiT, L_v*dphiQ, dRn, dTs ', &
               phiT_w9(j)-phiT_x9(j), L_v(j)*(phiQ_w9(j)-phiQ_x9(j)), dRn(j), dTs9(j)
-!
+
   phiQ0_x(j) = PhiQ0_b9(j) - sigw(j)*dphiQ09(j)
   phiQ0_w(j) = PhiQ0_b9(j) + sigx(j)*dphiQ09(j)
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiQ_w-phiQ0_w = -beta*Kech_Q_sw*dqsatdT_w*(Ts_w-Ts0_w)
@@ -1115,5 +1109,5 @@
     print *,'wx_pbl_dts_check: j, phiQ_w9-phiQ0_w, phiQ_w_m_phiQ0_w ', &
                            j, phiQ_w9(j)-phiQ0_w(j), phiQ_w_m_phiQ0_w
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiQ_x-phiQ0_x = -beta*Kech_Q_sx*dqsatdT_x*(Ts_x-Ts0_x)
@@ -1122,5 +1116,5 @@
     print *,'wx_pbl_dts_check: j, phiQ_x9-phiQ0_x, phiQ_x_m_phiQ0_x ', &
                            j, phiQ_x9(j)-phiQ0_x(j), phiQ_x_m_phiQ0_x
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test dphiT-dphiT0 = -(HTphiT_b+(sigx-sigw)*dd_HTphiT)*(dTs-dTs0) - dd_HTphiT*(Ts_b-Ts0_b)
@@ -1130,5 +1124,5 @@
                   - dd_HTphiT(j)*(Ts_b9(j)-Ts0_b9(j))
  print *,'wx_pbl_dts_check: j, dphiT-dphiT09, dphiT_m_dphiT0 ',j, dphiT-dphiT09(j), dphiT_m_dphiT0
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test dphiQ-dphiQ0 = -(HTphiQ_b+(sigx-sigw)*dd_HTphiQ)*(dTs-dTs0) - dd_HTphiQ*(Ts_b-Ts0_b)
@@ -1138,5 +1132,5 @@
                   - dd_HTphiQ(j)*(Ts_b9(j)-Ts0_b9(j))
  print *,'wx_pbl_dts_check: j, dphiQ-dphiQ09, dphiQ_m_dphiQ0 ',j, dphiQ-dphiQ09(j), dphiQ_m_dphiQ0
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test dRn-dRn0 = -(HTRn_b+(sigx-sigw)*dd_HTRn)*(dTs-dTs0) - dd_HTRn*(Ts_b-Ts0_b)
@@ -1145,5 +1139,5 @@
                   - dd_HTRn(j)*(Ts_b9(j)-Ts0_b9(j))
  print *,'wx_pbl_dts_check: j, dRn-dRn09, dRn_m_dRn0 ',j, dRn-dRn09(j), dRn_m_dRn0
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiT_b-phiT0_b = -sigx*sigw*dd_HTphiT*(dTs-dTs0) - HTphiT_b*(Ts_b-Ts0_b)
@@ -1151,5 +1145,5 @@
    phiTb_m_phiT0b = -sigx(j)*sigw(j)*dd_HTphiT(j)*(dTs9(j)-dTs09(j)) - HTphiT_b(j)*(Ts_b9(j)-Ts0_b9(j))
    print *,'wx_pbl_dts_check: j, phiT_b9-phiT0_b9, phiTb_m_phiT0b ',j ,phiT_b9(j)-phiT0_b9(j), phiTb_m_phiT0b
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiT_w, phiT_x, dphiT from HTphiT
@@ -1168,9 +1162,8 @@
     print *,'wx_pbl_dts_check: j, dphiT, dphiT_H ', j, dphiT, dphiT_H
 
-!
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !  Test phiq_w, phiq_x, dphiq from HTphiq
 !------------------------------------------
-!
+
 !  phiq_w = beta Kech_q_w ( q1_w - qsat(Ts_w))            phiq_x = beta Kech_q_x ( q1_x - qsat(Ts_x))
   err_phiq_x(j) = beta(j)*Kech_q_x(j)*( q1_x(j) - qsat_x(j)) - phiq_x9(j)
@@ -1183,11 +1176,11 @@
                          + dd_HTphiQ(j)/HTphiT_b(j)*(phiT_b9(j)-phiT0_b9(j))
     print *,'wx_pbl_dts_check: j, dphiQ, dphiQ_H ', j, dphiQ, dphiQ_H
-!
+
 !  phiT_b = sigw phiT_w + sigx phiT_x                     dphiT = phiT_w - phiT_x
   err_phiT_b(j) = sigw(j)*phiT_w9(j) + sigx(j)*phiT_x9(j) - phiT_b9(j)
-!
+
 !  phiQ_b = sigw phiQ_w + sigx phiQ_x                     dphiQ = phiQ_w - phiQ_x
   err_phiQ_b(j) = sigw(j)*phiQ_w9(j) + sigx(j)*phiQ_x9(j) - phiQ_b9(j)
-!
+
 !  Ta = AcoefT + BcoefT phiT_b Delta t
 !  phiT_b = Kech_h C_p (Ta - Ts_b)
@@ -1196,5 +1189,5 @@
     print *, 'wx_pbl_dts_check: j, Ta, phiT_b9, err2_phiT_b ',   &
                             j, Ta(j), phiT_b9(j), err2_phiT_b(j)
-!
+
           ENDDO  ! j = 1, knon
           
@@ -1212,17 +1205,17 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: q1       ! specific humidity in layer 1
     REAL, DIMENSION(knon),        INTENT(IN)        :: Ts       ! surface temperature
-!
+
     REAL, DIMENSION(knon),        INTENT(OUT)       :: evap_pot ! potential evaporation
-!
+
     INTEGER                   :: j
     REAL                      :: qsat_bs
-!
+
  DO j = 1,knon
    evap_pot(j) = Kech_q(j)*(qsat0(j)+dqsatdT0(j)*(Ts(j)-Ts0(j))-q1(j))
-!
+
   qsat_bs = qsat0(j)+dqsatdT0(j)*(Ts(j)-Ts0(j))
 !!  print *,'wx_evappot : Kech_q, qsat_bs, qa, evap_pot ', Kech_q(j), qsat_bs, q1(j), evap_pot(j)
  ENDDO
-!
+
  RETURN
 END SUBROUTINE wx_evappot
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/wx_pbl_var_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
 MODULE wx_pbl_var_mod
-!
+
 ! Split Planetary Boundary Layer variables
-!
+
 ! This module manages the variables necessary for the splitting of the boundary layer 
-! 
-!
+
+
   USE dimphy
 
@@ -12,5 +12,5 @@
   REAL, PROTECTED, SAVE                             :: eps_1, fqsat, smallestreal
 !$OMP THREADPRIVATE(eps_1, fqsat, smallestreal)
-!
+
   REAL, ALLOCATABLE, PROTECTED, DIMENSION(:), SAVE  :: C_p, L_v
 !$OMP THREADPRIVATE(C_p, L_v)
@@ -70,7 +70,7 @@
 
 CONTAINS
-!
+
 !****************************************************************************************
-!
+
 SUBROUTINE wx_pbl_init
 
@@ -82,5 +82,5 @@
 !****************************************************************************************
 ! Allocate module variables
-!
+
 !****************************************************************************************    
 
@@ -314,13 +314,13 @@
                                  Kech_h_x_out, Kech_h_w_out, Kech_h_out  &
                                  )
-!
+
     USE print_control_mod, ONLY: prt_level,lunout
     USE indice_sol_mod, ONLY: is_oce
-!
+
     INCLUDE "YOMCST.h"
     INCLUDE "FCTTRE.h"
     INCLUDE "YOETHF.h"
     INCLUDE "clesphys.h"
-!
+
     INTEGER,                      INTENT(IN)        :: knon    ! number of grid cells
     INTEGER,                      INTENT(IN)        :: nsrf    ! surface type
@@ -340,7 +340,7 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: BcoefT_x, BcoefT_w, BcoefQ_x, BcoefQ_w
     REAL, DIMENSION(knon),        INTENT(IN)        :: BcoefU_x, BcoefU_w, BcoefV_x, BcoefV_w
-!
+
     REAL, DIMENSION(knon),        INTENT(OUT)       :: Kech_h_x_out, Kech_h_w_out, Kech_h_out
-!
+
 ! Local variables
     INTEGER                    :: j
@@ -351,18 +351,17 @@
     REAL                       :: dd_Kq
     REAL                       :: dd_Km
-!
+
     REAL                       :: zdelta, zcvm5, zcor, qsat
-! 
+
     REAL, DIMENSION(knon)      :: sigx       ! fractional area of (x) region
-!
+
 !!!
 !!! jyg le 09/04/2013 ; passage aux nouvelles expressions en differences
 
-!
 !  First computations
 !  ------------------
    eps_1 = 0.5
    smallestreal=tiny(smallestreal)
-!
+
    sigx(1:knon) = 1.-sigw(1:knon)
 ! Compute Cp, Lv, qsat, dqsat_dT.
@@ -371,5 +370,5 @@
    dTs0(1:knon) = ydeltat_s(1:knon)
    q1_0b(1:knon) = sigw(1:knon)*yq_w(1:knon,1)+sigx(1:knon)*yq_x(1:knon,1)
-!
+
 ! fqsat determination 
 ! -------------------
@@ -379,6 +378,6 @@
      fqsat = 1.
    ENDIF
-!
-!
+
+
 !  Reference state
 !  ---------------
@@ -393,5 +392,5 @@
       C_p(j) = RCpd + qsat0(j)*(RCpv - RCpd)
       C_p(j) = RCpd
-!
+
 !      print *,' AAAA wx_pbl0, C_p(j), qsat0(j), Ts0(j) : ', C_p(j), qsat0(j), Ts0(j)
    ENDDO
@@ -420,22 +419,22 @@
 !!      dqsatdT0_w(j) = (RLvtt*(1.-zdelta)+RLSTT*zdelta)*qsat0_w(j)/(Rv*Ts0_w(j)*Ts0_w(j))
    ENDDO
-!
+
    QQ_x(1:knon)  = 1./dqsatdT0_x(1:knon)
    QQ_w(1:knon)  = 1./dqsatdT0_w(1:knon)
    QQ_b(1:knon)  = sigw(1:knon)*QQ_w(1:knon) + sigx(1:knon)*QQ_x(1:knon)
    dd_QQ(1:knon) = QQ_w(1:knon) - QQ_x(1:knon)
-!
+
         DO j=1,knon
-!
+
 ! Exchange coefficients computation
 ! ---------------------------------
-!
+
 ! Wind factor (Warning : this is not valid when using land_surf_orchidee)
          mod_wind_x = min_wind_speed+SQRT(ygustiness(j)+yu_x(j,1)**2+yv_x(j,1)**2)
          mod_wind_w = min_wind_speed+SQRT(ygustiness(j)+yu_w(j,1)**2+yv_w(j,1)**2)
-!
+
 !!         rho1 = ypplay(j,1)/(RD*yt(j,1))
          rho1 = ypplay(j,1)/(RD*(yt_x(j,1) + sigw(j)*(yt_w(j,1)-yt_x(j,1))))
-! 
+
 ! (w) and (x) Exchange coefficients
          Kech_h_x(j) = ycdragh_x(j) * mod_wind_x * rho1
@@ -449,5 +448,5 @@
 !!  Print *,'YYYYpbl0: ycdragh_w, ycdragq_w, mod_wind_w, rho1, Kech_q_w, Kech_h_w ', &
 !!                     ycdragh_w(j), ycdragq_w(j), mod_wind_w, rho1, Kech_q_w(j), Kech_h_w(j)
-!
+
 ! Merged exchange coefficients
          dd_Kh = Kech_h_w(j) - Kech_h_x(j)
@@ -461,37 +460,37 @@
           print *,' dd_Kh: ',dd_Kh
          ENDIF
-!
+
          Kech_h(j) = Kech_h_x(j) + sigw(j)*dd_Kh
          Kech_q(j) = Kech_q_x(j) + sigw(j)*dd_Kq
          Kech_m(j) = Kech_m_x(j) + sigw(j)*dd_Km
-!
+
          Kech_h_x_out(j) = Kech_h_x(j)
          Kech_h_w_out(j) = Kech_h_w(j)
          Kech_h_out(j)   = Kech_h(j)
-!
+
 ! Effective exchange coefficient computation
 ! ------------------------------------------
         Kech_T_px(j) = Kech_h_x(j)/(1.-BcoefT_x(j)*Kech_h_x(j)*dtime)
         Kech_T_pw(j) = Kech_h_w(j)/(1.-BcoefT_w(j)*Kech_h_w(j)*dtime)
-!
+
         Kech_Q_px(j) = Kech_q_x(j)/(1.-BcoefQ_x(j)*Kech_q_x(j)*dtime)
         Kech_Q_pw(j) = Kech_q_w(j)/(1.-BcoefQ_w(j)*Kech_q_w(j)*dtime)
-!
+
         Kech_U_px(j) = Kech_m_x(j)/(1.-BcoefU_x(j)*Kech_m_x(j)*dtime)
         Kech_U_pw(j) = Kech_m_w(j)/(1.-BcoefU_w(j)*Kech_m_w(j)*dtime)
-!
+
         Kech_V_px(j) = Kech_m_x(j)/(1.-BcoefV_x(j)*Kech_m_x(j)*dtime)
         Kech_V_pw(j) = Kech_m_w(j)/(1.-BcoefV_w(j)*Kech_m_w(j)*dtime)
-!
+
          dd_KTp(j) = Kech_T_pw(j) - Kech_T_px(j)
          dd_KQp(j) = Kech_Q_pw(j) - Kech_Q_px(j)
          dd_KUp(j) = Kech_U_pw(j) - Kech_U_px(j)
          dd_KVp(j) = Kech_V_pw(j) - Kech_V_px(j)
-!
+
         Kech_Tp(j) = Kech_T_px(j) + sigw(j)*dd_KTp(j)
         Kech_Qp(j) = Kech_Q_px(j) + sigw(j)*dd_KQp(j)
         Kech_Up(j) = Kech_U_px(j) + sigw(j)*dd_KUp(j)
         Kech_Vp(j) = Kech_V_px(j) + sigw(j)*dd_KVp(j)
-!
+
 ! Store AQ and BQ in the module variables
        AQ_x(j) = AcoefQ_x(j)
@@ -499,10 +498,10 @@
        BQ_x(j) = BcoefQ_x(j)
        BQ_w(j) = BcoefQ_w(j)
-!
+
 ! Calcul des differences w-x
        dd_Cdragm(j) = ycdragm_w(j) - ycdragm_x(j)
        dd_Cdragh(j) = ycdragh_w(j) - ycdragh_x(j)
        dd_Cdragq(j) = ycdragq_w(j) - ycdragq_x(j)
-!
+
        dd_AT(j) = AcoefT_w(j) - AcoefT_x(j)
        dd_AQ(j) = AcoefQ_w(j) - AcoefQ_x(j)
@@ -513,11 +512,11 @@
        dd_BU(j) = BcoefU_w(j) - BcoefU_x(j)
        dd_BV(j) = BcoefV_w(j) - BcoefV_x(j)
-!
+
        KxKwTp(j) = Kech_T_px(j)*Kech_T_pw(j)
        KxKwQp(j) = Kech_Q_px(j)*Kech_Q_pw(j)
        KxKwUp(j) = Kech_U_px(j)*Kech_U_pw(j)
        KxKwVp(j) = Kech_V_px(j)*Kech_V_pw(j)
-!                                           
-!
+
+
        IF (prt_level >=10) THEN
           print *,'Variables pour la fusion : Kech_T_px(j)' ,Kech_T_px(j)
@@ -537,8 +536,8 @@
                                  BcoefQ_x, BcoefQ_w &
                                  )
-!
+
     USE print_control_mod, ONLY: prt_level,lunout
     USE indice_sol_mod, ONLY: is_oce
-!
+
     INTEGER,                      INTENT(IN)        :: knon    ! number of grid cells
     REAL,                         INTENT(IN)        :: dtime   ! time step size (s)
@@ -546,25 +545,25 @@
     REAL, DIMENSION(knon),        INTENT(IN)        :: beta ! evaporation by potential evaporation
     REAL, DIMENSION(knon),        INTENT(IN)        :: BcoefQ_x, BcoefQ_w
-!
+
 ! Local variables
     INTEGER                    :: j
-!
+
    DO j = 1, knon
-!
+
         qsatsrf0_x(j) = beta(j)*qsat0_x(j)
         qsatsrf0_w(j) = beta(j)*qsat0_w(j)
         dqsatsrf0(j)  = qsatsrf0_w(j) - qsatsrf0_x(j)
-!
+
         Kech_Q_sx(j) = Kech_q_x(j)/(1.-beta(j)*BcoefQ_x(j)*Kech_q_x(j)*dtime)
         Kech_Q_sw(j) = Kech_q_w(j)/(1.-beta(j)*BcoefQ_w(j)*Kech_q_w(j)*dtime)
-!
+
         dd_KQs(j) = Kech_Q_sw(j) - Kech_Q_sx(j)
-!
+
         Kech_Qs(j) = Kech_Q_sx(j) + sigw(j)*dd_KQs(j)
-!
+
         KxKwQs(j) = Kech_Q_sx(j)*Kech_Q_sw(j)
-!
+
 !!  print *,'BBBBwx_prelim_beta : beta ', beta(j)
-!
+
   ENDDO ! j = 1, knon
 
@@ -574,10 +573,10 @@
 
 SUBROUTINE wx_pbl_final
-!
+
 !****************************************************************************************
 ! Deallocate module variables
-!
+
 !****************************************************************************************    
-!
+
     IF (ALLOCATED(C_p))           DEALLOCATE(C_p)
     IF (ALLOCATED(L_v))           DEALLOCATE(L_v)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/yamada4.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/yamada4.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/yamada4.F90	(revision 5099)
@@ -12,11 +12,11 @@
   IMPLICIT NONE
   ! ************************************************************************************************
-  !
+
   ! yamada4: subroutine qui calcule le transfert turbulent avec une fermeture d'ordre 2 ou 2.5
-  ! 
+
   ! Reference: Simulation of nocturnal drainage flows by a q2l Turbulence Closure Model
   !            Yamada T.
   !            J. Atmos. Sci, 40, 91-106, 1983
-  !
+
   !************************************************************************************************
   ! Input :
@@ -39,5 +39,5 @@
   ! ustar: vitesse de friction calcul??e par une formule diagnostique 
   ! iflag_pbl: flag pour choisir des options du sch??ma de turbulence
-  !
+
   !             iflag_pbl doit valoir entre 6 et 9
   !             l=6, on prend  systematiquement une longueur d'equilibre
@@ -49,5 +49,5 @@
   !             iflag_pbl=10/11 :  New scheme M2 and N2 explicit and dissiptation exact
   !             iflag_pbl=12 = 11 with vertical diffusion off q2
-  !
+
   !             2013/04/01 (FH hourdin@lmd.jussieu.fr)
   !             Correction for very stable PBLs (iflag_pbl=10 and 11)
@@ -60,5 +60,5 @@
   !             2020/10/01 (EV)
   !               On ajoute la dissipation de la TKE en diagnostique de sortie
-  !                  
+
   ! Inpout/Output :
   !==============
@@ -75,5 +75,5 @@
   ! kn : diffusivite turbulente des scalaires (au bas de chaque couche)
   ! (en sortie : la valeur a la fin du pas de temps)
-  !
+
   !.......................................................................
 
@@ -544,5 +544,5 @@
   ! longueur de m??lange minimale
   !====================================================================
-  !
+
   ! Reference: Local versus Nonlocal boundary-layer diffusion in a global climate model
   !            Holtslag A.A.M. and Boville B.A.
@@ -631,5 +631,5 @@
  ! Estimations de w'2 et T'2 d'apres Abdela et McFarlane
  !======================================================
- !
+
  ! Reference: A New Second-Order Turbulence Closure Scheme for the Planetary Boundary Layer
  !            Abdella K and McFarlane N
@@ -718,10 +718,10 @@
 !             avec un schema implicite en temps avec 
 !             inversion d'un syst??me tridiagonal
-! 
+
 !     Reference: Description of the interface with the surface and 
 !                the computation of the turbulet diffusion in LMDZ
 !                Technical note on LMDZ
 !                Dufresne, J-L, Ghattas, J. and Grandpeix, J-Y
-!
+
 !============================================================================
 ! Declarations
@@ -892,24 +892,24 @@
 ! L'id??e est la suivante: plus il y a de relief, plus il y a du m??lange
 ! induit par les circulations meso et submeso ??chelles.
-!
+
 ! References: * The vertical distribution of wind and turbulent exchange in a neutral atmosphere
 !               Blackadar A.K.
 !               J. Geophys. Res., 64, No 8, 1962
-!
+
 !             * An evaluation of neutral and convective planetary boundary-layer parametrisations relative 
 !               to large eddy simulations
 !               Ayotte K et al 
 !               Boundary Layer Meteorology, 79, 131-175, 1996
-!
-!
+
+
 !             * Local Similarity in the Stable Boundary Layer and Mixing length Approaches: consistency of concepts
 !               Van de Wiel B.J.H et al
 !               Boundary-Lay Meteorol, 128, 103-166, 2008
-!
-!
+
+
 ! Histoire:
 !----------
 ! * premi??re r??daction, Etienne et Frederic, 09/06/2016
-!
+
 ! ***********************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/yamada_c.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/yamada_c.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/yamada_c.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Header$
-!
+
       SUBROUTINE yamada_c(ngrid,timestep,plev,play &
      ,pu,pv,pt,d_u,d_v,d_t,cd,q2,km,kn,kq,d_t_diss,ustar &
@@ -11,5 +11,5 @@
       IMPLICIT NONE
       INCLUDE "YOMCST.h"
-!
+
 ! timestep : pas de temps
 ! g  : g
@@ -31,5 +31,5 @@
 ! kn : diffusivite turbulente des scalaires (au bas de chaque couche)
 !      (en sortie : la valeur a la fin du pas de temps)
-!
+
 !  iflag_pbl doit valoir entre 6 et 9
 !      l=6, on prend  systematiquement une longueur d'equilibre
@@ -41,5 +41,5 @@
 !    iflag_pbl=10/11 :  New scheme M2 and N2 explicit and dissiptation exact
 !    iflag_pbl=12 = 11 with vertical diffusion off q2
-!
+
 !  2013/04/01 (FH hourdin@lmd.jussieu.fr)
 !     Correction for very stable PBLs (iflag_pbl=10 and 11)
@@ -236,5 +236,5 @@
 !  les increments verticaux
 !.......................................................................
-!
+
 !!!!!! allerte !!!!!c
 !!!!!! zlev n'est pas declare a nlev !!!!!c
@@ -246,5 +246,5 @@
 !!!!!! <----
 !!!!!! allerte !!!!!c
-!
+
       DO k=1,nlay
                                                       DO ig=1,ngrid
@@ -263,5 +263,5 @@
       unsdzdec(ig,nlay+1)=1.E+0/(zlev(ig,nlay+1)-zlay(ig,nlay))
                                                      ENDDO
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! Computing M^2, N^2, Richardson numbers, stability functions
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/add_phys_tend_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/add_phys_tend_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/add_phys_tend_mod.F90	(revision 5099)
@@ -1,6 +1,6 @@
-!
+
 ! $Id$
-!
-!
+
+
 MODULE add_phys_tend_mod
 
@@ -120,7 +120,7 @@
   RETURN
 END SUBROUTINE add_pbl_tend
-!
+
 ! $Id$
-!
+
 SUBROUTINE add_phys_tend (zdu,zdv,zdt,zdq,zdql,zdqi,zdqbs,paprs,text, &
                           abortphy,flag_inhib_tend, itap, diag_mode &
@@ -175,5 +175,5 @@
 INTEGER,                        INTENT(IN)    :: diag_mode       ! 0 -> normal effective mode
                                                                  ! 1 -> only conservation stats are computed
-!
+
 REAL, DIMENSION(klon,klev),     INTENT(INOUT) :: zdq
 #ifdef ISO
@@ -204,5 +204,5 @@
 REAL, DIMENSION(ntraciso,klon,klev)   :: sav_xtl_seri, sav_xts_seri, sav_xt_seri
 #endif
-!
+
 INTEGER i, k,j, n
 INTEGER jadrs(klon*klev), jbad
@@ -216,9 +216,8 @@
 logical, save :: first=.true.
 !$OMP THREADPRIVATE(first)
-!
+
 !======================================================================
 ! Variables for energy conservation tests
 !======================================================================
-!
 
 ! zh_col-------  total enthalpy of vertical air column
@@ -234,5 +233,5 @@
 ! zqbs_col------  total mass of blowing snow (kg/m2)
 ! zek_col------  total kinetic energy (kg/m2)
-!
+
 REAL zairm(klon, klev) ! layer air mass (kg/m2)
 REAL zqw_col(klon,2)
@@ -273,5 +272,5 @@
         first=.false.
      endif
-!
+
 !  print *,'add_phys_tend: paprs ',paprs
 ! When in diagnostic mode, save initial values of out variables
@@ -422,5 +421,5 @@
       ENDDO
 ENDIF
-!
+
 !=====================================================================================
 ! Impression, warning et correction en cas de probleme moins important
@@ -531,5 +530,4 @@
 #endif
 #endif
-!
 
 !IM ajout memes tests pour reverifier les jbad, jqbad beg
@@ -572,5 +570,5 @@
       ENDDO
 ENDIF 
-!
+
 IF (jqbad > 0) THEN
       DO j = 1, jqbad
@@ -646,5 +644,5 @@
 
   end if ! end if (fl_ebil .GT. 0)
-!
+
 ! When in diagnostic mode, restore "out" variables to initial values.
   IF (diag_mode == 1) THEN
@@ -706,6 +704,4 @@
 REAL, DIMENSION(nlon,nlev)      :: temp_n, qv_n, ql_n, qs_n, qbs_n
 
-
-!
 INTEGER k, n
 
@@ -713,9 +709,8 @@
 logical, save :: first=.true.
 !$OMP THREADPRIVATE(first)
-!
+
 !======================================================================
 ! Variables for energy conservation tests
 !======================================================================
-!
 
 ! zh_col-------  total enthalpy of vertical air column
@@ -730,5 +725,5 @@
 ! zqbs_col------  total mass of blowing snow (kg/m2)
 ! zek_col------  total kinetic energy (kg/m2)
-!
+
 REAL zairm(nlon, nlev) ! layer air mass (kg/m2)
 REAL zqw_col(nlon,2)
@@ -754,5 +749,5 @@
         first=.false.
      endif
-!
+
 !  print *,'add_phys_tend: paprs ',paprs
 !======================================================================
@@ -832,5 +827,4 @@
 
   end if ! end if (fl_ebil .GT. 0)
-!
 
   RETURN
@@ -978,5 +972,5 @@
   if ( abs(bilq_error) > bilq_seuil) bilq_ok=1
   if ( abs(bilh_error) > bilh_seuil) bilh_ok=1
-!
+
 ! Print diagnostics
 ! =================
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/calwake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/calwake.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/calwake.F90	(revision 5099)
@@ -197,5 +197,4 @@
 d_deltaxtw(:,:,:) = 0.
 #endif
-!
 
   DO i = 1, klon
@@ -214,5 +213,5 @@
     hw(i) = wake_h(i)
   END DO
-!
+
 !    Make a copy of state variables
   DO l = 1, klev
@@ -303,5 +302,4 @@
 #endif
 
-!
   DO l = 1, klev
     DO i = 1, klon
@@ -393,5 +391,4 @@
     END IF
   END DO
-!
 
 !jyg<  
@@ -425,5 +422,5 @@
     END DO
   ENDIF  ! (iflag_wake_tend .EQ. 0)
-!
+
   IF (first) THEN
     DO i = 1,klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/change_srf_frac_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/change_srf_frac_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/change_srf_frac_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id$
-!
+
 MODULE change_srf_frac_mod
 
@@ -7,5 +7,5 @@
 
 CONTAINS
-! 
+
 ! Change Surface Fractions
 ! Author J Ghattas 2008
@@ -18,8 +18,5 @@
 #endif
 &       )
-   
-
-
-!
+
 ! This subroutine is called from physiq.F at each timestep. 
 ! 1- For each type of ocean (force, slab, couple) receive new fractions only if
@@ -28,5 +25,4 @@
 ! 2- Tests and ajustements are done on the fractions 
 ! 3- Initialize variables where a new fraction(new or melted ice) has appered, 
-!
 
     USE dimphy 
@@ -111,5 +107,5 @@
 ! - Put to zero fractions that are too small
 ! - Test total fraction sum is one for each grid point
-!
+
 !****************************************************************************************
     IF (is_modified) THEN
@@ -182,5 +178,5 @@
 ! i.e. where new sea ice has been formed
 ! or where ice free ocean has appread in a grid cell
-! 
+
 !****************************************************************************************
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/climb_hq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/climb_hq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/climb_hq_mod.F90	(revision 5099)
@@ -1,7 +1,7 @@
 MODULE climb_hq_mod
-!
+
 ! Module to solve the verctical diffusion of "q" and "H"; 
 ! specific humidity and potential energi.
-!
+
   USE dimphy
 #ifdef ISO
@@ -42,7 +42,7 @@
 
 CONTAINS
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_hq_down(knon, coefhq, paprs, pplay, &
        delp, temp, q, dtime, &
@@ -67,5 +67,5 @@
 ! for the quantity X=[Q,H] in equation X(k) = C(k) + D(k)*X(k-1), where k is
 ! the index of the vertical layer.
-!
+
 ! Input arguments
 !****************************************************************************************
@@ -147,5 +147,5 @@
 ! 1)
 ! Allocation at first time step only
-!   
+
 !****************************************************************************************
 
@@ -203,5 +203,5 @@
 ! 2)
 ! Definition of the coeficient K 
-!
+
 !****************************************************************************************
     Kcoefhq(:,:) = 0.0
@@ -217,5 +217,5 @@
 ! 3)
 ! Calculation of gama for "Q" and "H"
-!
+
 !****************************************************************************************
 !   surface pressure is used as reference
@@ -278,5 +278,5 @@
 ! 4)
 ! Calculte the coefficients C and D for specific humidity, q
-!
+
 !****************************************************************************************
     
@@ -340,5 +340,5 @@
 ! 5)
 ! Calculte the coefficients C and D for potentiel entalpie, H 
-!
+
 !****************************************************************************************
     h_old(:,:) = 0.0
@@ -358,5 +358,5 @@
 ! 6)
 ! Return the first layer in output variables
-!
+
 !****************************************************************************************
     Acoef_H_out = Acoef_H
@@ -372,5 +372,5 @@
 ! 7)
 ! If Pbl is split, return also the other layers in output variables
-!
+
 !****************************************************************************************
 !!! jyg le 07/02/2012
@@ -415,12 +415,12 @@
 
   END SUBROUTINE climb_hq_down
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE calc_coef(knon, Kcoef, gama, delp, X, Ccoef, Dcoef, Acoef, Bcoef)
-!
+
 ! Calculate the coefficients C and D in : X(k) = C(k) + D(k)*X(k-1)
 ! where X is H or Q, and k the vertical level k=1,klev
-!
+
     INCLUDE "YOMCST.h"
 ! Input arguments
@@ -443,5 +443,5 @@
 !****************************************************************************************
 ! Niveau au sommet, k=klev
-!
+
 !****************************************************************************************
     Ccoef(:,:) = 0.0
@@ -458,5 +458,5 @@
 !****************************************************************************************
 ! Niveau  (klev-1) <= k <= 2
-!
+
 !****************************************************************************************
 
@@ -472,5 +472,5 @@
 !****************************************************************************************
 ! Niveau k=1
-!
+
 !****************************************************************************************
 
@@ -482,7 +482,7 @@
 
   END SUBROUTINE calc_coef
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
   SUBROUTINE climb_hq_up(knon, dtime, t_old, q_old, &
        flx_q1, flx_h1, paprs, pplay, &
@@ -505,5 +505,5 @@
 USE isotopes_verif_mod
 #endif
-! 
+
 ! This routine calculates the flux and tendency of the specific humidity q and 
 ! the potential engergi H. 
@@ -511,5 +511,4 @@
 ! X(k) = C(k) + D(k)*X(k-1) for X=[q,H], where the coefficients 
 ! C and D are known from before and k is index of the vertical layer.
-!   
 
 ! Input arguments
@@ -564,5 +563,5 @@
 ! Definition of some variables
     REAL, DIMENSION(klon,klev)               :: d_h, zairm
-!
+
 !****************************************************************************************
 
@@ -645,5 +644,5 @@
 ! 2)
 ! Calculation of Q and H
-!
+
 !****************************************************************************************
 
@@ -715,5 +714,5 @@
 ! 3)
 ! Calculation of the flux for Q and H
-!
+
 !****************************************************************************************
 
@@ -748,5 +747,5 @@
 ! 4)
 ! Calculation of tendency for Q and H
-!
+
 !****************************************************************************************
     d_h_col_vdf(:) = 0.0
@@ -798,5 +797,5 @@
 !****************************************************************************************
 ! Some deallocations
-!
+
 !****************************************************************************************
     IF (last) THEN
@@ -822,7 +821,7 @@
     END IF
   END SUBROUTINE climb_hq_up
-!
-!****************************************************************************************
-!
+
+!****************************************************************************************
+
 END MODULE climb_hq_mod
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/concvl.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/concvl.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/concvl.F90	(revision 5099)
@@ -215,6 +215,4 @@
 #endif
 
-
-!
 !  Local
 !  ----
@@ -234,5 +232,5 @@
   REAL, DIMENSION(klon)                         :: supmax0, asupmaxmin
   REAL                                          :: zx_t, zdelta, zx_qs, zcor
-!
+
 !   INTEGER iflag_mix
 !   SAVE iflag_mix
@@ -312,7 +310,7 @@
     ALLOCATE (t1(klon,klev))
     ALLOCATE (q1(klon,klev))
-!
+
     convoccur(:) = 0.
-!
+
     itap = 0
     igout = klon/2 + 1/klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv30_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv30_routines.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv30_routines.F90	(revision 5099)
@@ -5009,5 +5009,5 @@
         ! ajout du terme des ddfts sensi stricto
 !        write(*,*) 'tmp cv3_yield 4165: i,il=',i,il
-!
+
         if (option_traceurs.eq.6) then
           do iiso = 1, niso
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90	(revision 5099)
@@ -57,5 +57,5 @@
 !jyg<
 !  noff is chosen such that nl = k_upper so that upmost loops end at about 22 km
-!
+
   noff = min(max(nd-k_upper, 1), (nd+1)/2)
 !!  noff = 1
@@ -1616,7 +1616,7 @@
              qnk(i)*(lv0-clmcpv*(tnk(i)-273.15)) + gznk(i)
   END DO
-!
+
 !  Ice fraction
-!
+
   IF (cvflag_ice) THEN
     DO k = minorig, nl
@@ -1686,17 +1686,16 @@
   END DO
 !>jyg
-!
 
 ! ***  Find lifted parcel quantities above cloud base    ***
 
 !----------------------------------------------------------------------------
-!
+
   IF (icvflag_Tpa == 2) THEN
 #ifdef ISO
         CALL abort_gcm('cv3_routines 1813','isos pas prevus ici',1)
 #endif
-!
+
 !----------------------------------------------------------------------------
-!
+
     DO k = minorig + 1, nl
       DO i = 1,ncum
@@ -1774,5 +1773,5 @@
                   Ux*  (ah0(i) - ahg - ddelta)           /aa
             ENDIF ! (tg .gt. Tx)
-!
+
 !!     print *,' j, k, Um, U, Ux, aa, bb, discr, dd, ddelta ', j, k, Um, U, Ux, aa, bb, discr, dd, ddelta
 !!     print *,' j, k, ah0(i), ahg, tg, qg, tp(i,k), ff ', j, k, ah0(i), ahg, tg, qg, tp(i,k), ff
@@ -1802,9 +1801,9 @@
     END DO ! k = minorig + 1, nl
 !----------------------------------------------------------------------------
-!
+
   ELSE IF (icvflag_Tpa == 1) THEN  ! (icvflag_Tpa == 2)
-!
+
 !----------------------------------------------------------------------------
-!
+
 #ifdef ISO
         CALL abort_gcm('cv3_routines 1813','isos pas prevus ici',1)
@@ -1872,5 +1871,5 @@
         END IF ! (k>=(icbs(i)+1))
       END DO ! i = 1, ncum
-!
+
       IF (cvflag_prec_eject) THEN
 #ifdef ISO
@@ -1898,5 +1897,5 @@
 !   ejection.
 !  =====================================================================================
-!  
+
 !   Verif
             qpreca(i,k) = ejectliq*qpl(i,k) + ejectice*qps(i,k)                                   !!jygprl
@@ -1904,7 +1903,7 @@
             frac_s(i,k) = (1.-ejectliq)*frac(i,k) + &                                             !!jygprl
                ejectliq*(1. - (qpl(i,k)+(1.-frac(i,k))*qcld(i,k))/max(clw(i,k),smallestreal))     !!jygprl
-!          
+
             denomm1 = 1./(1. - qpreca(i,k))
-!          
+
             qta(i,k) = qta(i,k-1) - &
                       qpreca(i,k)*(1.-qta(i,k-1))*denomm1
@@ -1925,13 +1924,13 @@
         END DO ! i = 1, ncum
       ENDIF  ! (cvflag_prec_eject)
-! 
+
     END DO ! k = minorig + 1, nl
-!
+
 !----------------------------------------------------------------------------
-!
+
   ELSE IF (icvflag_Tpa == 0) THEN! (icvflag_Tpa == 2) ELSE IF(icvflag_Tpa == 1)
-!
+
 !----------------------------------------------------------------------------
-!
+
   DO k = minorig + 1, nl
     DO i = 1, ncum
@@ -2160,5 +2159,5 @@
 
 !----------------------------------------------------------------------------
-!
+
   ENDIF ! (icvflag_Tpa == 2) ELSEIF (icvflag_Tpa == 1) ELSE (icvflag_Tpa == 0)
 #ifdef ISOVERIF
@@ -2170,12 +2169,12 @@
   enddo
 #endif
-!
+
 !----------------------------------------------------------------------------
-!
+
 ! =====================================================================
 ! --- SET THE PRECIPITATION EFFICIENCIES 
 ! --- THESE MAY BE FUNCTIONS OF TP(I), P(I) AND CLW(I)
 ! =====================================================================
-!
+
   IF (flag_epkeorig/=1) THEN
     DO k = 1, nl ! convect3
@@ -2213,5 +2212,5 @@
     END DO
   END IF
-!
+
 !   =========================================================================
   IF (prt_level >= 10) THEN
@@ -2219,5 +2218,5 @@
                           (k, tp(1,k), tvp(1,k), k = 1,nl)
   ENDIF
-!
+
 ! =====================================================================
 ! --- CALCULATE VIRTUAL TEMPERATURE AND LIFTED PARCEL
@@ -2451,7 +2450,7 @@
 
 !jyg : cvflag_ice test outside the loops (07042015)
-!
+
   IF (cvflag_ice) THEN
-!
+
   IF (cvflag_prec_eject) THEN
 !!    DO k = minorig + 1, nl
@@ -2485,7 +2484,7 @@
       END DO
     END DO
-!
+
   ELSE   ! (cvflag_ice)
-!
+
     DO k = minorig + 1, nl
       DO i = 1, ncum
@@ -2501,5 +2500,5 @@
       END DO
     END DO
-!
+
   END IF  ! (cvflag_ice)
 
@@ -2514,5 +2513,5 @@
 ! ===================================================================
 ! ---  CLOSURE OF CONVECT3
-!
+
 ! vectorization: S. Bony
 ! ===================================================================
@@ -3820,7 +3819,6 @@
   END DO
 
-!
 ! Get adiabatic ascent mass flux 
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (adiab_ascent_mass_flux_depends_on_ejectliq) THEN
@@ -3857,7 +3855,7 @@
 
 ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-!
+
 ! ***                    begin downdraft loop                    ***
-!
+
 ! ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 
@@ -3878,6 +3876,6 @@
 ! ***  integrate liquid water equation to find condensed water   ***
 ! ***                and condensed water flux                    ***
-!
-!
+
+
 ! ***              calculate detrained precipitation             ***
 
@@ -4088,10 +4086,9 @@
         bfac = 1./(sigd(il)*wt(il,i))
 
-!
     IF (prt_level >= 20) THEN
       Print*, 'cv3_unsat after provisional rp estimate: rp, afac, bfac ', &
           i, rp(1, i), afac,bfac
     ENDIF
-!
+
 !JYG1
 ! cc        sigt=1.0
@@ -4171,10 +4168,9 @@
           evap(il, i) = (wdtrain(il)+sigd(il)*wt(il,i)*(prec(il,i+1)-prec(il,i))) / &
                         (sigd(il)*(ph(il,i)-ph(il,i+1))*100.)
-!
+
     IF (prt_level >= 20) THEN
       Print*, 'cv3_unsat after evap computation: wdtrain, sigd, wt, prec(i+1),prec(i) ', &
           i, wdtrain(1), sigd(1), wt(1,i), prec(1,i+1),prec(1,i)
     ENDIF
-!
 
 !jyg<
@@ -4403,10 +4399,9 @@
     END DO
 ! ----------------------------------------------------------------
-!
+
     IF (prt_level >= 20) THEN
       Print*, 'cv3_unsat after mp computation: mp, b(i), b(i-1) ', &
           i, mp(1, i), b(1,i), b(1,max(i-1,1))
     ENDIF
-!
 
 ! ***       find mixing ratio of precipitating downdraft     ***
@@ -4766,5 +4761,5 @@
       REAL, DIMENSION (ntraciso,nloc, na), INTENT (IN)            :: xtice
 #endif
-!
+
 !input/output:
       REAL, DIMENSION (nloc, na), INTENT (INOUT)         :: m, mp
@@ -4773,5 +4768,5 @@
       REAL, DIMENSION (nloc, nd), INTENT (INOUT)         :: sig
       REAL, DIMENSION (nloc), INTENT (INOUT)             :: sigd
-!
+
 !outputs:
       REAL, DIMENSION (nloc), INTENT (OUT)               :: precip
@@ -4794,5 +4789,5 @@
       real, DIMENSION (ntraciso,nloc, nd+1), INTENT (OUT) :: xtVprecip, xtVprecipi
 #endif
-!
+
 !local variables:
       INTEGER                                            :: i, k, il, n, j, num1
@@ -4863,5 +4858,5 @@
 #endif
 #endif
-! 
+
 ! -------------------------------------------------------------
 
@@ -5134,5 +5129,5 @@
   ENDIF ! (adiab_ascent_mass_flux_depends_on_ejectliq) ELSE
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!
+
 !    print*,'cv3_yield avant ft'
 ! am is the part of cbmf taken from the first level
@@ -5408,17 +5403,16 @@
            IF (ok_optim_yield) THEN                       !|
 !-----------------------------------------------------------
-!
+
 !***                                                      ***
 !***    Compute convective mass fluxes upwd and dnwd      ***
 
-!
 ! =================================================
 !              upward fluxes                      |
 ! ------------------------------------------------
-!
+
 upwd(:,:) = 0.
 up_to(:,:) = 0.
 up_from(:,:) = 0.
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   IF (adiab_ascent_mass_flux_depends_on_ejectliq) THEN
@@ -5428,5 +5422,5 @@
 !! WARNING : in the present version, taking into account the mass-flux decrease due to 
 !! precipitation ejection leads to water conservation violation.
-!
+
 ! - Upward mass flux of mixed draughts
 !---------------------------------------
@@ -5440,5 +5434,5 @@
   ENDDO
 ENDDO
-!
+
 DO j = 3, nl
   DO i = 2, j-1
@@ -5450,9 +5444,9 @@
   ENDDO
 ENDDO
-!
+
 ! The difference between upwd(il,i) and upwd(il,i-1) is due to updrafts ending in layer 
 !(i-1) (theses drafts cross interface (i-1) but not interface(i)) and to updrafts starting 
 !from layer (i-1) (theses drafts cross interface (i) but not interface(i-1)): 
-! 
+
 DO i = 2, nlp
   DO il = 1, ncum
@@ -5462,5 +5456,5 @@
   ENDDO
 ENDDO
-!
+
 ! - Total upward mass flux
 !---------------------------
@@ -5477,5 +5471,5 @@
 !! The decrease of the adiabatic ascent mass flux due to ejection of precipitation 
 !! is not taken into account. 
-!
+
 ! - Upward mass flux
 !-------------------
@@ -5494,5 +5488,5 @@
   ENDDO
 ENDDO
-!
+
 DO i = 1, nl
   DO il = 1, ncum
@@ -5502,5 +5496,5 @@
   ENDDO
 ENDDO
-!
+
 DO j = 3, nl
   DO i = 2, j-1
@@ -5512,9 +5506,9 @@
   ENDDO
 ENDDO
-!
+
 ! The difference between upwd(il,i) and upwd(il,i-1) is due to updrafts ending in layer 
 !(i-1) (theses drafts cross interface (i-1) but not interface(i)) and to updrafts starting 
 !from layer (i-1) (theses drafts cross interface (i) but not interface(i-1)): 
-! 
+
 DO i = 2, nlp
   DO il = 1, ncum
@@ -5529,5 +5523,4 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-!
 ! =================================================
 !              downward fluxes                    |
@@ -5546,5 +5539,5 @@
   ENDDO
 ENDDO
-!
+
 DO j = 1, nl
   DO i = j+1, nl
@@ -5557,9 +5550,9 @@
   ENDDO
 ENDDO
-!
+
 ! The difference between dnwd(il,i) and dnwd(il,i+1) is due to downdrafts ending in layer 
 !(i) (theses drafts cross interface (i+1) but not interface(i)) and to downdrafts 
 !starting from layer (i) (theses drafts cross interface (i) but not interface(i+1)): 
-!
+
 DO i = nl-1, 1, -1
   DO il = 1, ncum
@@ -5569,5 +5562,5 @@
 ENDDO
 ! =================================================
-!
+
 !-----------------------------------------------------------
         ENDIF !(ok_optim_yield)                           !|
@@ -5593,5 +5586,4 @@
     IF (num1<=0) GO TO 500
 
-!
 !jyg<
 !-----------------------------------------------------------
@@ -5651,9 +5643,9 @@
       END DO
     END DO
-!
+
 !-----------------------------------------------------------
         ENDIF !(ok_optim_yield)                           !|
 !-----------------------------------------------------------
-!
+
 !!   print *,'yield, i, amp1, ad', i, amp1(1), ad(1)
 
@@ -5712,5 +5704,5 @@
                                     t(il,i)*(cpv-cpd)*(rr(il,i)-qent(il,i,i)))*cpinv
         END IF
-!
+
 ! sb: on ne fait pas encore la correction permettant de mieux
 ! conserver l'eau:
@@ -5848,5 +5840,5 @@
         ! ajout du terme des ddfts sensi stricto
 !        write(*,*) 'tmp cv3_yield 4165: i,il=',i,il
-!
+
         if (option_traceurs.eq.6) then
           do iiso = 1, niso
@@ -6153,5 +6145,5 @@
             ft(il, i) = ft(il, i) + 0.01*grav*dpinv*ment(il, k, i) * &
                  (hent(il,k,i)-h(il,i)+t(il,i)*(cpv-cpd)*(rr(il,i)+awat(il)-qent(il,k,i)))*cpinv
-!
+
 #ifdef ISO
         ! on change le traitement de cette ligne le 8 mai 2009:
@@ -6192,5 +6184,5 @@
        ! end cam verif 
 #endif
-!
+
           END IF ! i
         END DO
@@ -6814,10 +6806,9 @@
     END IF
   END DO
-!
+
     IF (prt_level >= 5) THEN
       print *,' CV3_YIELD : alpha_qpos ',alpha_qpos(1)
     ENDIF
 
-!
   DO il = 1, ncum
     IF (iflag(il)<=1) THEN
@@ -7303,5 +7294,5 @@
   REAL, DIMENSION (len, na, na), INTENT (OUT)        :: phi, phi2, epmlmMm
   REAL, DIMENSION (len, na), INTENT (OUT)            :: da, d1a, dam, eplaMm
-!
+
 ! variables pour tracer dans precip de l'AA et des mel
 !local variables:
@@ -7600,5 +7591,5 @@
 !AC! 2110    continue
 !AC! 2100   continue
-!
+
   RETURN
 END SUBROUTINE cv3_uncompress
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3a_compress.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3a_compress.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3a_compress.F90	(revision 5099)
@@ -78,8 +78,8 @@
   REAL, DIMENSION (ntraciso,len,nd), INTENT (IN)     :: xt1_wake
 #endif
-!
+
   ! in/out 
   INTEGER, INTENT (INOUT)                            :: ncum
-!
+
   ! outputs:
   ! en fait, on a nloc=len pour l'instant (cf cv_driver)
@@ -175,5 +175,5 @@
     END DO
   END DO
-!
+
   ! AC!      do 121 j=1,ntra
   ! AC!ccccc      do 111 k=1,nl+1
@@ -230,10 +230,10 @@
     CALL abort_physic(modname, abort_message, 1)
   END IF
-!
+
 !jyg<
   ELSE  !(compress)
-!
+
       ncum = len
-!
+
       wghti(:,1:nl+1) = wghti1(:,1:nl+1)
       t(:,1:nl+1) = t1(:,1:nl+1)
@@ -271,5 +271,5 @@
       xt_wake(:,:,1:nl+1) = xt1_wake(:,:,1:nl+1)
 #endif
-!
+
       s_wake(:) = s1_wake(:)
       iflag(:) = iflag1(:)
@@ -293,5 +293,5 @@
       xtnk(:,:) = xtnk1(:,:)
 #endif
-!
+
   ENDIF !(compress)
 !>jyg
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3a_uncompress.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3a_uncompress.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3a_uncompress.F90	(revision 5099)
@@ -390,8 +390,8 @@
     ! 2210     enddo
     ! 2220    enddo
-!
+
 !jyg<
   ELSE  !(compress)
-!
+
       sig1(:,nd) = sig(:,nd)
       ptop21(:) = ptop2(:)
@@ -415,5 +415,5 @@
           xtprecip1(:,:)=xtprecip(:,:)
 #endif
-!
+
       sig1(:, 1:nl) = sig(:, 1:nl)
       w01(:, 1:nl) = w0(:, 1:nl)
@@ -451,5 +451,5 @@
       sigt1(:, 1:nl) = sigt(:, 1:nl)
       detrain1(:, 1:nl) = detrain(:, 1:nl)
-!
+
       ma1(:, nlp) = 0.
       vprecip1(:, nlp) = 0.
@@ -459,5 +459,4 @@
       dnwd01(:, nlp) = 0.
 
-!
       phi1    (:, 1:nl, 1:nl) = phi    (:, 1:nl, 1:nl)  !AC!
       phi21   (:, 1:nl, 1:nl) = phi2   (:, 1:nl, 1:nl)  !RomP
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3p_mixing.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3p_mixing.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3p_mixing.F90	(revision 5099)
@@ -154,5 +154,5 @@
             fmax, gammas, qqa1, qqa2, Qcoef1max, Qcoef2max
 !>jyg
-!
+
   END IF
 
@@ -813,12 +813,12 @@
 !                             (1.+lv(il,j)*lv(il,j)*rs(il,j) / &
 !                              ((cpd*(1.-Qent(il,i,j))+Qent(il,i,j)*cpv)*rrv*t(il,j)*t(il,j)))
-!
+
 !       Computation of condensate amount Elij, taking into account the ice fraction frac
 !       Warning : the same saturation humidity rs is used over both liquid water and ice; this
 !                 should be corrected.
-!
+
 !  Heat capacity of mixed draught
     cpm = cpd+Qent(il,i,j)*(cpv-cpd)
-!
+
     IF (cvflag_ice .and. frac(il,j) > 0.) THEN
             elij(il, i, j) = Qent(il, i, j) - rs(il, j)
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_driver.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_driver.F90	(revision 5099)
@@ -1243,5 +1243,5 @@
   cvflag_grav = .TRUE.
   cvflag_ice = iflag_ice_thermo >= 1
-  !
+
 ! si icvflag_Tpa=0, alors la fraction de glace dans l'ascendance adiabatique est
   ! fonction de la temperature de l'environnement et la temperature de l'ascendance est 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cva_driver.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cva_driver.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cva_driver.F90	(revision 5099)
@@ -431,5 +431,4 @@
 !        14     No moist convection; atmosphere is very
 !               stable (=> no computation)
-!
 
 ! ft:   Array of temperature tendency (K/s) of dimension ND, defined at same
@@ -1066,7 +1065,7 @@
 !   If the fraction of convective points is larger than comp_threshold, then compression
 !   is assumed useless.
-!
+
   compress = ncum < len*comp_threshold
-!
+
   IF (.not. compress) THEN
     DO i = 1,len
@@ -1074,5 +1073,5 @@
     ENDDO
   ENDIF
-!
+
 #ifdef ISO
 #ifdef ISOVERIF
@@ -1480,5 +1479,5 @@
 #endif
                      )
-!
+
       IF (prt_level >= 10) THEN
         Print *, 'cva_driver after cv3_unsat:mp , water, ice, evap, fondue '
@@ -1494,5 +1493,5 @@
         ENDDO
       ENDIF
-!
+
     END IF  !(iflag_con==3)
 
@@ -1594,7 +1593,6 @@
 #endif
             )
-!
+
 !         Test conseravtion de l'eau
-!
 
 #ifdef ISOVERIF
@@ -1628,5 +1626,5 @@
         PRINT *, ' cv3_yield -> fqd(1) = ', fqd(igout, 1)
       END IF !(debut) THEN
-!   
+
       IF (prt_level >= 10) THEN
         Print *, 'cva_driver after cv3_yield:ft(1) , ftd(1) ', &
@@ -1635,5 +1633,5 @@
                     fq(igout,1), fqd(igout,1)
       ENDIF
-!   
+
     END IF
 
@@ -1747,5 +1745,4 @@
 #endif 
 
-!   
       IF (prt_level >= 10) THEN
         Print *, 'cva_driver after cv3_uncompress:ft1(1) , ftd1(1) ', &
@@ -1754,5 +1751,5 @@
                     fq1(igout,1), fqd1(igout,1)
       ENDIF
-!   
+
     END IF
 
@@ -1772,6 +1769,6 @@
 
   END IF ! ncum>0
-!
-!
+
+
   DO i = 1,len
     IF (iflag1(i) == 14) THEN
@@ -1781,5 +1778,4 @@
   ENDDO
 
-!
 ! In order take into account the possibility of changing the compression,
 ! reset m, sig and w0 to zero for non-convective points.
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90	(revision 5099)
@@ -2163,5 +2163,5 @@
 #endif
           ! end verif
-          !
+
      else !if (t1lay(i).ge.0.0) then   
           do ixt=1,niso
@@ -16617,7 +16617,7 @@
 !#ifdef ISOHTO
 !===================================================================
-!
+
 !   subroutines utilisees par iso_tritium: ecrites par Alexandre Cauquoin
-!
+
 !===================================================================
 
@@ -17932,7 +17932,7 @@
 
 !===================================================================
-!
+
 !   End subroutine iso_tritium
-!
+
 !===================================================================
 
@@ -17940,8 +17940,8 @@
 
 !===================================================================
-!
+
 ! Subroutine chargement des tableaux de donnees pour production 
 ! nucleaire de tritium --> call dans iso_init.F
-!
+
 !===================================================================
 
@@ -18047,7 +18047,7 @@
 
 !===================================================================
-!
+
 ! Subroutines production nucleaire utilisees par iso_tritium
-!
+
 !===================================================================
 
@@ -18501,7 +18501,7 @@
 !#endif
 !===================================================================
-!
+
 !   End subroutines utilisees par iso_tritium
-!
+
 !===================================================================
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotrac_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotrac_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotrac_mod.F90	(revision 5099)
@@ -11,5 +11,5 @@
 
 !=== CONTENT: ALL THE ISOTOPIC TRACERS RELATED VARIABLES ===
-!
+
 ! option 1: on trace evap ocean et continent separement  
 ! option 2: on trace evap ocean, continent et evap precip
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/limit_read_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/limit_read_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/limit_read_mod.F90	(revision 5099)
@@ -1,9 +1,9 @@
-!
+
 ! $Id: limit_read_mod.F90 3435 2019-01-22 15:21:59Z fairhead $
-!
+
 MODULE limit_read_mod
-!
+
 ! This module reads the fichier "limit.nc" containing fields for surface forcing.
-!
+
 ! Module subroutines :
 !  limit_read_frac    : call limit_read_tot and return the fractions
@@ -11,5 +11,5 @@
 !  limit_read_sst     : return sea ice temperature   
 !  limit_read_tot     : read limit.nc and store the fields in local modules variables
-!
+
   IMPLICIT NONE
 
@@ -54,5 +54,5 @@
   
   SUBROUTINE limit_read_frac(itime, dtime, jour, pctsrf_new, is_modified)
-!
+
 ! This subroutine is called from "change_srf_frac" for case of 
 ! ocean=force or from ocean_slab_frac for ocean=slab.
@@ -89,9 +89,9 @@
        knon, knindex, &
        rugos_out, alb_out)
-!
+
 ! This subroutine is called from surf_land_bucket. 
 ! The flag "ok_veget" must can not be true. If coupled run, "ocean=couple"
 ! then this routine will call limit_read_tot.
-!
+
     USE dimphy
     USE surface_data
@@ -139,7 +139,7 @@
 #endif           
     )
-!
+
 ! This subroutine returns the sea surface temperature already read from limit.nc.
-!
+
     USE dimphy, ONLY : klon
 #ifdef ISO
@@ -260,7 +260,7 @@
 
   SUBROUTINE limit_read_tot(itime, dtime, jour, is_modified)
-!
+
 ! Read everything needed from limit.nc
-!
+
 ! 0) Initialize
 ! 1) Open the file limit.nc, if it is time
@@ -332,5 +332,5 @@
 !****************************************************************************************
 ! 0) Initialization
-!
+
 !****************************************************************************************
     IF (first_call) THEN
@@ -353,5 +353,5 @@
        IF (is_mpi_root) THEN ! Only master processus
           ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,&
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,&
                'Pb d''ouverture du fichier de conditions aux limites',1)
 
@@ -359,5 +359,5 @@
           ierr=NF90_INQ_VARID(nid, 'TEMPS', nvarid)
           ierr=NF90_GET_ATT(nid, nvarid, 'calendar', calendar)
-          IF(ierr==NF90_NOERR.AND.calendar/=calend.AND.prt_level>=1) THEN
+          IF(ierr==nf90_noerr.AND.calendar/=calend.AND.prt_level>=1) THEN
              WRITE(lunout,*)'BEWARE: gcm and limit.nc calendars differ: '
              WRITE(lunout,*)'  '//TRIM(calend)//' for gcm'
@@ -371,5 +371,5 @@
             ierr=NF90_INQUIRE(nid, UnlimitedDimID=ndimid)
           ENDIF
-          ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn)
+          ierr=nf90_inquire_dimension(nid, ndimid, len=nn)
           WRITE(abort_message,'(a,2(i0,a))')'limit.nc records number (',nn,') does no'//&
             't match year length (',year_len,')'
@@ -382,5 +382,5 @@
             ierr=nf90_inq_dimid(nid, 'points_physiques', ndimid)
           ENDIF
-          ierr=NF90_INQUIRE_DIMENSION(nid, ndimid, len=nn)
+          ierr=nf90_inquire_dimension(nid, ndimid, len=nn)
           WRITE(abort_message,'(a,2(i0,a))')'limit.nc horizontal number of cells (',nn, &
             ') does not match LMDZ klon_glo (',klon_glo,')'
@@ -388,5 +388,5 @@
 
           ierr = NF90_CLOSE(nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Pb when closing file', 1)
        END IF ! is_mpi_root
 !$OMP END MASTER
@@ -398,5 +398,5 @@
 !    The file is read only by the master thread of the master mpi process(is_mpi_root)
 !    Check by the way if the number of records is correct.
-!
+
 !****************************************************************************************
 
@@ -451,5 +451,5 @@
 
           ierr = NF90_OPEN ('limit.nc', NF90_NOWRITE, nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,&
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,&
                'Pb d''ouverture du fichier de conditions aux limites',1)
 
@@ -463,40 +463,40 @@
 !****************************************************************************************
 ! 2) Read fraction if not type_ocean=couple
-!
+
 !****************************************************************************************
 
           IF ( type_ocean /= 'couple') THEN
-!
+
 ! Ocean fraction
              ierr = NF90_INQ_VARID(nid, 'FOCE', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname, 'Le champ <FOCE> est absent',1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname, 'Le champ <FOCE> est absent',1)
              
-             ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_oce),start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FOCE>' ,1)
-!
+             ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_oce),start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FOCE>' ,1)
+
 ! Sea-ice fraction
              ierr = NF90_INQ_VARID(nid, 'FSIC', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FSIC> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_sic),start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FSIC>' ,1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <FSIC> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_sic),start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FSIC>' ,1)
 
 
 ! Read land and continentals fraction only if asked for
              IF (read_continents .OR. itime == 1) THEN
-!
+
 ! Land fraction
                 ierr = NF90_INQ_VARID(nid, 'FTER', nvarid)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FTER> est absent',1)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <FTER> est absent',1)
                 
-                ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_ter),start,epais)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FTER>',1)
-!
+                ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_ter),start,epais)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FTER>',1)
+
 ! Continentale ice fraction
                 ierr = NF90_INQ_VARID(nid, 'FLIC', nvarid)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <FLIC> est absent',1)
-
-                ierr = NF90_GET_VAR(nid,nvarid,pct_glo(:,is_lic),start,epais)
-                IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <FLIC>',1)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <FLIC> est absent',1)
+
+                ierr = nf90_get_var(nid,nvarid,pct_glo(:,is_lic),start,epais)
+                IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <FLIC>',1)
              END IF
 
@@ -505,21 +505,21 @@
 !****************************************************************************************
 ! 3) Read sea-surface temperature, if not coupled ocean
-!
+
 !****************************************************************************************
           IF ( type_ocean /= 'couple') THEN
 
              ierr = NF90_INQ_VARID(nid, 'SST', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <SST> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,sst_glo,start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <SST>',1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <SST> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,sst_glo,start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <SST>',1)
           
 #ifdef ISO
              IF ((iso_HTO.gt.0).and.(ok_prod_nucl_tritium)) THEN
                ierr = NF90_INQ_VARID(nid, 'TUOCE', nvarid)
-               IF (ierr /= NF90_NOERR) CALL abort_gcm(modname,'Le champ <TUOCE> est absent',1)
-
-               ierr = NF90_GET_VAR(nid,nvarid,tuoce_glo,start,epais)
-               IF (ierr /= NF90_NOERR) CALL abort_gcm(modname,'Lecture echouee pour <TUOCE>',1)
+               IF (ierr /= nf90_noerr) CALL abort_gcm(modname,'Le champ <TUOCE> est absent',1)
+
+               ierr = nf90_get_var(nid,nvarid,tuoce_glo,start,epais)
+               IF (ierr /= nf90_noerr) CALL abort_gcm(modname,'Lecture echouee pour <TUOCE>',1)
              END IF
 #ifdef ISOVERIF
@@ -539,22 +539,22 @@
 !****************************************************************************************
 ! 4) Read albedo and rugosity for land surface, only in case of no vegetation model
-!
+
 !****************************************************************************************
 
           IF (.NOT. ok_veget) THEN
-!
+
 ! Read albedo
              ierr = NF90_INQ_VARID(nid, 'ALB', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <ALB> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,alb_glo,start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <ALB>',1)
-!
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <ALB> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,alb_glo,start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <ALB>',1)
+
 ! Read rugosity
              ierr = NF90_INQ_VARID(nid, 'RUG', nvarid)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Le champ <RUG> est absent',1)
-
-             ierr = NF90_GET_VAR(nid,nvarid,rug_glo,start,epais)
-             IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Lecture echouee pour <RUG>',1)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Le champ <RUG> est absent',1)
+
+             ierr = nf90_get_var(nid,nvarid,rug_glo,start,epais)
+             IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Lecture echouee pour <RUG>',1)
 
           END IF
@@ -562,8 +562,8 @@
 !****************************************************************************************
 ! 5) Close file and distribuate variables to all processus
-!
+
 !****************************************************************************************
           ierr = NF90_CLOSE(nid)
-          IF (ierr /= NF90_NOERR) CALL abort_physic(modname,'Pb when closing file', 1)
+          IF (ierr /= nf90_noerr) CALL abort_physic(modname,'Pb when closing file', 1)
        ENDIF ! is_mpi_root
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_lscp_old.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_lscp_old.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_lscp_old.F90	(revision 5099)
@@ -1,6 +1,6 @@
-!
+
 ! $Id: fisrtilp.F90 3493 2019-05-07 08:45:07Z idelkadi $
-!
-!
+
+
 MODULE lmdz_lscp_old
 CONTAINS
@@ -18,5 +18,4 @@
         )
 
-  !
   USE dimphy
   USE icefrac_lsc_mod ! compute ice fraction (JBM 3/14)
@@ -95,7 +94,7 @@
   !======================================================================
   include "YOMCST.h"
-  !
+
   ! Principaux inputs:
-  !
+
   REAL, INTENT(IN)                              :: dtime  ! intervalle du temps (s)
   REAL, DIMENSION(klon,klev+1),    INTENT(IN)   :: paprs  ! pression a inter-couche
@@ -106,17 +105,17 @@
   INTEGER,                         INTENT(IN)   :: iflag_cld_th
   INTEGER,                         INTENT(IN)   :: iflag_ice_thermo
-  !
+
   ! Inputs lies aux thermiques
-  ! 
+
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: ztv
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: zqta, fraca 
   REAL, DIMENSION(klon,klev),      INTENT(IN)   :: zpspsk, ztla
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)   :: zthl
-  !
+
   !  Input/output
   REAL, DIMENSION(klon,klev),      INTENT(INOUT):: ratqs  ! determine la largeur de distribution de vapeur
-  !
+
   ! Principaux outputs:
-  !
+
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: d_t  ! incrementation de la temperature (K)
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: d_q  ! incrementation de la vapeur d'eau
@@ -152,19 +151,19 @@
   !AA
   ! Coeffients de fraction lessivee : pour OFF-LINE
-  !
+
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)  :: pfrac_nucl
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)  :: pfrac_1nucl
   REAL, DIMENSION(klon,klev),      INTENT(INOUT)  :: pfrac_impa
-  !
+
   ! Fraction d'aerosols lessivee par impaction et par nucleation
   ! POur ON-LINE
-  !
+
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: frac_impa
   REAL, DIMENSION(klon,klev),      INTENT(OUT)  :: frac_nucl
   !AA
   ! --------------------------------------------------------------------------------
-  !
+
   ! Options du programme:
-  !
+
   REAL, SAVE :: seuil_neb=0.001 ! un nuage existe vraiment au-dela
   !$OMP THREADPRIVATE(seuil_neb)
@@ -175,5 +174,5 @@
   INTEGER,SAVE :: iflag_evap_prec=1 ! evaporation de la pluie
   !$OMP THREADPRIVATE(iflag_evap_prec)
-  !
+
   LOGICAL cpartiel ! condensation partielle
   PARAMETER (cpartiel=.TRUE.)
@@ -185,7 +184,7 @@
   PARAMETER (ztfondue=278.15)
   ! --------------------------------------------------------------------------------
-  !
+
   ! Variables locales:
-  !
+
   INTEGER i, k, n, kk
   INTEGER,save::itap=0
@@ -274,9 +273,8 @@
 #endif
 
-  !
   LOGICAL appel1er
   SAVE appel1er
   !$OMP THREADPRIVATE(appel1er)
-  !
+
 ! iflag_oldbug_fisrtilp=0 enleve le BUG par JYG : tglace_min -> tglace_max
 ! iflag_oldbug_fisrtilp=1 ajoute le BUG
@@ -284,15 +282,15 @@
   !$OMP THREADPRIVATE(iflag_oldbug_fisrtilp)
   !---------------------------------------------------------------
-  !
+
   !AA Variables traceurs:
   !AA  Provisoire !!! Parametres alpha du lessivage
   !AA  A priori on a 4 scavenging # possibles
-  !
+
   REAL a_tr_sca(4)
   save a_tr_sca
   !$OMP THREADPRIVATE(a_tr_sca)
-  !
+
   ! Variables intermediaires
-  !
+
   REAL zalpha_tr
   REAL zfrac_lessi
@@ -306,7 +304,7 @@
   REAL zlh_solid(klon), zm_solid
   !---------------------------------------------------------------
-  !
+
   ! Fonctions en ligne:
-  !
+
   REAL fallvs,fallvc ! Vitesse de chute pour cristaux de glace
                      ! (Heymsfield & Donner, 1990)
@@ -317,5 +315,5 @@
   fallvc (zzz) = 3.29/2.0 * ((zzz)**0.16) * ffallv_con
   fallvs (zzz) = 3.29/2.0 * ((zzz)**0.16) * ffallv_lsc
-  !
+
   DATA appel1er /.TRUE./
   !ym
@@ -337,5 +335,5 @@
      CALL getin_p('seuil_neb',seuil_neb)
      write(lunout,*)' iflag_oldbug_fisrtilp =',iflag_oldbug_fisrtilp 
-     !
+
      WRITE(lunout,*) 'fisrtilp, ninter:', ninter
      WRITE(lunout,*) 'fisrtilp, iflag_evap_prec:', iflag_evap_prec
@@ -378,5 +376,4 @@
 #endif 
 
-     !
      !AA initialiation provisoire
      a_tr_sca(1) = -0.5
@@ -384,7 +381,7 @@
      a_tr_sca(3) = -0.5
      a_tr_sca(4) = -0.5
-     !
+
      !AA Initialisation a 1 des coefs des fractions lessivees 
-     !
+
      !cdir collapse
      DO k = 1, klev
@@ -398,5 +395,5 @@
 
   ENDIF          !  test sur appel1er
-  !
+
   !MAf Initialisation a 0 de zoliq
   !      DO i = 1, klon
@@ -405,5 +402,5 @@
   ! Determiner les nuages froids par leur temperature
   !  nexpo regle la raideur de la transition eau liquide / eau glace.
-  !
+
 !CR: on est oblige de definir des valeurs fisrt car les valeurs de newmicro ne sont pas les memes par defaut
   IF (iflag_t_glace==0) THEN
@@ -425,7 +422,7 @@
 !>AJ
   !cc      nexpo = 1
-  !
+
   ! Initialiser les sorties:
-  !
+
   !cdir collapse
   DO k = 1, klev+1
@@ -474,7 +471,7 @@
 #endif
      !     ENDDO
-     !
+
      ! Initialiser le flux de precipitation a zero
-     !
+
      !     DO i = 1, klon
      zrfl(i) = 0.0
@@ -492,6 +489,6 @@
      zneb(i) = seuil_neb
   ENDDO
-  !
-  !
+
+
   !AA Pour plus de securite 
 
@@ -500,11 +497,11 @@
 
   !AA==================================================================
-  !
+
   ncoreczq=0
   ! BOUCLE VERTICALE (DU HAUT VERS LE BAS)
-  !
+
   DO k = klev, 1, -1
-     !
-     !
+
+
 #ifdef ISO      
       ! cam debug!      
@@ -543,5 +540,5 @@
 #endif
      !AA===============================================================
-     !
+
      ! Initialisation temperature et vapeur
      DO i = 1, klon
@@ -591,5 +588,5 @@
 
      ENDDO
-     !
+
      ! ----------------------------------------------------------------
      ! P0> Thermalisation des precipitations venant de la couche du dessus
@@ -604,5 +601,5 @@
      !   -  zt: temperature de la cocuhe
      !   - zmqc: masse de precip qui doit etre thermalisee
-     !
+
      IF(k<=klevm1) THEN
         DO i = 1, klon
@@ -632,5 +629,5 @@
         ENDDO
      ENDIF ! end IF(k.LE.klevm1)
-     !
+
      ! ----------------------------------------------------------------
      ! P1> Calcul de l'evaporation de la precipitation
@@ -643,5 +640,5 @@
      !   - zq, zt: humidite et temperature de la cocuhe
      !   - zmqc: masse de precip qui doit etre thermalisee
-     !
+
 #ifdef ISO
       DO i = 1, klon
@@ -776,5 +773,4 @@
 #endif
 
-!
        ELSE ! (.NOT. ice_thermo) 
 
@@ -938,5 +934,5 @@
      ! ----------------------------------------------------------------
      ENDIF ! (iflag_evap_prec>=1)
-     !
+
      ! Calculer Qs et L/Cp*dQs/dT:
 #ifdef ISOVERIF
@@ -988,5 +984,5 @@
 !        write(*,*) 'ilp tmp 638: k,zoliq,zxtoliq(1,363)=',k,zoliq(363),zxtoliq(1,363)
 #endif
-     !
+
      IF (thermcep) THEN
         DO i = 1, klon
@@ -1017,8 +1013,8 @@
         ENDDO
      ENDIF
-     !
+
      ! Determiner la condensation partielle et calculer la quantite
      ! de l'eau condensee:
-     !
+
 !verification de la valeur de iflag_fisrtilp_qsat pour iflag_ice_thermo=1
 !       if ((iflag_ice_thermo.eq.1).and.(iflag_fisrtilp_qsat.ne.0)) then
@@ -1037,10 +1033,10 @@
      !   zt : temperature de la maille
      ! ----------------------------------------------------------------
-     !
+
      IF (cpartiel) THEN
         ! -------------------------
         ! P2.A> Nuage fractionnaire
         ! -------------------------
-        !
+
         !   Calcul de l'eau condensee et de la fraction nuageuse et de l'eau
         !   nuageuse a partir des PDF de Sandrine Bony.
@@ -1050,5 +1046,5 @@
         !  on prend en compte le réchauffement qui diminue la partie
         ! condensee
-        !
+
         !   Version avec les raqts
 
@@ -1206,5 +1202,5 @@
                  if ((convergence(i).or.(n_i(i).eq.0)).and.lognormale(i)) then
                  ! si on n'a pas converge
-                 !
+
                  ! P2.A.2.1> Calcul de la fraction nuageuse et de la quantite d'eau condensee
                  ! ---------------------------------------------------------------
@@ -1214,5 +1210,5 @@
                  ! zcond: eau condensee en moyenne dans la maille
                  ! rhcl: humidite relative ciel-clair
-                 !
+
                  Tbef(i)=Tbef(i)+DT(i) ! nouvelle temperature
                  if (.not.ice_thermo) then   
@@ -1393,5 +1389,5 @@
         !   rhcl: humidite relative ciel-clair
         ! ----------------------------------------------------------------
-        !
+
         ! Bornage de l'eau in-cloud (zqn) et de la fraction nuageuse (rneb) 
         ! Calcule de l'eau condensee moyenne dans la maille (zcond),
@@ -1602,5 +1598,5 @@
 !        write(*,*) 'ilp tmp 1311: zoliq,zxtoliq(1,363)=',zoliq(363),zxtoliq(1,363)
 #endif    
-     !
+
      ! Mise a jour vapeur d'eau
      ! -------------------------
@@ -1615,5 +1611,5 @@
      ! Variable calcule:
      !   zt : temperature de la maille
-     !
+
      IF (.NOT. ice_thermo) THEN
         if (iflag_fisrtilp_qsat.lt.1) then
@@ -1952,7 +1948,6 @@
      ! P3> Formation des precipitations
      ! ----------------------------------------------------------------
-     !
+
      ! Partager l'eau condensee en precipitation et eau liquide nuageuse
-     !
 
      ! Initialisation de zoliq (eau condensee moyenne dans la maille)
@@ -2056,5 +2051,4 @@
 #endif
 
-     !
      DO n = 1, ninter
         DO i = 1, klon
@@ -2121,5 +2115,5 @@
 
      ! ----------------------------------------------------------------
-     !
+
 #ifdef ISO
       do i=1,klon
@@ -2312,5 +2306,5 @@
         CALL abort_physic('ilp 2347', 'isotopes pas encore prevus ici', 1)
 #endif
-!
+
 !CR&JYG<
 ! On prend en compte l'effet Bergeron dans les flux de precipitation :
@@ -2323,5 +2317,5 @@
 ! Le condensat precipitant solide est augmente.
 ! La vapeur d'eau est augmentee.
-!
+
        IF ((iflag_bergeron .EQ. 2)) THEN
          DO i = 1, klon
@@ -2508,7 +2502,7 @@
      ! Fin de formation des precipitations
      ! ----------------------------------------------------------------
-     !
+
      ! Calculer les tendances de q et de t:
-     !
+
      DO i = 1, klon
         d_q(i,k) = zq(i) - q(i,k)
@@ -2548,9 +2542,9 @@
         d_t(i,k) = zt(i) - t(i,k)
      ENDDO
-     !
+
      !AA--------------- Calcul du lessivage stratiforme  -------------
 
      DO i = 1,klon
-        !
+
         if(zcond(i).gt.zoliq(i)+1.e-10) then
          beta(i,k) = (zcond(i)-zoliq(i))/zcond(i)/dtime
@@ -2578,12 +2572,12 @@
            pfrac_nucl(i,k)=pfrac_nucl(i,k)*(1.-zneb(i)*zfrac_lessi)
            frac_nucl(i,k)= 1.-zneb(i)*zfrac_lessi 
-           !
+
            ! nucleation avec un facteur -1 au lieu de -0.5
            zfrac_lessi = 1. - EXP(-zprec_cond(i)/zneb(i))
            pfrac_1nucl(i,k)=pfrac_1nucl(i,k)*(1.-zneb(i)*zfrac_lessi)
         ENDIF
-        !
+
      ENDDO      ! boucle sur i
-     !
+
      !AA Lessivage par impaction dans les couches en-dessous
      DO kk = k-1, 1, -1
@@ -2629,13 +2623,12 @@
       ! end verif en fin de boucle
 
-     !
      !AA===============================================================
      !                     FIN DE LA BOUCLE VERTICALE  
   end DO
-  !
+
   !AA==================================================================
-  !
+
   ! Pluie ou neige au sol selon la temperature de la 1ere couche
-  !
+
 !CR: si la thermo de la glace est active, on calcule zifl directement
   IF (.NOT.ice_thermo) THEN
@@ -2703,5 +2696,5 @@
    
    ENDIF
-  !
+
   ! For energy conservation : when snow is present, the solification
   ! latent heat is considered.
@@ -2717,5 +2710,4 @@
   END DO
   ENDIF
-  !
 
   if (ncoreczq>0) then
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_wake.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_wake.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_wake.F90	(revision 5099)
@@ -159,5 +159,4 @@
 #endif
 
-  !
   ! Input/Output
   ! State variables
@@ -425,5 +424,5 @@
   CALL getin_p('wdens_ref_l',wdens_ref(2))    !wake number per unit area ; land
 !>jyg
-!
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 !!!!!!!!!  Population dynamics parameters    !!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -441,5 +440,5 @@
   CALL getin_p('rzero_wk', rzero)
   aa0 = 3.14*rzero*rzero
-!
+
   tau_cv = 4000.
   CALL getin_p('tau_cv', tau_cv)
@@ -574,5 +573,5 @@
     END DO
   ENDIF  ! (iflag_wk_pop_dyn >=1)
-!
+
   DO i = 1, klon
     ! c      sigmaw(i) = amax1(sigmaw(i),sigd_con(i))
@@ -586,5 +585,4 @@
   END DO
 
-!
   IF (iflag_wk_pop_dyn >= 1) THEN
     awdens_in(:) = awdens(:)
@@ -599,5 +597,5 @@
   d_sigmaw(:) = 0.
   ktopw(:) = 0
-!
+
 !<jyg
 dth(:,:) = 0.
@@ -617,5 +615,5 @@
 cstar(:) = 0.
 ktopw(:) = 0
-!
+
 !  Vertical advection local variables
 omgbw(:,:) = 0.
@@ -629,5 +627,5 @@
 #endif
 !>jyg
-!
+
   IF (prt_level>=10) THEN
     PRINT *, 'wake-1, sigmaw(igout) ', sigmaw(igout)
@@ -1644,6 +1642,4 @@
           ! print*,'dtKE= ',dtKE(i,k),' dqKE= ',dqKE(i,k)
 
-!
-
           ! cc nrlmd          Prise en compte du taux de mortalité
           ! cc               Définitions de entr, detr
@@ -1834,5 +1830,5 @@
       END DO
     END DO
-!
+
     DO i = 1, klon
       IF (wk_adv(i)) THEN
@@ -1879,5 +1875,5 @@
           d_wdens2(i) = d_wdens2(i) + wdens_targ - wdens(i)
           wdens(i) = wdens_targ
-!
+
           wdens_targ = min( max(awdens(i),0.), wdens(i) )
           d_awdens2(i) = d_awdens2(i) + wdens_targ - awdens(i)
@@ -2279,5 +2275,5 @@
           sum_dtdwn(i) = sum_dtdwn(i) + dtdwn(i, k)*dz(i)
           sum_dqdwn(i) = sum_dqdwn(i) + dqdwn(i, k)*dz(i)
-!
+
           dthmin(i) = min(dthmin(i), dth(i,k))
         END IF
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_yoerad.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_yoerad.f90	(revision 5099)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/lmdz_yoerad.f90	(revision 5099)
@@ -0,0 +1,1 @@
+link ../phylmd/lmdz_yoerad.f90
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyaqua_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyaqua_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyaqua_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: phyaqua_mod.F90 3579 2019-10-09 13:11:07Z fairhead $
-!
+
 MODULE phyaqua_mod
   ! Routines complementaires pour la physique planetaire.
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyetat0_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyetat0_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyetat0_mod.F90	(revision 5099)
@@ -466,5 +466,5 @@
 !  TKE
 !==================================
-!
+
   IF (iflag_pbl>1) then
      found=phyetat0_srf(pbl_tke,"TKE","Turb. Kinetic. Energ. ",1.e-8)
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyredem.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyredem.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyredem.F90	(revision 5099)
@@ -1,7 +1,7 @@
-!
+
 ! $Id: phyredem.F90 3506 2019-05-16 14:38:11Z ymeurdesoif $
-!
+
 SUBROUTINE phyredem (fichnom)
-!
+
 !-------------------------------------------------------------------------------
 ! Author: Z.X. Li (LMD/CNRS), 1993/08/18
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_local_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_local_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_local_var_mod.F90	(revision 5099)
@@ -1,11 +1,11 @@
-!
+
 ! $Id: phys_local_var_mod.F90 3888 2021-05-05 10:50:37Z jyg $
-!
+
 MODULE phys_local_var_mod
   USE lmdz_cppkeys_wrapper, ONLY : CPPKEY_STRATAER
   ! Variables locales pour effectuer les appels en serie
   !======================================================================
-  !
-  !
+
+
   !======================================================================
   ! Declaration des variables
@@ -205,5 +205,5 @@
   REAL, SAVE, ALLOCATABLE :: ZFSDN0(:, :), ZFSUP0(:, :)      ! diag
   !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
-  !
+
   REAL, SAVE, ALLOCATABLE :: stratomask(:, :)
   !$OMP THREADPRIVATE(stratomask)
@@ -388,5 +388,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
   !$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
-  !
+
   !nrlmd+jyg<
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: s_pblh_x, s_pblh_w
@@ -395,5 +395,5 @@
   !$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
   !>nrlmd+jyg
-  !
+
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: slab_wfbils
   !$OMP THREADPRIVATE(slab_wfbils)
@@ -425,5 +425,5 @@
 !$OMP THREADPRIVATE(xtrain_lsc)
 #endif
-  !
+
   !jyg+nrlmd<
   !!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
@@ -475,5 +475,5 @@
   !$OMP THREADPRIVATE(ratqsc)
   !>jyg+nrlmd
-  !
+
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
   !$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
@@ -502,5 +502,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: epmax_diag ! epmax_cape
   !$OMP THREADPRIVATE(epmax_diag)
-  !
+
   !  Deep convective variables used in phytrac
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: ep ! epmax_cape
@@ -576,5 +576,5 @@
 #endif
 #endif
-  !
+
   !      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: lambda_th
@@ -714,9 +714,4 @@
   !$OMP THREADPRIVATE(dqsfreez)
 
-
-
-
-
-  !
   ! variables for stratospheric aerosol
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: d_q_emiss
@@ -756,5 +751,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: vsed_aer
   !$OMP THREADPRIVATE(vsed_aer)
-  !
+
   !---3D budget variables
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_nucl
@@ -770,5 +765,5 @@
   REAL, ALLOCATABLE, SAVE, DIMENSION(:, :) :: budg_3D_backgr_so2
   !$OMP THREADPRIVATE(budg_3D_backgr_so2)
-  !
+
   !---2D budget variables
   REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
@@ -900,5 +895,5 @@
     ZFLDN0 = 0.
     ALLOCATE(ZFLUP0(klon, klev + 1), ZFSDN0(klon, klev + 1), ZFSUP0(klon, klev + 1))
-    !
+
     ALLOCATE(topswad_aero(klon), solswad_aero(klon))
     ALLOCATE(topswai_aero(klon), solswai_aero(klon))
@@ -1020,10 +1015,10 @@
     ALLOCATE(s_lcl(klon))
     ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
-    !
+
     !nrlmd+jyg<
     ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
     ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
     !>nrlmd+jyg
-    !
+
     ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
     ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
@@ -1037,5 +1032,5 @@
     ALLOCATE(rain_num(klon))
     ALLOCATE(qlth(klon, klev), qith(klon, klev), qsith(klon, klev), wiceth(klon, klev))
-    !
+
 #ifdef ISO
       ALLOCATE(xtevap(ntraciso,klon))
@@ -1050,5 +1045,5 @@
       runoff_diag(:)=0. ; xtrunoff_diag(:,:)=0. ! because variables are only given values on knon grid points
 #endif
-    !
+
     ALLOCATE(sens_x(klon), sens_w(klon))
     ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
@@ -1073,8 +1068,8 @@
       ALLOCATE(xt_therm(ntraciso,klon,klev))
 #endif
-    !
+
     ALLOCATE(ptconv(klon, klev))
     ALLOCATE(ratqsc(klon, klev))
-    !
+
     ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
     ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
@@ -1111,6 +1106,6 @@
     ! FC
     ALLOCATE(zxfluxq(klon, klev), zxfluxt(klon, klev))
-    !
-    !
+
+
     !  Deep convective variables used in phytrac
     ALLOCATE(pmflxr(klon, klev + 1), pmflxs(klon, klev + 1))
@@ -1407,5 +1402,5 @@
     DEALLOCATE(tal1, pal1, pab1, pab2)
     DEALLOCATE(ptstar, pt0, slp)
-    !
+
     DEALLOCATE(alp_wake)
     DEALLOCATE(wake_h, wake_k)
@@ -1425,5 +1420,5 @@
       DEALLOCATE(d_deltaxt_vdf)
 #endif
-    !
+
     DEALLOCATE(bils)
     DEALLOCATE(cdragm, cdragh, cldh, cldl)
@@ -1433,10 +1428,10 @@
     DEALLOCATE(prw, prlw, prsw, prbsw, water_budget, zustar, zu10m, zv10m, rh2m, s_lcl)
     DEALLOCATE(s_pblh, s_pblt, s_therm)
-    !
+
     !nrlmd+jyg<
     DEALLOCATE(s_pblh_x, s_pblh_w)
     DEALLOCATE(s_lcl_x, s_lcl_w)
     !>nrlmd+jyg
-    !
+
     DEALLOCATE(slab_wfbils, tpot, tpote, ue)
     DEALLOCATE(uq, ve, vq, zxffonte)
@@ -1449,5 +1444,5 @@
     DEALLOCATE(rain_num)
     DEALLOCATE(qlth, qith, qsith, wiceth)
-    !
+
     DEALLOCATE(sens_x, sens_w)
     DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
@@ -1474,8 +1469,8 @@
       DEALLOCATE(h1_diag,runoff_diag,xtrunoff_diag)
 #endif
-    !
+
     DEALLOCATE(ptconv)
     DEALLOCATE(ratqsc)
-    !
+
     DEALLOCATE(wbeff, convoccur, zmax_th)
     DEALLOCATE(zq2m, zt2m, weak_inversion)
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_ctrlout_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_ctrlout_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_ctrlout_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: phys_output_ctrlout_mod.F90 3888 2021-05-05 10:50:37Z jyg $
-!
+
 MODULE phys_output_ctrlout_mod
 
@@ -9,445 +9,442 @@
 
   IMPLICIT NONE
-      INTEGER, PRIVATE :: i
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! Definition pour chaque variable du niveau d ecriture dans chaque fichier,
-!! de son nom, de sa description, de son unité et du type d'écriture.
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/ histmth, histday, histhf, histins /),'!!!!!!!!!!!!
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!  CHARACTER(len=20), dimension(nfiles) :: TEF = type_ecri_files
-
-!!! saving lon and lat as variables for CMIP6 DataRequest
+  INTEGER, PRIVATE :: i
+
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !! Definition pour chaque variable du niveau d ecriture dans chaque fichier,
+  !! de son nom, de sa description, de son unité et du type d'écriture.
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!/ histmth, histday, histhf, histins /),'!!!!!!!!!!!!
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+  !  CHARACTER(len=20), dimension(nfiles) :: TEF = type_ecri_files
+
+  !!! saving lon and lat as variables for CMIP6 DataRequest
   TYPE(ctrl_out), SAVE :: o_longitude = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'io_lon', '', '', (/ ('once', i=1, 10) /))
+          'io_lon', '', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_latitude = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'io_lat', '', '', (/ ('once', i=1, 10) /))
-
-!!! Composantes de la coordonnee sigma-hybride
-!!! Ap et Bp et interfaces
+          'io_lat', '', '', (/ ('once', i = 1, 10) /))
+
+  !!! Composantes de la coordonnee sigma-hybride
+  !!! Ap et Bp et interfaces
   TYPE(ctrl_out), SAVE :: o_Ahyb = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Ahyb', 'Ahyb at level interface', '', (/ ('once', i=1, 10) /))
+          'Ahyb', 'Ahyb at level interface', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Bhyb = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Bhyb', 'Bhyb at level interface', '', (/ ('once', i=1, 10) /))
+          'Bhyb', 'Bhyb at level interface', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Ahyb_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Ahyb_bounds', '', '', (/ ('once', i=1, 10) /))
+          'Ahyb_bounds', '', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Bhyb_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Bhyb_bounds', '', '', (/ ('once', i=1, 10) /))
-!!! Composantes de la coordonnee sigma-hybride  au milieu des couches
-!!! Aps et Bps et interfaces
+          'Bhyb_bounds', '', '', (/ ('once', i = 1, 10) /))
+  !!! Composantes de la coordonnee sigma-hybride  au milieu des couches
+  !!! Aps et Bps et interfaces
   TYPE(ctrl_out), SAVE :: o_Ahyb_mid = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Ahyb_mid', 'Ahyb at the middle of the level', '', (/ ('once', i=1, 10) /))
+          'Ahyb_mid', 'Ahyb at the middle of the level', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Bhyb_mid = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Bhyb_mid', 'Bhyb at the middle of the level', '', (/ ('once', i=1, 10) /))
+          'Bhyb_mid', 'Bhyb at the middle of the level', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Ahyb_mid_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Ahyb_mid_bounds', '', '', (/ ('once', i=1, 10) /))
+          'Ahyb_mid_bounds', '', '', (/ ('once', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Bhyb_mid_bounds = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Bhyb_mid_bounds', '', '', (/ ('once', i=1, 10) /))
+          'Bhyb_mid_bounds', '', '', (/ ('once', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_Alt = ctrl_out((/ 1, 1, 1, 1, 1, 1, 11, 11, 11, 11/), &
-    'Alt', '', '', (/ ('', i=1, 10) /))
-
-!!! 1D
+          'Alt', '', '', (/ ('', i = 1, 10) /))
+
+  !!! 1D
   TYPE(ctrl_out), SAVE :: o_phis = ctrl_out((/ 1, 1, 10, 5, 1, 1, 11, 11, 11, 11/), &
-    'phis', 'Surface geop.height', 'm2/s2', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_aire = ctrl_out((/ 1, 1, 10,  10, 1, 1, 11, 11, 11, 11/), &
-    'aire', 'Grid area', '-', (/ 'once', 'once', 'once', 'once', 'once', 'once', &
-                                 'once', 'once', 'once', 'once' /))
-  TYPE(ctrl_out), SAVE :: o_contfracATM = ctrl_out((/ 10, 1,  1, 10, 10, 10, 11, 11, 11, 11/), &
-    'contfracATM', '% sfce ter+lic', '-', &
-       (/ 'once', 'once', 'once', 'once', 'once', 'once', 'once', 'once', 'once', 'once' /)) 
-  TYPE(ctrl_out), SAVE :: o_contfracOR = ctrl_out((/ 10, 1,  10, 10, 10, 10, 11, 11, 11, 11/), &
-    'contfracOR', '% sfce terre OR', '-', (/ ('', i=1, 10) /))
+          'phis', 'Surface geop.height', 'm2/s2', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_aire = ctrl_out((/ 1, 1, 10, 10, 1, 1, 11, 11, 11, 11/), &
+          'aire', 'Grid area', '-', (/ 'once', 'once', 'once', 'once', 'once', 'once', &
+                  'once', 'once', 'once', 'once' /))
+  TYPE(ctrl_out), SAVE :: o_contfracATM = ctrl_out((/ 10, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
+          'contfracATM', '% sfce ter+lic', '-', &
+          (/ 'once', 'once', 'once', 'once', 'once', 'once', 'once', 'once', 'once', 'once' /))
+  TYPE(ctrl_out), SAVE :: o_contfracOR = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'contfracOR', '% sfce terre OR', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_aireTER = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'aireTER', 'Grid area CONT', '-', (/ ('', i=1, 10) /))
-
-!!! 2D
+          'aireTER', 'Grid area CONT', '-', (/ ('', i = 1, 10) /))
+
+  !!! 2D
   TYPE(ctrl_out), SAVE :: o_sza = ctrl_out((/ 1, 1, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'sza', 'Solar zenithal angle', 'degrees', (/ ('', i=1, 10) /))
-
-! Marine
-
-  TYPE(ctrl_out), SAVE :: o_alt_tropo = ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'alt_tropo','Tropopause pressure','hPa',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
-  TYPE(ctrl_out), SAVE :: o_map_prop_hc = ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_prop_hc','Proportion of high clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          'sza', 'Solar zenithal angle', 'degrees', (/ ('', i = 1, 10) /))
+
+  ! Marine
+
+  TYPE(ctrl_out), SAVE :: o_alt_tropo = ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+          'alt_tropo', 'Tropopause pressure', 'hPa', &
+          (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_prop_hc = ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+          'map_prop_hc', 'Proportion of high clouds', ' ', &
+          (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_prop_hist = &
-  ctrl_out((/1,1,1,1,1,1,10,10,10,10/),&
-  'map_prop_hist','Proportion of high ice semi-transp clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 1, 10, 10, 10, 10/), &
+                  'map_prop_hist', 'Proportion of high ice semi-transp clouds', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_emis_hc = &
-  ctrl_out((/1,1,1,1,1,1,10,10,10,10/),&
-  'map_emis_hc','Emissivity of high clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 1, 10, 10, 10, 10/), &
+                  'map_emis_hc', 'Emissivity of high clouds', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_iwp_hc = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_iwp_hc','Ice water path of high clouds','g/m2',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_iwp_hc', 'Ice water path of high clouds', 'g/m2', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_deltaz_hc = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_deltaz_hc','geom thickness of high clouds','m',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_deltaz_hc', 'geom thickness of high clouds', 'm', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_pcld_hc = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_pcld_hc','cloud pressure of high clouds','hPa',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
-   TYPE(ctrl_out), SAVE :: o_map_tcld_hc = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_tcld_hc','cloud temperature of high clouds','K',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_pcld_hc', 'cloud pressure of high clouds', 'hPa', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_tcld_hc = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_tcld_hc', 'cloud temperature of high clouds', 'K', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_emis_hist = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_emis_hist','Emissivity of high ice st clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_emis_hist', 'Emissivity of high ice st clouds', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_iwp_hist = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_iwp_hist','Ice water path of high ice st clouds','g/m2',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_iwp_hist', 'Ice water path of high ice st clouds', 'g/m2', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_deltaz_hist = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_deltaz_hist','geom thickness of high ice st clouds','m',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_deltaz_hist', 'geom thickness of high ice st clouds', 'm', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_rad_hist = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_rad_hist','ice crystals radius in high ice st clouds','µm',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
-
- TYPE(ctrl_out), SAVE :: o_map_emis_Cb = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_emis_Cb','Emissivity of high Cb clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
- TYPE(ctrl_out), SAVE :: o_map_pcld_Cb = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_pcld_Cb','cloud pressure of high Cb clouds','hPa',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
- TYPE(ctrl_out), SAVE :: o_map_tcld_Cb = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_tcld_Cb','cloud temperature of high Cb clouds','K',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
-
- TYPE(ctrl_out), SAVE :: o_map_emis_Anv = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_emis_Anv','Emissivity of high Anv clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
- TYPE(ctrl_out), SAVE :: o_map_pcld_Anv = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_pcld_Anv','cloud pressure of high Anv clouds','hPa',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_rad_hist', 'ice crystals radius in high ice st clouds', 'µm', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_emis_Cb = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_emis_Cb', 'Emissivity of high Cb clouds', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_pcld_Cb = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_pcld_Cb', 'cloud pressure of high Cb clouds', 'hPa', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_tcld_Cb = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_tcld_Cb', 'cloud temperature of high Cb clouds', 'K', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_emis_Anv = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_emis_Anv', 'Emissivity of high Anv clouds', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_pcld_Anv = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_pcld_Anv', 'cloud pressure of high Anv clouds', 'hPa', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_tcld_Anv = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_tcld_Anv','cloud temperature of high Anv clouds','K',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_tcld_Anv', 'cloud temperature of high Anv clouds', 'K', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_emis_ThCi = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_emis_ThCi','Emissivity of high ThCi clouds',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_emis_ThCi', 'Emissivity of high ThCi clouds', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_pcld_ThCi = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_pcld_ThCi','cloud pressure of high ThCi clouds','hPa',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_pcld_ThCi', 'cloud pressure of high ThCi clouds', 'hPa', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_tcld_ThCi = &
-  ctrl_out((/10,10,1,10,10,10,10,10,10,10/),&
-  'map_tcld_ThCi','cloud temperature of high ThCi clouds','K',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
-   TYPE(ctrl_out), SAVE :: o_map_ntot = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_ntot','total AIRS cloud fraction',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/10, 10, 1, 10, 10, 10, 10, 10, 10, 10/), &
+                  'map_tcld_ThCi', 'cloud temperature of high ThCi clouds', 'K', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_ntot = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_ntot', 'total AIRS cloud fraction', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_hc = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_hc','high clouds AIRS cloud fraction',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_hc', 'high clouds AIRS cloud fraction', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_hist = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_hist','high clouds ice st AIRS cloud fraction',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_hist', 'high clouds ice st AIRS cloud fraction', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_map_Cb = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_Cb','high clouds Cb AIRS cloud fraction',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
- TYPE(ctrl_out), SAVE :: o_map_ThCi = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_ThCi','high clouds ThCi AIRS cloud fraction',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
- TYPE(ctrl_out), SAVE :: o_map_Anv = &
-  ctrl_out((/1,1,1,1,1,10,10,10,10,10/),&
-  'map_Anv','high clouds Anv AIRS cloud fraction',' ',&
-   (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)",&
-      "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
-
-! Fin Marine
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_Cb', 'high clouds Cb AIRS cloud fraction', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_ThCi = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_ThCi', 'high clouds ThCi AIRS cloud fraction', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  TYPE(ctrl_out), SAVE :: o_map_Anv = &
+          ctrl_out((/1, 1, 1, 1, 1, 10, 10, 10, 10, 10/), &
+                  'map_Anv', 'high clouds Anv AIRS cloud fraction', ' ', &
+                  (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                          "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+
+  ! Fin Marine
 
   TYPE(ctrl_out), SAVE :: o_flat = ctrl_out((/ 5, 1, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'flat', 'Latent heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'flat', 'Latent heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ptstar = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'ptstar', 'Air Surface Temperature', 'K', (/ ('', i=1, 10) /))
+          'ptstar', 'Air Surface Temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pt0 = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'pt0', 'Standard Air Surface Temperature', 'K', (/ ('', i=1, 10) /))
+          'pt0', 'Standard Air Surface Temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slp = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'slp', 'Sea Level Pressure', 'Pa', (/ ('', i=1, 10) /))
+          'slp', 'Sea Level Pressure', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tsol = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'tsol', 'Surface Temperature', 'K', (/ ('', i=1, 10) /))
+          'tsol', 'Surface Temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_t2m = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    't2m', 'Temperature 2m', 'K', (/ ('', i=1, 10) /))
+          't2m', 'Temperature 2m', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_t2m_min = ctrl_out((/ 20, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't2m_min', 'Temp 2m min', 'K', &
-      (/ "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)", & 
-         "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)" /))
+          't2m_min', 'Temp 2m min', 'K', &
+          (/ "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)", &
+                  "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)", "t_min(X)" /))
   TYPE(ctrl_out), SAVE :: o_t2m_max = ctrl_out((/ 20, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't2m_max', 'Temp 2m max', 'K', &
-      (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
-         "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
+          't2m_max', 'Temp 2m max', 'K', &
+          (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                  "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_t2m_min_mon = ctrl_out((/ 1, 20, 20, 20, 20, 20, 20, 20, 20, 20 /), &
-    't2m_min_mon', 'Monthly average min 2m temperature', 'K', &
-      (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", & 
-         "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          't2m_min_mon', 'Monthly average min 2m temperature', 'K', &
+          (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
   TYPE(ctrl_out), SAVE :: o_t2m_max_mon = ctrl_out((/ 1, 20, 20, 20, 20, 20, 20, 20, 20, 20 /), &
-    't2m_max_mon', 'Monthly average max 2m temperature', 'K', &
-      (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-         "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          't2m_max_mon', 'Monthly average max 2m temperature', 'K', &
+          (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
 
   TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_t2m_srf = (/ &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't2m_ter', "Temp 2m "//clnsurf(1), "K", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't2m_lic', "Temp 2m "//clnsurf(2), "K", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't2m_oce', "Temp 2m "//clnsurf(3), "K", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't2m_sic', "Temp 2m "//clnsurf(4), "K", (/ ('', i=1, 10) /)) /)
+          ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+                  't2m_ter', "Temp 2m " // clnsurf(1), "K", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+                          't2m_lic', "Temp 2m " // clnsurf(2), "K", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+                          't2m_oce', "Temp 2m " // clnsurf(3), "K", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+                          't2m_sic', "Temp 2m " // clnsurf(4), "K", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_nt2mout = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'nt2mout', 'Nbt2m out of range complete computation', '-', (/ ('', i=1, 10) /))
+          'nt2mout', 'Nbt2m out of range complete computation', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_nq2mout = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'nq2mout', 'Nbq2m out of range complete computation', '-', (/ ('', i=1, 10) /))
+          'nq2mout', 'Nbq2m out of range complete computation', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_nu2mout = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'nu2mout', 'Nbu2m out of range complete computation', '-', (/ ('', i=1, 10) /))
+          'nu2mout', 'Nbu2m out of range complete computation', '-', (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_nt2moutfg = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'nt2moutfg', 'Nbt2m out of range complete/fgRi1 computation', '-', (/ ('', i=1, 10) /))
+          'nt2moutfg', 'Nbt2m out of range complete/fgRi1 computation', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_nq2moutfg = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'nq2moutfg', 'Nbq2m out of range complete/fgRi1 computation', '-', (/ ('', i=1, 10) /))
+          'nq2moutfg', 'Nbq2m out of range complete/fgRi1 computation', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_nu2moutfg = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'nu2moutfg', 'Nbu2m out of range complete/fgRi1 computation', '-', (/ ('', i=1, 10) /))
+          'nu2moutfg', 'Nbu2m out of range complete/fgRi1 computation', '-', (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_gusts = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'gusts', 'surface gustiness', 'm2/s2', (/ ('', i=1, 10) /))
+          'gusts', 'surface gustiness', 'm2/s2', (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_wind10m = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'wind10m', '10-m wind speed', 'm/s', (/ ('', i=1, 10) /))
+          'wind10m', '10-m wind speed', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wind100m = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wind100m', '100-m wind speed', 'm/s', (/ ('', i=1, 10) /))
+          'wind100m', '100-m wind speed', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadfactor_wind_onshore = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'woncfr', 'Onshore Wind Capacity factor', 'kW/kW_installed', (/ ('', i=1, 10) /))
+          'woncfr', 'Onshore Wind Capacity factor', 'kW/kW_installed', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadfactor_wind_offshore = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wofcfr', 'Offshore Wind Capacity factor', 'kW/kW_installed', (/ ('', i=1, 10) /))
+          'wofcfr', 'Offshore Wind Capacity factor', 'kW/kW_installed', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wind10max = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wind10max', '10m wind speed max', 'm/s', &
-    (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", & 
-       "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
+          'wind10max', '10m wind speed max', 'm/s', &
+          (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                  "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
 
   TYPE(ctrl_out), SAVE :: o_sicf = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sicf', 'Sea-ice fraction', '-', (/ ('', i=1, 10) /))
+          'sicf', 'Sea-ice fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_q2m = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'q2m', 'Specific humidity 2m', 'kg/kg', (/ ('', i=1, 10) /))
+          'q2m', 'Specific humidity 2m', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ustar = ctrl_out((/ 1, 1, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'ustar', 'Friction velocity', 'm/s', (/ ('', i=1, 10) /))
+          'ustar', 'Friction velocity', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_u10m = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'u10m', 'Vent zonal 10m', 'm/s', (/ ('', i=1, 10) /))
+          'u10m', 'Vent zonal 10m', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_v10m = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'v10m', 'Vent meridien 10m', 'm/s', (/ ('', i=1, 10) /))
+          'v10m', 'Vent meridien 10m', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_psol = ctrl_out((/ 1, 1, 1, 5, 10, 10, 11, 11, 11, 11/), &
-    'psol', 'Surface Pressure', 'Pa', (/ ('', i=1, 10) /))
+          'psol', 'Surface Pressure', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsurf = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'qsurf', 'Surface Air humidity', 'kg/kg', (/ ('', i=1, 10) /))
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_ustar_srf     = (/ &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'ustar_ter', &
-      "Friction velocity "//clnsurf(1),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'ustar_lic', &
-      "Friction velocity "//clnsurf(2),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'ustar_oce', &
-      "Friction velocity "//clnsurf(3),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'ustar_sic', &
-      "Friction velocity "//clnsurf(4),"m/s", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(5) :: o_wstar         = (/ &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'wstar_ter', &
-      "Friction velocity "//clnsurf(1),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'wstar_lic', &
-      "Friction velocity "//clnsurf(2),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'wstar_oce', &
-      "Friction velocity "//clnsurf(3),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'wstar_sic', &
-      "Friction velocity "//clnsurf(4),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 5, 5, 10, 10, 10, 10, 11, 11, 11, 11/),'wstar', &
-      "w* convective velocity "//clnsurf(4),"m/s", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_u10m_srf     = (/ &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'u10m_ter', &
-      "Vent Zonal 10m "//clnsurf(1),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'u10m_lic', &
-      "Vent Zonal 10m "//clnsurf(2),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'u10m_oce', &
-      "Vent Zonal 10m "//clnsurf(3),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'u10m_sic', &
-      "Vent Zonal 10m "//clnsurf(4),"m/s", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_v10m_srf     = (/ &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'v10m_ter', &
-      "Vent meredien 10m "//clnsurf(1),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'v10m_lic', &
-      "Vent meredien 10m "//clnsurf(2),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'v10m_oce', &
-      "Vent meredien 10m "//clnsurf(3),"m/s", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'v10m_sic', &
-      "Vent meredien 10m "//clnsurf(4),"m/s", (/ ('', i=1, 10) /)) /)
+          'qsurf', 'Surface Air humidity', 'kg/kg', (/ ('', i = 1, 10) /))
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_ustar_srf = (/ &
+          ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustar_ter', &
+                  "Friction velocity " // clnsurf(1), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustar_lic', &
+                          "Friction velocity " // clnsurf(2), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustar_oce', &
+                          "Friction velocity " // clnsurf(3), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustar_sic', &
+                          "Friction velocity " // clnsurf(4), "m/s", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(5) :: o_wstar = (/ &
+          ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'wstar_ter', &
+                  "Friction velocity " // clnsurf(1), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'wstar_lic', &
+                          "Friction velocity " // clnsurf(2), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'wstar_oce', &
+                          "Friction velocity " // clnsurf(3), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'wstar_sic', &
+                          "Friction velocity " // clnsurf(4), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 5, 5, 10, 10, 10, 10, 11, 11, 11, 11/), 'wstar', &
+                          "w* convective velocity " // clnsurf(4), "m/s", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_u10m_srf = (/ &
+          ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10m_ter', &
+                  "Vent Zonal 10m " // clnsurf(1), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10m_lic', &
+                          "Vent Zonal 10m " // clnsurf(2), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10m_oce', &
+                          "Vent Zonal 10m " // clnsurf(3), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10m_sic', &
+                          "Vent Zonal 10m " // clnsurf(4), "m/s", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_v10m_srf = (/ &
+          ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10m_ter', &
+                  "Vent meredien 10m " // clnsurf(1), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10m_lic', &
+                          "Vent meredien 10m " // clnsurf(2), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10m_oce', &
+                          "Vent meredien 10m " // clnsurf(3), "m/s", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10m_sic', &
+                          "Vent meredien 10m " // clnsurf(4), "m/s", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_qsol = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'qsol', 'Soil watter content', 'mm', (/ ('', i=1, 10) /))
+          'qsol', 'Soil watter content', 'mm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ndayrain = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ndayrain', 'Number of dayrain(liq+sol)', '-', &
-      (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
+          'ndayrain', 'Number of dayrain(liq+sol)', '-', &
+          (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)" /))
   TYPE(ctrl_out), SAVE :: o_rain_fall = ctrl_out((/ 1, 1, 1, 10, 5, 10, 11, 11, 11, 11/), &
-    'rain_fall', 'Precip Totale liq', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'rain_fall', 'Precip Totale liq', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rain_con = ctrl_out((/ 7, 7, 7, 10, 7, 10, 11, 11, 11, 11/), &
-    'rain_con', 'Precip liq conv.', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'rain_con', 'Precip liq conv.', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_precip = ctrl_out((/ 1, 1, 1, 10, 5, 10, 11, 11, 11, 11/), &
-    'precip', 'Precip Totale liq+sol', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'precip', 'Precip Totale liq+sol', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_plul = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'plul', 'Large-scale Precip.', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'plul', 'Large-scale Precip.', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_plun = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'plun', 'Numerical Precip.', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'plun', 'Numerical Precip.', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pluc = ctrl_out((/ 1, 1, 1, 10, 5, 10, 11, 11, 11, 11/), &
-    'pluc', 'Convective Precip.', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'pluc', 'Convective Precip.', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_snow = ctrl_out((/ 1, 1, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'snow', 'Snow fall', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'snow', 'Snow fall', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bsfall = ctrl_out((/ 10, 10, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'bsfall', 'Blowing Snow fall', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'bsfall', 'Blowing Snow fall', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_evap = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'evap', 'Evaporat', 'kg/(s*m2)', (/ ('', i=1, 10) /))
+          'evap', 'Evaporat', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_snowerosion = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-   'snowerosion', 'blowing snow flux', 'kg/(s*m2)', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_ustart_lic = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), & 
-    'ustart_lic', 'threshold velocity', 'm/s', (/ ('', i=1, 10) /))
+          'snowerosion', 'blowing snow flux', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_ustart_lic = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+          'ustart_lic', 'threshold velocity', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rhosnow_lic = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'rhosnow_lic', 'snow density lic', 'kg/m3', (/ ('', i=1, 10) /))
+          'rhosnow_lic', 'snow density lic', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsalt_lic = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'qsalt_lic', 'qb in saltation layer lic', 'kg/kg', (/ ('', i=1, 10) /))
+          'qsalt_lic', 'qb in saltation layer lic', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sens_prec_liq_oce = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'sens_rain_oce', 'Sensible heat flux of liquid prec. over ocean', 'W/m2', (/ ('', i=1, 10) /))
+          'sens_rain_oce', 'Sensible heat flux of liquid prec. over ocean', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sens_prec_liq_sic = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'sens_rain_sic', 'Sensible heat flux of liquid prec. over seaice', 'W/m2', (/ ('', i=1, 10) /))
+          'sens_rain_sic', 'Sensible heat flux of liquid prec. over seaice', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sens_prec_sol_oce = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'sens_snow_oce', 'Sensible heat flux of solid prec. over ocean', 'W/m2', (/ ('', i=1, 10) /))
+          'sens_snow_oce', 'Sensible heat flux of solid prec. over ocean', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sens_prec_sol_sic = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'sens_snow_sic', 'Sensible heat flux of solid prec. over seaice', 'W/m2', (/ ('', i=1, 10) /))
+          'sens_snow_sic', 'Sensible heat flux of solid prec. over seaice', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lat_prec_liq_oce = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'lat_rain_oce', 'Latent heat flux of liquid prec. over ocean', 'W/m2', (/ ('', i=1, 10) /))
+          'lat_rain_oce', 'Latent heat flux of liquid prec. over ocean', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lat_prec_liq_sic = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'lat_rain_sic', 'Latent heat flux of liquid prec. over seaice', 'W/m2', (/ ('', i=1, 10) /))
+          'lat_rain_sic', 'Latent heat flux of liquid prec. over seaice', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lat_prec_sol_oce = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'lat_snow_oce', 'Latent heat flux of solid prec. over ocean', 'W/m2', (/ ('', i=1, 10) /))
+          'lat_snow_oce', 'Latent heat flux of solid prec. over ocean', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lat_prec_sol_sic = ctrl_out((/ 5, 5, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'lat_snow_sic', 'Latent heat flux of solid prec. over seaice', 'W/m2', (/ ('', i=1, 10) /))
-
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_evap_srf     = (/ &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evap_ter', &
-      "evaporation at surface "//clnsurf(1),"kg/(s*m2)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evap_lic', &
-      "evaporation at surface "//clnsurf(2),"kg/(s*m2)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evap_oce', &
-      "evaporation at surface "//clnsurf(3),"kg/(s*m2)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evap_sic', &
-      "evaporation at surface "//clnsurf(4),"kg/(s*m2)", (/ ('', i=1, 10) /)) /)
+          'lat_snow_sic', 'Latent heat flux of solid prec. over seaice', 'W/m2', (/ ('', i = 1, 10) /))
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_evap_srf = (/ &
+          ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evap_ter', &
+                  "evaporation at surface " // clnsurf(1), "kg/(s*m2)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evap_lic', &
+                          "evaporation at surface " // clnsurf(2), "kg/(s*m2)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evap_oce', &
+                          "evaporation at surface " // clnsurf(3), "kg/(s*m2)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evap_sic', &
+                          "evaporation at surface " // clnsurf(4), "kg/(s*m2)", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_msnow = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'msnow', 'Surface snow amount', 'kg/m2', (/ ('', i=1, 10) /))
+          'msnow', 'Surface snow amount', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fsnow = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fsnow', 'Surface snow area fraction', '-', (/ ('', i=1, 10) /))
+          'fsnow', 'Surface snow area fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tops = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tops', 'Solar rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'tops', 'Solar rad. at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tops0 = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tops0', 'CS Solar rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'tops0', 'CS Solar rad. at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_topl = ctrl_out((/ 1, 1, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'topl', 'IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'topl', 'IR rad. at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_topl0 = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'topl0', 'IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'topl0', 'IR rad. at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWupTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWupTOA', 'SWup at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'SWupTOA', 'SWup at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWupTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWupTOAclr', 'SWup clear sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'SWupTOAclr', 'SWup clear sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWupTOAcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'SWupTOAcleanclr', 'SWup clear sky clean (no aerosol) at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'SWupTOAcleanclr', 'SWup clear sky clean (no aerosol) at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdnTOA = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWdnTOA', 'SWdn at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdnTOA', 'SWdn at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdnTOAclr = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWdnTOAclr', 'SWdn clear sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdnTOAclr', 'SWdn clear sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_nettop = ctrl_out((/ 1, 4, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'nettop', 'Net dn radiatif flux at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'nettop', 'Net dn radiatif flux at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWup200 = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWup200', 'SWup at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'SWup200', 'SWup at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWup200clr = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWup200clr', 'SWup clear sky at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'SWup200clr', 'SWup clear sky at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdn200 = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWdn200', 'SWdn at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdn200', 'SWdn at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdn200clr = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWdn200clr', 'SWdn clear sky at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdn200clr', 'SWdn clear sky at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
 
   ! arajouter
@@ -461,83 +458,83 @@
   !    (/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWup200 = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'LWup200', 'LWup at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'LWup200', 'LWup at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWup200clr = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'LWup200clr', 'LWup clear sky at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'LWup200clr', 'LWup clear sky at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWdn200 = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'LWdn200', 'LWdn at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'LWdn200', 'LWdn at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWdn200clr = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'LWdn200clr', 'LWdn clear sky at 200mb', 'W/m2', (/ ('', i=1, 10) /))
+          'LWdn200clr', 'LWdn clear sky at 200mb', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sols = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sols', 'Solar rad. at surf.', 'W/m2', (/ ('', i=1, 10) /))
+          'sols', 'Solar rad. at surf.', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sols0 = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sols0', 'Solar rad. at surf.', 'W/m2', (/ ('', i=1, 10) /))
+          'sols0', 'Solar rad. at surf.', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_soll = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'soll', 'IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'soll', 'IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_soll0 = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'soll0', 'IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'soll0', 'IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_radsol = ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'radsol', 'Rayonnement au sol', 'W/m2', (/ ('', i=1, 10) /))
+          'radsol', 'Rayonnement au sol', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWupSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'SWupSFC', 'SWup at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'SWupSFC', 'SWup at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWupSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'SWupSFCclr', 'SWup clear sky at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'SWupSFCclr', 'SWup clear sky at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWupSFCcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'SWupSFCcleanclr', 'SWup clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'SWupSFCcleanclr', 'SWup clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fdiffSWdnSFC = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'fdiffSWdnSFC', 'Fraction of diffuse SWdn at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'fdiffSWdnSFC', 'Fraction of diffuse SWdn at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdnSFC = ctrl_out((/ 1, 1, 1, 10, 5, 10, 11, 11, 11, 11/), &
-    'SWdnSFC', 'SWdn at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdnSFC', 'SWdn at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdnSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'SWdnSFCclr', 'SWdn clear sky at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdnSFCclr', 'SWdn clear sky at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SWdnSFCcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'SWdnSFCcleanclr', 'SWdn clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'SWdnSFCcleanclr', 'SWdn clear sky clean (no aerosol) at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWupSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'LWupSFC', 'Upwd. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'LWupSFC', 'Upwd. IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWupSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'LWupSFCclr', 'CS Upwd. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'LWupSFCclr', 'CS Upwd. IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWdnSFC = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'LWdnSFC', 'Down. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'LWdnSFC', 'Down. IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWdnSFCclr = ctrl_out((/ 1, 4, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'LWdnSFCclr', 'Down. CS IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'LWdnSFCclr', 'Down. CS IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWupTOAcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'LWupTOAcleanclr', 'Upward CS clean (no aerosol) IR rad. at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'LWupTOAcleanclr', 'Upward CS clean (no aerosol) IR rad. at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWdnSFCcleanclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'LWdnSFCcleanclr', 'Downward CS clean (no aerosol) IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'LWdnSFCcleanclr', 'Downward CS clean (no aerosol) IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'bils', 'Surf. total heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_tke = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_tke', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_tke', 'Surf. total heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_diss = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_diss', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_diss', 'Surf. total heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_ec = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_ec', 'Surf. total heat flux correction', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_ec', 'Surf. total heat flux correction', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_ech = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_ech', 'Surf. total heat flux correction', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_ech', 'Surf. total heat flux correction', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_kinetic = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_kinetic', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_kinetic', 'Surf. total heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_enthalp = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_enthalp', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_enthalp', 'Surf. total heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_bils_latent = ctrl_out((/ 1, 2, 10, 5, 10, 10, 11, 11, 11, 11/), &
-    'bils_latent', 'Surf. total heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'bils_latent', 'Surf. total heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sens = ctrl_out((/ 1, 1, 10, 10, 5, 10, 11, 11, 11, 11/), &
-    'sens', 'Sensible heat flux', 'W/m2', (/ ('', i=1, 10) /))
+          'sens', 'Sensible heat flux', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fder = ctrl_out((/ 1, 2, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fder', 'Heat flux derivation', 'W/m2', (/ ('', i=1, 10) /))
+          'fder', 'Heat flux derivation', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ffonte = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ffonte', 'Thermal flux for snow melting', 'W/m2', (/ ('', i=1, 10) /))
+          'ffonte', 'Thermal flux for snow melting', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fqcalving = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fqcalving', 'Ice Calving', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'fqcalving', 'Ice Calving', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fqfonte = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fqfonte', 'Land ice melt', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'fqfonte', 'Land ice melt', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_mrroli = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'mrroli', 'Runoff flux over land ice', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'mrroli', 'Runoff flux over land ice', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_runofflic = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'runofflic', 'Land ice melt to ocean', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'runofflic', 'Land ice melt to ocean', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_taux = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'taux', 'Zonal wind stress', 'Pa', (/ ('', i=1, 10) /))
+          'taux', 'Zonal wind stress', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tauy = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tauy', 'Meridional wind stress', 'Pa', (/ ('', i=1, 10) /))
-
-!AI Ecrad 3Deffect
+          'tauy', 'Meridional wind stress', 'Pa', (/ ('', i = 1, 10) /))
+
+  !AI Ecrad 3Deffect
 #ifdef CPP_ECRAD
   TYPE(ctrl_out), SAVE :: o_cloud_cover_sw = ctrl_out((/ 11, 11, 10, 10, 10, 10, 11, 11, 11, 11/), &
@@ -619,1362 +616,1361 @@
 
   TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_taux_srf = (/           &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'taux_ter',             &
-      "Zonal wind stress"//clnsurf(1), "Pa", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'taux_lic',             &
-      "Zonal wind stress"//clnsurf(2), "Pa", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'taux_oce',             &
-      "Zonal wind stress"//clnsurf(3), "Pa", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'taux_sic',             &
-      "Zonal wind stress"//clnsurf(4), "Pa", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tauy_srf     = (/             &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tauy_ter',                   &
-      "Meridional wind stress "//clnsurf(1),"Pa", (/ ('', i=1, 10) /)),  &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tauy_lic',                   &
-      "Meridional wind stress "//clnsurf(2),"Pa", (/ ('', i=1, 10) /)),  &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tauy_oce',                   &
-      "Meridional wind stress "//clnsurf(3),"Pa", (/ ('', i=1, 10) /)),  &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tauy_sic',                   &
-      "Meridional wind stress "//clnsurf(4),"Pa", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_pourc_srf    = (/ &
-      ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/),'pourc_ter',      &
-      "% "//clnsurf(1),"%", (/ ('', i=1, 10) /)),            &
-      ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/),'pourc_lic',      &
-      "% "//clnsurf(2),"%", (/ ('', i=1, 10) /)),            &
-      ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/),'pourc_oce',      &
-      "% "//clnsurf(3),"%", (/ ('', i=1, 10) /)),            &
-      ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/),'pourc_sic',      &
-      "% "//clnsurf(4),"%", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_fract_srf    = (/ &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'fract_ter',      &
-      "Fraction "//clnsurf(1),"1", (/ ('', i=1, 10) /)),     &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'fract_lic',      &
-      "Fraction "//clnsurf(2),"1", (/ ('', i=1, 10) /)),     &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'fract_oce',      &
-      "Fraction "//clnsurf(3),"1", (/ ('', i=1, 10) /)),     &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'fract_sic',      &
-      "Fraction "//clnsurf(4),"1", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tsol_srf     = (/ &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tsol_ter',       &
-      "Temperature "//clnsurf(1),"K", (/ ('', i=1, 10) /)),  &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tsol_lic',       &
-      "Temperature "//clnsurf(2),"K", (/ ('', i=1, 10) /)),  &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tsol_oce',       &
-      "Temperature "//clnsurf(3),"K", (/ ('', i=1, 10) /)),  &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'tsol_sic',       &
-      "Temperature "//clnsurf(4),"K", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_evappot_srf  = (/ &
-      ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evappot_ter',    &
-      "Potential evaporation "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 10) /)),   &
-      ctrl_out((/ 4, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evappot_lic',    &
-      "Potential evaporation "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 10) /)),   &
-      ctrl_out((/ 4, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evappot_oce',    &
-      "Potential evaporation "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 10) /)),   &
-      ctrl_out((/ 4, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'evappot_sic',    &
-      "Potential evaporation "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_sens_srf     = (/          &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'sens_ter',                 &
-      "Sensible heat flux "//clnsurf(1),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'sens_lic',                 &
-      "Sensible heat flux "//clnsurf(2),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'sens_oce',                 &
-      "Sensible heat flux "//clnsurf(3),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'sens_sic',                 &
-      "Sensible heat flux "//clnsurf(4),"W/m2", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_lat_srf      = (/        &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'lat_ter',                &
-      "Latent heat flux "//clnsurf(1),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'lat_lic',                &
-      "Latent heat flux "//clnsurf(2),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'lat_oce',                &
-      "Latent heat flux "//clnsurf(3),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/),'lat_sic',                &
-      "Latent heat flux "//clnsurf(4),"W/m2", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_flw_srf      = (/ &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'flw_ter',       &
-      "LW "//clnsurf(1),"W/m2", (/ ('', i=1, 10) /)),        &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'flw_lic',       &
-      "LW "//clnsurf(2),"W/m2", (/ ('', i=1, 10) /)),        &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'flw_oce',       &
-      "LW "//clnsurf(3),"W/m2", (/ ('', i=1, 10) /)),        &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'flw_sic',       &
-      "LW "//clnsurf(4),"W/m2", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_fsw_srf      = (/ &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'fsw_ter',       &
-      "SW "//clnsurf(1),"W/m2", (/ ('', i=1, 10) /)),        &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'fsw_lic',       &
-      "SW "//clnsurf(2),"W/m2", (/ ('', i=1, 10) /)),        &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'fsw_oce',       &
-      "SW "//clnsurf(3),"W/m2", (/ ('', i=1, 10) /)),        &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'fsw_sic',       &
-      "SW "//clnsurf(4),"W/m2", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wbils_srf    = (/ &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbils_ter',     &
-      "Bilan sol "//clnsurf(1),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbils_lic',     &
-      "Bilan sol "//clnsurf(2),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbils_oce',     &
-      "Bilan sol "//clnsurf(3),"W/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbils_sic',     &
-      "Bilan sol "//clnsurf(4),"W/m2", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wbilo_srf    = (/      &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbilo_ter',          &
-      "Bilan eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbilo_lic',          &
-      "Bilan eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbilo_oce',          &
-      "Bilan eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wbilo_sic',          &
-      "Bilan eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wevap_srf    = (/      &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wevap_ter',          &
-      "Evap eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wevap_lic',          &
-      "Evap eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wevap_oce',          &
-      "Evap eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wevap_sic',          &
-      "Evap eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wrain_srf    = (/      &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wrain_ter',          &
-      "Pluie eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wrain_lic',          &
-      "Pluie eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wrain_oce',          &
-      "Pluie eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wrain_sic',          &
-      "Pluie eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wsnow_srf    = (/      &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wsnow_ter',          &
-      "Neige eau "//clnsurf(1),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wsnow_lic',          &
-      "Neige eau "//clnsurf(2),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wsnow_oce',          &
-      "Neige eau "//clnsurf(3),"kg/(m2*s)", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'wsnow_sic',          &
-      "Neige eau "//clnsurf(4),"kg/(m2*s)", (/ ('', i=1, 10) /)) /)
+          ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'taux_ter', &
+                  "Zonal wind stress" // clnsurf(1), "Pa", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'taux_lic', &
+                          "Zonal wind stress" // clnsurf(2), "Pa", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'taux_oce', &
+                          "Zonal wind stress" // clnsurf(3), "Pa", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'taux_sic', &
+                          "Zonal wind stress" // clnsurf(4), "Pa", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tauy_srf = (/             &
+          ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tauy_ter', &
+                  "Meridional wind stress " // clnsurf(1), "Pa", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tauy_lic', &
+                          "Meridional wind stress " // clnsurf(2), "Pa", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tauy_oce', &
+                          "Meridional wind stress " // clnsurf(3), "Pa", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tauy_sic', &
+                          "Meridional wind stress " // clnsurf(4), "Pa", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_pourc_srf = (/ &
+          ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/), 'pourc_ter', &
+                  "% " // clnsurf(1), "%", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/), 'pourc_lic', &
+                          "% " // clnsurf(2), "%", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/), 'pourc_oce', &
+                          "% " // clnsurf(3), "%", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 7, 10, 10, 10, 10, 11, 11, 11, 11/), 'pourc_sic', &
+                          "% " // clnsurf(4), "%", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_fract_srf = (/ &
+          ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'fract_ter', &
+                  "Fraction " // clnsurf(1), "1", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'fract_lic', &
+                          "Fraction " // clnsurf(2), "1", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'fract_oce', &
+                          "Fraction " // clnsurf(3), "1", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'fract_sic', &
+                          "Fraction " // clnsurf(4), "1", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tsol_srf = (/ &
+          ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tsol_ter', &
+                  "Temperature " // clnsurf(1), "K", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tsol_lic', &
+                          "Temperature " // clnsurf(2), "K", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tsol_oce', &
+                          "Temperature " // clnsurf(3), "K", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'tsol_sic', &
+                          "Temperature " // clnsurf(4), "K", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_evappot_srf = (/ &
+          ctrl_out((/ 1, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evappot_ter', &
+                  "Potential evaporation " // clnsurf(1), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 4, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evappot_lic', &
+                          "Potential evaporation " // clnsurf(2), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 4, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evappot_oce', &
+                          "Potential evaporation " // clnsurf(3), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 4, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'evappot_sic', &
+                          "Potential evaporation " // clnsurf(4), "kg/(m2*s)", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_sens_srf = (/          &
+          ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'sens_ter', &
+                  "Sensible heat flux " // clnsurf(1), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'sens_lic', &
+                          "Sensible heat flux " // clnsurf(2), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'sens_oce', &
+                          "Sensible heat flux " // clnsurf(3), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'sens_sic', &
+                          "Sensible heat flux " // clnsurf(4), "W/m2", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_lat_srf = (/        &
+          ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'lat_ter', &
+                  "Latent heat flux " // clnsurf(1), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'lat_lic', &
+                          "Latent heat flux " // clnsurf(2), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'lat_oce', &
+                          "Latent heat flux " // clnsurf(3), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 6, 10, 7, 10, 10, 11, 11, 11, 11/), 'lat_sic', &
+                          "Latent heat flux " // clnsurf(4), "W/m2", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_flw_srf = (/ &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'flw_ter', &
+                  "LW " // clnsurf(1), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'flw_lic', &
+                          "LW " // clnsurf(2), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'flw_oce', &
+                          "LW " // clnsurf(3), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'flw_sic', &
+                          "LW " // clnsurf(4), "W/m2", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_fsw_srf = (/ &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'fsw_ter', &
+                  "SW " // clnsurf(1), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'fsw_lic', &
+                          "SW " // clnsurf(2), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'fsw_oce', &
+                          "SW " // clnsurf(3), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'fsw_sic', &
+                          "SW " // clnsurf(4), "W/m2", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wbils_srf = (/ &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbils_ter', &
+                  "Bilan sol " // clnsurf(1), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbils_lic', &
+                          "Bilan sol " // clnsurf(2), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbils_oce', &
+                          "Bilan sol " // clnsurf(3), "W/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbils_sic', &
+                          "Bilan sol " // clnsurf(4), "W/m2", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wbilo_srf = (/      &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbilo_ter', &
+                  "Bilan eau " // clnsurf(1), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbilo_lic', &
+                          "Bilan eau " // clnsurf(2), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbilo_oce', &
+                          "Bilan eau " // clnsurf(3), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wbilo_sic', &
+                          "Bilan eau " // clnsurf(4), "kg/(m2*s)", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wevap_srf = (/      &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wevap_ter', &
+                  "Evap eau " // clnsurf(1), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wevap_lic', &
+                          "Evap eau " // clnsurf(2), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wevap_oce', &
+                          "Evap eau " // clnsurf(3), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wevap_sic', &
+                          "Evap eau " // clnsurf(4), "kg/(m2*s)", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wrain_srf = (/      &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wrain_ter', &
+                  "Pluie eau " // clnsurf(1), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wrain_lic', &
+                          "Pluie eau " // clnsurf(2), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wrain_oce', &
+                          "Pluie eau " // clnsurf(3), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wrain_sic', &
+                          "Pluie eau " // clnsurf(4), "kg/(m2*s)", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_wsnow_srf = (/      &
+          ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wsnow_ter', &
+                  "Neige eau " // clnsurf(1), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wsnow_lic', &
+                          "Neige eau " // clnsurf(2), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wsnow_oce', &
+                          "Neige eau " // clnsurf(3), "kg/(m2*s)", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'wsnow_sic', &
+                          "Neige eau " // clnsurf(4), "kg/(m2*s)", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_cdrm = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cdrm', 'Momentum drag coef.', '-', (/ ('', i=1, 10) /))
+          'cdrm', 'Momentum drag coef.', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cdrh = ctrl_out((/ 1, 10, 10, 7, 10, 10, 11, 11, 11, 11/), &
-    'cdrh', 'Heat drag coef.', '-', (/ ('', i=1, 10) /))
+          'cdrh', 'Heat drag coef.', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldl = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldl', 'Low-level cloudiness', '-', (/ ('', i=1, 10) /))
+          'cldl', 'Low-level cloudiness', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldm = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldm', 'Mid-level cloudiness', '-', (/ ('', i=1, 10) /))
+          'cldm', 'Mid-level cloudiness', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldh = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldh', 'High-level cloudiness', '-', (/ ('', i=1, 10) /))
+          'cldh', 'High-level cloudiness', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldt = ctrl_out((/ 1, 1, 2, 10, 5, 10, 11, 11, 11, 11/), &
-    'cldt', 'Total cloudiness', '-', (/ ('', i=1, 10) /))
+          'cldt', 'Total cloudiness', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_JrNt = ctrl_out((/ 1, 1, 10, 7, 10, 10, 11, 11, 11, 11/), &
-    'JrNt', '1 if Day 0 if Night', '-', (/ ('', i=1, 10) /))
+          'JrNt', '1 if Day 0 if Night', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldhjn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldhjn', 'High-level cloudiness Day', '-', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_cldmjn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &      
-    'cldmjn', 'Mid-level cloudiness day', '-', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_cldljn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &       
-    'cldljn', 'Low-level cloudiness day', '-', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_cldtjn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &     
-    'cldtjn', 'Total cloudiness day', '-', (/ ('', i=1, 10) /))
- 
+          'cldhjn', 'High-level cloudiness Day', '-', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_cldmjn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cldmjn', 'Mid-level cloudiness day', '-', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_cldljn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cldljn', 'Low-level cloudiness day', '-', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_cldtjn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cldtjn', 'Total cloudiness day', '-', (/ ('', i = 1, 10) /))
+
   TYPE(ctrl_out), SAVE :: o_cldq = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldq', 'Cloud water path', 'kg/m2', (/ ('', i=1, 10) /))
+          'cldq', 'Cloud water path', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lwp = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lwp', 'Cloud liquid water path', 'kg/m2', (/ ('', i=1, 10) /))
+          'lwp', 'Cloud liquid water path', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_iwp = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'iwp', 'Cloud ice water path', 'kg/m2', (/ ('', i=1, 10) /))
+          'iwp', 'Cloud ice water path', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ue = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ue', 'Zonal dry static energy transport', 'J/m/s', (/ ('', i=1, 10) /))
+          'ue', 'Zonal dry static energy transport', 'J/m/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ve = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    've', 'Merid dry static energy transport', 'J/m/s', (/ ('', i=1, 10) /))
+          've', 'Merid dry static energy transport', 'J/m/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_uq = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'uq', 'Zonal humidity transport', 'kg/m/s', (/ ('', i=1, 10) /))
+          'uq', 'Zonal humidity transport', 'kg/m/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_vq = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'vq', 'Merid humidity transport', 'kg/m/s', (/ ('', i=1, 10) /))
+          'vq', 'Merid humidity transport', 'kg/m/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_uwat = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'uwat', 'Zonal total water transport', 'kg/m/s', (/ ('', i=1, 10) /))
+          'uwat', 'Zonal total water transport', 'kg/m/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_vwat = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'vwat', 'Merid total water transport', 'kg/m/s', (/ ('', i=1, 10) /))
+          'vwat', 'Merid total water transport', 'kg/m/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cape = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cape', 'Conv avlbl pot ener', 'J/kg', (/ ('', i=1, 10) /))
+          'cape', 'Conv avlbl pot ener', 'J/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pbase = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pbase', 'Cld base pressure', 'Pa', (/ ('', i=1, 10) /))
+          'pbase', 'Cld base pressure', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ptop = ctrl_out((/ 1, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ptop', 'Cld top pressure', 'Pa', (/ ('', i=1, 10) /))
+          'ptop', 'Cld top pressure', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fbase = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fbase', 'Cld base mass flux', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'fbase', 'Cld base mass flux', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_plcl = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'plcl', 'Lifting Condensation Level', 'hPa', (/ ('', i=1, 10) /))
+          'plcl', 'Lifting Condensation Level', 'hPa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_plfc = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'plfc', 'Level of Free Convection', 'hPa', (/ ('', i=1, 10) /))
+          'plfc', 'Level of Free Convection', 'hPa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wbeff = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wbeff', 'Conv. updraft velocity at LFC (<100)', 'm/s', (/ ('', i=1, 10) /))
+          'wbeff', 'Conv. updraft velocity at LFC (<100)', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_convoccur = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'convoccur', 'Convective occurence', '', (/ ('', i=1, 10) /))
+          'convoccur', 'Convective occurence', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_prw = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'prw', 'Precipitable water', 'kg/m2', (/ ('', i=1, 10) /))
+          'prw', 'Precipitable water', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_prlw = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'prlw', 'Precipitable liquid water', 'kg/m2', (/ ('', i=1, 10) /))
+          'prlw', 'Precipitable liquid water', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_prsw = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'prsw', 'Precipitable solid water', 'kg/m2', (/ ('', i=1, 10) /))
+          'prsw', 'Precipitable solid water', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_prbsw = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'prbsw', 'Precipitable blowing snow', 'kg/m2', (/ ('', i=1, 10) /))
+          'prbsw', 'Precipitable blowing snow', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_water_budget = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'water_budget', 'Water budget', 'kg/m2', (/ ('', i=1, 10) /))
+          'water_budget', 'Water budget', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_s_pblh = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    's_pblh', 'Boundary Layer Height', 'm', (/ ('', i=1, 10) /))
+          's_pblh', 'Boundary Layer Height', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_s_pblt = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    's_pblt', 't at Boundary Layer Height', 'K', (/ ('', i=1, 10) /))
+          's_pblt', 't at Boundary Layer Height', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_s_lcl = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    's_lcl', 'Condensation level', 'm', (/ ('', i=1, 10) /))
+          's_lcl', 'Condensation level', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_s_therm = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    's_therm', 'Exces du thermique', 'K', (/ ('', i=1, 10) /))
+          's_therm', 'Exces du thermique', 'K', (/ ('', i = 1, 10) /))
   !IM : Les champs suivants (s_capCL, s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
   ! type(ctrl_out),save :: o_s_capCL      = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'s_capCL', &
-!    (/ ('', i=1, 10) /))
+  !    (/ ('', i=1, 10) /))
   ! type(ctrl_out),save :: o_s_oliqCL     = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'s_oliqCL', &
-!    (/ ('', i=1, 10) /))
+  !    (/ ('', i=1, 10) /))
   ! type(ctrl_out),save :: o_s_cteiCL     = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'s_cteiCL', &
-!    (/ ('', i=1, 10) /))
+  !    (/ ('', i=1, 10) /))
   ! type(ctrl_out),save :: o_s_trmb1      = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'s_trmb1', &
-!    (/ ('', i=1, 10) /))
+  !    (/ ('', i=1, 10) /))
   ! type(ctrl_out),save :: o_s_trmb2      = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'s_trmb2', &
-!    (/ ('', i=1, 10) /))
+  !    (/ ('', i=1, 10) /))
   ! type(ctrl_out),save :: o_s_trmb3      = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'s_trmb3', &
-    !(/ ('', i=1, 10) /))
+  !(/ ('', i=1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_bils = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'slab_bils', 'flux atmos - slab ponderes foce', 'W/m2', (/ ('', i=1, 10) /))
+          'slab_bils', 'flux atmos - slab ponderes foce', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_bilg = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'slab_bilg', 'flux glace - slab ponderes fsic', 'W/m2', (/ ('', i=1, 10) /))
+          'slab_bilg', 'flux glace - slab ponderes fsic', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_qflux = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'slab_qflux', 'Correction flux slab', 'W/m2', (/ ('', i=1, 10) /))
+          'slab_qflux', 'Correction flux slab', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tslab = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tslab', 'Temperature ocean slab', 'K', (/ ('', i=1, 10) /))
+          'tslab', 'Temperature ocean slab', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tslab1 = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11 /), &
-    'tslab1', 'Temperature ocean slab', 'K', (/ ('', i=1, 10) /))
+          'tslab1', 'Temperature ocean slab', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tslab2 = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11 /), &
-    'tslab2', 'Temperature ocean slab', 'K', (/ ('', i=1, 10) /))
+          'tslab2', 'Temperature ocean slab', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_tice = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'slab_tice', 'Temperature banquise slab', 'K', (/ ('', i=1, 10) /))
+          'slab_tice', 'Temperature banquise slab', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_sic = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'seaice', 'Epaisseur banquise slab', 'kg/m2', (/ ('', i=1, 10) /))
+          'seaice', 'Epaisseur banquise slab', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_hdiff = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'slab_hdiff', 'Horizontal diffusion', 'W/m2', (/ ('', i=1, 10) /))
+          'slab_hdiff', 'Horizontal diffusion', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_gm = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11 /), &
-    'slab_gm', 'GM eddy advection', 'W/m2', (/ ('', i=1, 10) /))
+          'slab_gm', 'GM eddy advection', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_slab_ekman = ctrl_out((/ 1, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'slab_ekman', 'Ekman heat transport', 'W/m2', (/ ('', i=1, 10) /))
+          'slab_ekman', 'Ekman heat transport', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ale_bl = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'ale_bl', 'ALE BL', 'm2/s2', (/ ('', i=1, 10) /))
+          'ale_bl', 'ALE BL', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp_bl = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_bl', 'ALP BL', 'W/m2', (/ ('', i=1, 10) /))
+          'alp_bl', 'ALP BL', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ale_wk = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'ale_wk', 'ALE WK', 'm2/s2', (/ ('', i=1, 10) /))
+          'ale_wk', 'ALE WK', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp_wk = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_wk', 'ALP WK', 'W/m2', (/ ('', i=1, 10) /))
-!!!
-!nrlmd+jyg<
-  type(ctrl_out),save :: o_dtvdf_x        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtvdf_x', ' dtvdf off_wake','K/s', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_dtvdf_w        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtvdf_w', ' dtvdf within_wake','K/s', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_dqvdf_x        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqvdf_x', ' dqvdf off_wake','kg/kg/s', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_dqvdf_w        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqvdf_w', ' dqvdf within_wake','kg/kg/s', (/ ('', i=1, 10) /))
-!!
-  type(ctrl_out),save :: o_sens_x        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'sens_x', 'sens off_wake', 'W/m2', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_sens_w        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'sens_w', 'sens within_wake', 'W/m2', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_flat_x        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'flat_x', 'flat off_wake', 'W/m2', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_flat_w        = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'flat_w', 'flat within_wake', 'W/m2', (/ ('', i=1, 10) /))
-!!
-  type(ctrl_out),save :: o_cdragh_x       = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'cdragh_x', 'cdragh off-wake', '', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_cdragh_w       = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'cdragh_w', 'cdragh within-wake', '', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_cdragm_x       = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'cdragm_x', 'cdragm off-wake', '', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_cdragm_w       = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'cdragm_w', 'cdrgam within-wake', '', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_kh             = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'kh', 'Kh', 'kg/s/m2', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_kh_x           = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'kh_x', 'Kh off-wake', 'kg/s/m2', (/ ('', i=1, 10) /))
-  type(ctrl_out),save :: o_kh_w           = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-'kh_w', 'Kh within-wake', 'kg/s/m2', (/ ('', i=1, 10) /))
-!>nrlmd+jyg
-!!!
+          'alp_wk', 'ALP WK', 'W/m2', (/ ('', i = 1, 10) /))
+  !!!
+  !nrlmd+jyg<
+  type(ctrl_out), save :: o_dtvdf_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'dtvdf_x', ' dtvdf off_wake', 'K/s', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_dtvdf_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'dtvdf_w', ' dtvdf within_wake', 'K/s', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_dqvdf_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'dqvdf_x', ' dqvdf off_wake', 'kg/kg/s', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_dqvdf_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'dqvdf_w', ' dqvdf within_wake', 'kg/kg/s', (/ ('', i = 1, 10) /))
+  !!
+  type(ctrl_out), save :: o_sens_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'sens_x', 'sens off_wake', 'W/m2', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_sens_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'sens_w', 'sens within_wake', 'W/m2', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_flat_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'flat_x', 'flat off_wake', 'W/m2', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_flat_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'flat_w', 'flat within_wake', 'W/m2', (/ ('', i = 1, 10) /))
+  !!
+  type(ctrl_out), save :: o_cdragh_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cdragh_x', 'cdragh off-wake', '', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_cdragh_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cdragh_w', 'cdragh within-wake', '', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_cdragm_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cdragm_x', 'cdragm off-wake', '', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_cdragm_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cdragm_w', 'cdrgam within-wake', '', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_kh = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'kh', 'Kh', 'kg/s/m2', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_kh_x = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'kh_x', 'Kh off-wake', 'kg/s/m2', (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_kh_w = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'kh_w', 'Kh within-wake', 'kg/s/m2', (/ ('', i = 1, 10) /))
+  !>nrlmd+jyg
+  !!!
   TYPE(ctrl_out), SAVE :: o_ale = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'ale', 'ALE', 'm2/s2', (/ ('', i=1, 10) /))
+          'ale', 'ALE', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp', 'ALP', 'W/m2', (/ ('', i=1, 10) /))
+          'alp', 'ALP', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cin = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'cin', 'Convective INhibition', 'm2/s2', (/ ('', i=1, 10) /))
+          'cin', 'Convective INhibition', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wape = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'wape', '', 'm2/s2', (/ ('', i=1, 10) /))
-
-!!! nrlmd le 10/04/2012
-
-!-------Spectre de thermiques de type 2 au LCL
+          'wape', '', 'm2/s2', (/ ('', i = 1, 10) /))
+
+  !!! nrlmd le 10/04/2012
+
+  !-------Spectre de thermiques de type 2 au LCL
   TYPE(ctrl_out), SAVE :: o_n2 = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'n2', 'Nombre de panaches de type 2', ' ', (/ ('', i=1, 10) /))
+          'n2', 'Nombre de panaches de type 2', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_s2 = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    's2', 'Surface moyenne des panaches de type 2', 'm2', (/ ('', i=1, 10) /))
+          's2', 'Surface moyenne des panaches de type 2', 'm2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_strig = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'strig', 'Surface moyenne pour atteindre niveau de congelation', 'm2', (/ ('', i=1, 10) /))
+          'strig', 'Surface moyenne pour atteindre niveau de congelation', 'm2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_zcong = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'zcong', 'niveau de congelation', 'm', (/ ('', i=1, 10) /))  
+          'zcong', 'niveau de congelation', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_zlcl_th = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'zlcl_th', 'niveau de condensation', 'm', (/ ('', i=1, 10) /))                   
-!-------Déclenchement stochastique
+          'zlcl_th', 'niveau de condensation', 'm', (/ ('', i = 1, 10) /))
+  !-------Déclenchement stochastique
   TYPE(ctrl_out), SAVE :: o_proba_notrig = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'proba_notrig', 'Probabilite de non-declenchement', ' ', (/ ('', i=1, 10) /))
+          'proba_notrig', 'Probabilite de non-declenchement', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_random_notrig = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'random_notrig', 'Tirage aleatoire de non-declenchement', ' ', (/ ('', i=1, 10) /))
+          'random_notrig', 'Tirage aleatoire de non-declenchement', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ale_bl_stat = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'ale_bl_stat', 'ALE_BL_STAT', 'm2/s2', (/ ('', i=1, 10) /))
+          'ale_bl_stat', 'ALE_BL_STAT', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ale_bl_trig = ctrl_out((/ 1, 6, 6, 6, 10, 10, 11, 11, 11, 11/), &
-    'ale_bl_trig', 'ALE_BL_STAT + Condition S>Sthreshold', 'm2/s2', (/ ('', i=1, 10) /))
-
-!-------Fermeture statistique
+          'ale_bl_trig', 'ALE_BL_STAT + Condition S>Sthreshold', 'm2/s2', (/ ('', i = 1, 10) /))
+
+  !-------Fermeture statistique
   TYPE(ctrl_out), SAVE :: o_alp_bl_det = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_bl_det', 'ALP_BL_DET', 'W/m2', (/ ('', i=1, 10) /))
+          'alp_bl_det', 'ALP_BL_DET', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp_bl_fluct_m = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_bl_fluct_m', 'ALP_BL_FLUCT_M', 'W/m2', (/ ('', i=1, 10) /))
+          'alp_bl_fluct_m', 'ALP_BL_FLUCT_M', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp_bl_fluct_tke = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_bl_fluct_tke', 'ALP_BL_FLUCT_TKE', 'W/m2', (/ ('', i=1, 10) /))
+          'alp_bl_fluct_tke', 'ALP_BL_FLUCT_TKE', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp_bl_conv = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_bl_conv', 'ALP_BL_CONV', 'W/m2', (/ ('', i=1, 10) /))
+          'alp_bl_conv', 'ALP_BL_CONV', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alp_bl_stat = ctrl_out((/ 1, 1, 1, 10, 10, 10, 11, 11, 11, 11/), &
-    'alp_bl_stat', 'ALP_BL_STAT', 'W/m2', (/ ('', i=1, 10) /))
-
-!!! fin nrlmd le 10/04/2012
+          'alp_bl_stat', 'ALP_BL_STAT', 'W/m2', (/ ('', i = 1, 10) /))
+
+  !!! fin nrlmd le 10/04/2012
 
   ! Champs interpolles sur des niveaux de pression ??? a faire correctement
 
-  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_uSTDlevs     = (/                    &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u850', "Zonal wind 850hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u700', "Zonal wind 700hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u500', "Zonal wind 500hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u200', "Zonal wind 200hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u100', "Zonal wind 100hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u50', "Zonal wind 50hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'u10', "Zonal wind 10hPa", "m/s",     &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_vSTDlevs     = (/                     &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v850', "Meridional wind 850hPa", "m/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v700', "Meridional wind 700hPa", "m/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v500', "Meridional wind 500hPa", "m/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v200', "Meridional wind 200hPa", "m/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v100', "Meridional wind 100hPa", "m/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v50', "Meridional wind 50hPa", "m/s",  &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)),  &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'v10', "Meridional wind 10hPa", "m/s",  &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_wSTDlevs     = (/                    &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w850', "Vertical wind 850hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w700', "Vertical wind 700hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w500', "Vertical wind 500hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w200', "Vertical wind 200hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w100', "Vertical wind 100hPa", "Pa/s", &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w50', "Vertical wind 50hPa", "Pa/s",  &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'w10', "Vertical wind 10hPa", "Pa/s",  &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_tSTDlevs     = (/                    &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t850', "Temperature 850hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t700', "Temperature 700hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t500', "Temperature 500hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t200', "Temperature 200hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t100', "Temperature 100hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t50',  "Temperature 50hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'t10',  "Temperature 10hPa", "K",      &
-      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_qSTDlevs     = (/ &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q850', &
-       "Specific humidity 850hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q700', &
-       "Specific humidity 700hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q500', &
-       "Specific humidity 500hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q200', &
-       "Specific humidity 200hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q100', &
-       "Specific humidity 100hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q50', &
-       "Specific humidity 50hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-       ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'q10', &
-       "Specific humidity 10hPa", "kg/kg", &
-       (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_zSTDlevs   = (/                           &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z850', "Geopotential height 850hPa",        &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z700', "Geopotential height 700hPa",        &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z500', "Geopotential height 500hPa",        &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z200', "Geopotential height 200hPa",        &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z100', "Geopotential height 100hPa",        &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z50', "Geopotential height 50hPa",         &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
-      ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/),'z10', "Geopotential height 10hPa",         &
-      "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
+  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_uSTDlevs = (/                    &
+          ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u850', "Zonal wind 850hPa", "m/s", &
+                  (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u700', "Zonal wind 700hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u500', "Zonal wind 500hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u200', "Zonal wind 200hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u100', "Zonal wind 100hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u50', "Zonal wind 50hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'u10', "Zonal wind 10hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_vSTDlevs = (/                     &
+          ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v850', "Meridional wind 850hPa", "m/s", &
+                  (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v700', "Meridional wind 700hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v500', "Meridional wind 500hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v200', "Meridional wind 200hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v100', "Meridional wind 100hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v50', "Meridional wind 50hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'v10', "Meridional wind 10hPa", "m/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_wSTDlevs = (/                    &
+          ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w850', "Vertical wind 850hPa", "Pa/s", &
+                  (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w700', "Vertical wind 700hPa", "Pa/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w500', "Vertical wind 500hPa", "Pa/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w200', "Vertical wind 200hPa", "Pa/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w100', "Vertical wind 100hPa", "Pa/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w50', "Vertical wind 50hPa", "Pa/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'w10', "Vertical wind 10hPa", "Pa/s", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_tSTDlevs = (/                    &
+          ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't850', "Temperature 850hPa", "K", &
+                  (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't700', "Temperature 700hPa", "K", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't500', "Temperature 500hPa", "K", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't200', "Temperature 200hPa", "K", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't100', "Temperature 100hPa", "K", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't50', "Temperature 50hPa", "K", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 't10', "Temperature 10hPa", "K", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_qSTDlevs = (/ &
+          ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q850', &
+                  "Specific humidity 850hPa", "kg/kg", &
+                  (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q700', &
+                          "Specific humidity 700hPa", "kg/kg", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q500', &
+                          "Specific humidity 500hPa", "kg/kg", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q200', &
+                          "Specific humidity 200hPa", "kg/kg", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q100', &
+                          "Specific humidity 100hPa", "kg/kg", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q50', &
+                          "Specific humidity 50hPa", "kg/kg", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'q10', &
+                          "Specific humidity 10hPa", "kg/kg", &
+                          (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(7) :: o_zSTDlevs = (/                           &
+          ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z850', "Geopotential height 850hPa", &
+                  "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z700', "Geopotential height 700hPa", &
+                          "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z500', "Geopotential height 500hPa", &
+                          "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z200', "Geopotential height 200hPa", &
+                          "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z100', "Geopotential height 100hPa", &
+                          "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z50', "Geopotential height 50hPa", &
+                          "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)), &
+                  ctrl_out((/ 1, 7, 7, 10, 10, 10, 11, 11, 11, 11/), 'z10', "Geopotential height 10hPa", &
+                          "m", (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /)) /)
 
   TYPE(ctrl_out), SAVE :: o_t_oce_sic = ctrl_out((/ 1, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    't_oce_sic', 'Temp mixte oce-sic', 'K', (/ ('', i=1, 10) /))
+          't_oce_sic', 'Temp mixte oce-sic', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_weakinv = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'weakinv', 'Weak inversion', '-', (/ ('', i=1, 10) /))
+          'weakinv', 'Weak inversion', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dthmin = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dthmin', 'dTheta mini', 'K/m', (/ ('', i=1, 10) /))
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_u10_srf      = (/ &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'u10_ter', "", "", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'u10_lic', "", "", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'u10_oce', "", "", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'u10_sic', "", "", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_v10_srf      = (/ &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'v10_ter', "", "", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'v10_lic', "", "", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'v10_oce', "", "", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'v10_sic', "", "", (/ ('', i=1, 10) /)) /)
+          'dthmin', 'dTheta mini', 'K/m', (/ ('', i = 1, 10) /))
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_u10_srf = (/ &
+          ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10_ter', "", "", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10_lic', "", "", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10_oce', "", "", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'u10_sic', "", "", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_v10_srf = (/ &
+          ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10_ter', "", "", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10_lic', "", "", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10_oce', "", "", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'v10_sic', "", "", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_cldtau = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldtau', 'Cloud optical thickness', '1', (/ ('', i=1, 10) /))
+          'cldtau', 'Cloud optical thickness', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldemi = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldemi', 'Cloud optical emissivity', '1', (/ ('', i=1, 10) /))
+          'cldemi', 'Cloud optical emissivity', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rh2m = ctrl_out((/ 5, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rh2m', 'Relative humidity at 2m', '%', (/ ('', i=1, 10) /))
-!  TYPE(ctrl_out), SAVE :: o_rh2m_min = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-!    'rh2m_min', 'Min Relative humidity at 2m', '%',                        &
-!      (/ 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', & 
-!         't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)' /))
-!  TYPE(ctrl_out), SAVE :: o_rh2m_max = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-!    'rh2m_max', 'Max Relative humidity at 2m', '%',                         &
-!      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
-!         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
+          'rh2m', 'Relative humidity at 2m', '%', (/ ('', i = 1, 10) /))
+  !  TYPE(ctrl_out), SAVE :: o_rh2m_min = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
+  !    'rh2m_min', 'Min Relative humidity at 2m', '%',                        &
+  !      (/ 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', &
+  !         't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)', 't_min(X)' /))
+  !  TYPE(ctrl_out), SAVE :: o_rh2m_max = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
+  !    'rh2m_max', 'Max Relative humidity at 2m', '%',                         &
+  !      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
+  !         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
   TYPE(ctrl_out), SAVE :: o_qsat2m = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'qsat2m', 'Saturant humidity at 2m', '%', (/ ('', i=1, 10) /))
+          'qsat2m', 'Saturant humidity at 2m', '%', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tpot = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tpot', 'Surface air potential temperature', 'K', (/ ('', i=1, 10) /))
+          'tpot', 'Surface air potential temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tpote = ctrl_out((/ 10, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tpote', 'Surface air equivalent potential temperature', 'K', (/ ('', i=1, 10) /))
+          'tpote', 'Surface air equivalent potential temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tke = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tke ', 'TKE', 'm2/s2', (/ ('', i=1, 10) /))
+          'tke ', 'TKE', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tke_shear = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'tke_shear ', 'TKE shear term', 'm2/s3', (/ ('', i=1, 10) /))  
+          'tke_shear ', 'TKE shear term', 'm2/s3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tke_buoy = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'tke_buoy ', 'TKE buoyancy term', 'm2/s3', (/ ('', i=1, 10) /))
+          'tke_buoy ', 'TKE buoyancy term', 'm2/s3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tke_trans = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'tke_trans ', 'TKE transport term', 'm2/s3', (/ ('', i=1, 10) /))
+          'tke_trans ', 'TKE transport term', 'm2/s3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tke_dissip = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tke_dissip ', 'TKE dissipation term', 'm2/s3', (/ ('', i=1, 10) /))
+          'tke_dissip ', 'TKE dissipation term', 'm2/s3', (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_tke_max = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tke_max', 'TKE max', 'm2/s2',                                  &
-      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
-         't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tke_srf      = (/             &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_ter',       &
-      "Max Turb. Kinetic Energy "//clnsurf(1),"m2/s2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_lic',       &
-      "Max Turb. Kinetic Energy "//clnsurf(2),"m2/s2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_oce',       &
-      "Max Turb. Kinetic Energy "//clnsurf(3),"m2/s2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_sic',       &
-      "Max Turb. Kinetic Energy "//clnsurf(4),"m2/s2", (/ ('', i=1, 10) /)) /)
-!FC
-!  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_treedrg_srf      = (/             &
-!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_ter',       &
-!      "Drag from trees "//clnsurf(1),"-", (/ ('', i=1, 10) /)), &
-!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_lic',       &
-!      "Drag from trees "//clnsurf(2),"-", (/ ('', i=1, 10) /)), &
-!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_oce',       &
-!      "Drag from trees "//clnsurf(3),"-", (/ ('', i=1, 10) /)), &
-!      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_sic',       &
-!      "Drag from trees "//clnsurf(4),"-", (/ ('', i=1, 10) /)) /)
-!FC
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_l_mixmin      = (/             &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mixmin_ter',       &
-      "PBL mixing length "//clnsurf(1),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mixmin_lic',       &
-      "PBL mixing length "//clnsurf(2),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mixmin_oce',       &
-      "PBL mixing length "//clnsurf(3),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mixmin_sic',       &
-      "PBL mixing length "//clnsurf(4),"m", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_l_mix      = (/             &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mix_ter',       &
-      "min PBL mixing length "//clnsurf(1),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mix_lic',       &
-      "min PBL mixing length "//clnsurf(2),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mix_oce',       &
-      "min PBL mixing length "//clnsurf(3),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'l_mix_sic',       &
-      "min PBL mixing length "//clnsurf(4),"m", (/ ('', i=1, 10) /)) /)
-
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tke_max_srf  = (/                          &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_max_ter',                &
-      "Max Turb. Kinetic Energy "//clnsurf(1),"-",                                   &
-      (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
-         "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_max_lic',                &
-      "Max Turb. Kinetic Energy "//clnsurf(2),"-",                                   &
-      (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
-         "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_max_oce',                &
-      "Max Turb. Kinetic Energy "//clnsurf(3),"-",                                   &
-      (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
-         "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'tke_max_sic',                &
-      "Max Turb. Kinetic Energy "//clnsurf(4),"-",                                   &
-      (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
-         "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_dltpbltke_srf      = (/             &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'dltpbltke_ter',       &
-      "TKE difference (w - x) "//clnsurf(1),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'dltpbltke_lic',       &
-      "TKE difference (w - x) "//clnsurf(2),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'dltpbltke_oce',       &
-      "TKE difference (w - x) "//clnsurf(3),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'dltpbltke_sic',       &
-      "TKE difference (w - x) "//clnsurf(4),"-", (/ ('', i=1, 10) /)) /)
+          'tke_max', 'TKE max', 'm2/s2', &
+          (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
+                  't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)' /))
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tke_srf = (/             &
+          ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_ter', &
+                  "Max Turb. Kinetic Energy " // clnsurf(1), "m2/s2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_lic', &
+                          "Max Turb. Kinetic Energy " // clnsurf(2), "m2/s2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_oce', &
+                          "Max Turb. Kinetic Energy " // clnsurf(3), "m2/s2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_sic', &
+                          "Max Turb. Kinetic Energy " // clnsurf(4), "m2/s2", (/ ('', i = 1, 10) /)) /)
+  !FC
+  !  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_treedrg_srf      = (/             &
+  !      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_ter',       &
+  !      "Drag from trees "//clnsurf(1),"-", (/ ('', i=1, 10) /)), &
+  !      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_lic',       &
+  !      "Drag from trees "//clnsurf(2),"-", (/ ('', i=1, 10) /)), &
+  !      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_oce',       &
+  !      "Drag from trees "//clnsurf(3),"-", (/ ('', i=1, 10) /)), &
+  !      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'treedrg_sic',       &
+  !      "Drag from trees "//clnsurf(4),"-", (/ ('', i=1, 10) /)) /)
+  !FC
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_l_mixmin = (/             &
+          ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mixmin_ter', &
+                  "PBL mixing length " // clnsurf(1), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mixmin_lic', &
+                          "PBL mixing length " // clnsurf(2), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mixmin_oce', &
+                          "PBL mixing length " // clnsurf(3), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mixmin_sic', &
+                          "PBL mixing length " // clnsurf(4), "m", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_l_mix = (/             &
+          ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mix_ter', &
+                  "min PBL mixing length " // clnsurf(1), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mix_lic', &
+                          "min PBL mixing length " // clnsurf(2), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mix_oce', &
+                          "min PBL mixing length " // clnsurf(3), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'l_mix_sic', &
+                          "min PBL mixing length " // clnsurf(4), "m", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_tke_max_srf = (/                          &
+          ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_max_ter', &
+                  "Max Turb. Kinetic Energy " // clnsurf(1), "-", &
+                  (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                          "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_max_lic', &
+                          "Max Turb. Kinetic Energy " // clnsurf(2), "-", &
+                          (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                                  "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_max_oce', &
+                          "Max Turb. Kinetic Energy " // clnsurf(3), "-", &
+                          (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                                  "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'tke_max_sic', &
+                          "Max Turb. Kinetic Energy " // clnsurf(4), "-", &
+                          (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                                  "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_dltpbltke_srf = (/             &
+          ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'dltpbltke_ter', &
+                  "TKE difference (w - x) " // clnsurf(1), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'dltpbltke_lic', &
+                          "TKE difference (w - x) " // clnsurf(2), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'dltpbltke_oce', &
+                          "TKE difference (w - x) " // clnsurf(3), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'dltpbltke_sic', &
+                          "TKE difference (w - x) " // clnsurf(4), "-", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_delta_tsurf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'delta_tsurf ', 'T_surf difference (w - x)', 'K', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_delta_tsurf_srf      = (/             &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'delta_tsurf_ter',       &
-      "T_surf difference (w - x) "//clnsurf(1),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'delta_tsurf_lic',       &
-      "T_surf difference (w - x) "//clnsurf(2),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'delta_tsurf_oce',       &
-      "T_surf difference (w - x) "//clnsurf(3),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/),'delta_tsurf_sic',       &
-      "T_surf difference (w - x) "//clnsurf(4),"-", (/ ('', i=1, 10) /)) /)
+          'delta_tsurf ', 'T_surf difference (w - x)', 'K', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_delta_tsurf_srf = (/             &
+          ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'delta_tsurf_ter', &
+                  "T_surf difference (w - x) " // clnsurf(1), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'delta_tsurf_lic', &
+                          "T_surf difference (w - x) " // clnsurf(2), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'delta_tsurf_oce', &
+                          "T_surf difference (w - x) " // clnsurf(3), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 4, 10, 10, 10, 10, 11, 11, 11, 11/), 'delta_tsurf_sic', &
+                          "T_surf difference (w - x) " // clnsurf(4), "-", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_kz = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'kz', 'Kz melange', 'm2/s', (/ ('', i=1, 10) /))
+          'kz', 'Kz melange', 'm2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_kz_max = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'kz_max', 'Kz melange max', 'm2/s',                                  &
-      (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
-         't_max(X)', "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
+          'kz_max', 'Kz melange max', 'm2/s', &
+          (/ 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', 't_max(X)', &
+                  't_max(X)', "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
   TYPE(ctrl_out), SAVE :: o_SWnetOR = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'SWnetOR', 'Sfce net SW radiation OR', 'W/m2', (/ ('', i=1, 10) /))
+          'SWnetOR', 'Sfce net SW radiation OR', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_LWdownOR = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'LWdownOR', 'Sfce incident LW radiation OR', 'W/m2', (/ ('', i=1, 10) /))
+          'LWdownOR', 'Sfce incident LW radiation OR', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_snowl = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'snowl', 'Solid Large-scale Precip.', 'kg/(m2*s)', (/ ('', i=1, 10) /))
+          'snowl', 'Solid Large-scale Precip.', 'kg/(m2*s)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cape_max = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cape_max', 'CAPE max.', 'J/kg',                                       &
-      (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
-         "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
+          'cape_max', 'CAPE max.', 'J/kg', &
+          (/ "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", &
+                  "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)", "t_max(X)" /))
   TYPE(ctrl_out), SAVE :: o_solldown = ctrl_out((/ 10, 1, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'solldown', 'Down. IR rad. at surface', 'W/m2', (/ ('', i=1, 10) /))
+          'solldown', 'Down. IR rad. at surface', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtsvdfo = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtsvdfo', 'Boundary-layer dTs(o)', 'K/s', (/ ('', i=1, 10) /))
+          'dtsvdfo', 'Boundary-layer dTs(o)', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtsvdft = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtsvdft', 'Boundary-layer dTs(t)', 'K/s', (/ ('', i=1, 10) /))
+          'dtsvdft', 'Boundary-layer dTs(t)', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtsvdfg = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtsvdfg', 'Boundary-layer dTs(g)', 'K/s', (/ ('', i=1, 10) /))
+          'dtsvdfg', 'Boundary-layer dTs(g)', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtsvdfi = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtsvdfi', 'Boundary-layer dTs(g)', 'K/s', (/ ('', i=1, 10) /))
+          'dtsvdfi', 'Boundary-layer dTs(g)', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_z0m = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'z0m', 'roughness length, momentum', '-', (/ ('', i=1, 10) /))
+          'z0m', 'roughness length, momentum', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_z0h = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'z0h', 'roughness length, enthalpy', '-', (/ ('', i=1, 10) /))
+          'z0h', 'roughness length, enthalpy', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_topswad = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'topswad', 'ADE at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'topswad', 'ADE at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_topswad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'topswad0', 'ADE clear-sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'topswad0', 'ADE clear-sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_topswai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'topswai', 'AIE at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'topswai', 'AIE at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_solswad = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'solswad', 'ADE at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'solswad', 'ADE at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_solswad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'solswad0', 'ADE clear-sky at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'solswad0', 'ADE clear-sky at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_solswai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'solswai', 'AIE at SFR', 'W/m2', (/ ('', i=1, 10) /))
+          'solswai', 'AIE at SFR', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_toplwad = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'toplwad', 'LW-ADE at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'toplwad', 'LW-ADE at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_toplwad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'toplwad0', 'LW-ADE clear-sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'toplwad0', 'LW-ADE clear-sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_toplwai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'toplwai', 'LW-AIE at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'toplwai', 'LW-AIE at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sollwad = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sollwad', 'LW-ADE at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'sollwad', 'LW-ADE at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sollwad0 = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sollwad0', 'LW-ADE clear-sky at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'sollwad0', 'LW-ADE clear-sky at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sollwai = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sollwai', 'LW-AIE at SFR', 'W/m2', (/ ('', i=1, 10) /))
-
-  TYPE(ctrl_out),SAVE,DIMENSION(naero_tot) :: o_tausumaero =                              &
-       (/ ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(1),     &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(1),"1", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(2),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(2),"2", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(3),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(3),"3", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(4),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(4),"4", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(5),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(5),"5", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(6),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(6),"6", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(7),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(7),"7", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(8),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(8),"8", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(9),        &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(9),"9", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(10),       &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(10),"10", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(11),       &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(11),"11", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(12),       &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(12),"12", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(13),       &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(13),"13", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'od550_'//name_aero_tau(14),       &
-       "Aerosol Optical depth at 550 nm "//name_aero_tau(14),"14", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out),SAVE,DIMENSION(naero_tot-1) :: o_drytausumaero =                              &
-       (/ ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(1),     &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(1),"1", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(2),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(2),"2", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(3),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(3),"3", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(4),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(4),"4", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(5),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(5),"5", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(6),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(6),"6", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(7),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(7),"7", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(8),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(8),"8", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(9),        &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(9),"9", (/ ('', i=1, 10) /)),     &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(10),       &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(10),"10", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(11),       &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(11),"11", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(12),       &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(12),"12", (/ ('', i=1, 10) /)),   &
-       ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'dryod550_'//name_aero_tau(13),       &
-       "Dry aerosol Optical depth at 550 nm "//name_aero_tau(13),"13", (/ ('', i=1, 10) /)) /)
-!
+          'sollwai', 'LW-AIE at SFR', 'W/m2', (/ ('', i = 1, 10) /))
+
+  TYPE(ctrl_out), SAVE, DIMENSION(naero_tot) :: o_tausumaero = &
+          (/ ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(1), &
+                  "Aerosol Optical depth at 550 nm " // name_aero_tau(1), "1", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(2), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(2), "2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(3), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(3), "3", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(4), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(4), "4", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(5), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(5), "5", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(6), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(6), "6", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(7), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(7), "7", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(8), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(8), "8", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(9), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(9), "9", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(10), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(10), "10", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(11), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(11), "11", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(12), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(12), "12", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(13), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(13), "13", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'od550_' // name_aero_tau(14), &
+                          "Aerosol Optical depth at 550 nm " // name_aero_tau(14), "14", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(naero_tot - 1) :: o_drytausumaero = &
+          (/ ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(1), &
+                  "Dry aerosol Optical depth at 550 nm " // name_aero_tau(1), "1", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(2), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(2), "2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(3), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(3), "3", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(4), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(4), "4", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(5), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(5), "5", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(6), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(6), "6", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(7), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(7), "7", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(8), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(8), "8", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(9), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(9), "9", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(10), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(10), "10", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(11), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(11), "11", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(12), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(12), "12", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dryod550_' // name_aero_tau(13), &
+                          "Dry aerosol Optical depth at 550 nm " // name_aero_tau(13), "13", (/ ('', i = 1, 10) /)) /)
+
   TYPE(ctrl_out), SAVE :: o_tausumaero_lw = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'od_10um_STRAT', 'Stratospheric Aerosol Optical depth at 10 um ', '1', (/ ('', i=1, 10) /))
-!
+          'od_10um_STRAT', 'Stratospheric Aerosol Optical depth at 10 um ', '1', (/ ('', i = 1, 10) /))
+
   TYPE(ctrl_out), SAVE :: o_od443aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'od443aer', 'Total aerosol optical depth at 440nm', '-', (/ ('', i=1, 10) /))
+          'od443aer', 'Total aerosol optical depth at 440nm', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_od550aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'od550aer', 'Total aerosol optical depth at 550nm', '-', (/ ('', i=1, 10) /))
+          'od550aer', 'Total aerosol optical depth at 550nm', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dryod550aer = ctrl_out((/ 11, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dryod550aer', 'Total dry aerosol optical depth at 550nm', '-', (/ ('', i=1, 10) /))
+          'dryod550aer', 'Total dry aerosol optical depth at 550nm', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_od865aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'od865aer', 'Total aerosol optical depth at 870nm', '-', (/ ('', i=1, 10) /))
+          'od865aer', 'Total aerosol optical depth at 870nm', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_abs550aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'abs550aer', 'Absorption aerosol optical depth at 550nm', '-', (/ ('', i=1, 10) /))
+          'abs550aer', 'Absorption aerosol optical depth at 550nm', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_od550lt1aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'od550lt1aer', 'Fine mode optical depth', '-', (/ ('', i=1, 10) /))
+          'od550lt1aer', 'Fine mode optical depth', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sconcso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sconcso4', 'Surface Concentration of Sulfate ', 'kg/m3', (/ ('', i=1, 10) /))
+          'sconcso4', 'Surface Concentration of Sulfate ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sconcno3 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sconcno3', 'Surface Concentration of Nitrate ', 'kg/m3', (/ ('', i=1, 10) /))
+          'sconcno3', 'Surface Concentration of Nitrate ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sconcoa = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sconcoa', 'Surface Concentration of Organic Aerosol ', 'kg/m3', (/ ('', i=1, 10) /))
+          'sconcoa', 'Surface Concentration of Organic Aerosol ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sconcbc = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sconcbc', 'Surface Concentration of Black Carbon ', 'kg/m3', (/ ('', i=1, 10) /))
+          'sconcbc', 'Surface Concentration of Black Carbon ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sconcss = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sconcss', 'Surface Concentration of Sea Salt ', 'kg/m3', (/ ('', i=1, 10) /))
+          'sconcss', 'Surface Concentration of Sea Salt ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sconcdust = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sconcdust', 'Surface Concentration of Dust ', 'kg/m3', (/ ('', i=1, 10) /))
+          'sconcdust', 'Surface Concentration of Dust ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_concso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'concso4', 'Concentration of Sulfate ', 'kg/m3', (/ ('', i=1, 10) /))
+          'concso4', 'Concentration of Sulfate ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_concno3 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'concno3', 'Concentration of Nitrate ', 'kg/m3', (/ ('', i=1, 10) /))
+          'concno3', 'Concentration of Nitrate ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_concoa = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'concoa', 'Concentration of Organic Aerosol ', 'kg/m3', (/ ('', i=1, 10) /))
+          'concoa', 'Concentration of Organic Aerosol ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_concbc = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'concbc', 'Concentration of Black Carbon ', 'kg/m3', (/ ('', i=1, 10) /))
+          'concbc', 'Concentration of Black Carbon ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_concss = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'concss', 'Concentration of Sea Salt ', 'kg/m3', (/ ('', i=1, 10) /))
+          'concss', 'Concentration of Sea Salt ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_concdust = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'concdust', 'Concentration of Dust ', 'kg/m3', (/ ('', i=1, 10) /))
+          'concdust', 'Concentration of Dust ', 'kg/m3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadso4 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'loadso4', 'Column Load of Sulfate ', 'kg/m2', (/ ('', i=1, 10) /))
+          'loadso4', 'Column Load of Sulfate ', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadoa = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'loadoa', 'Column Load of Organic Aerosol ', 'kg/m2', (/ ('', i=1, 10) /))
+          'loadoa', 'Column Load of Organic Aerosol ', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadbc = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'loadbc', 'Column Load of Black Carbon ', 'kg/m2', (/ ('', i=1, 10) /))
+          'loadbc', 'Column Load of Black Carbon ', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadss = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'loadss', 'Column Load of Sea Salt ', 'kg/m2', (/ ('', i=1, 10) /))
+          'loadss', 'Column Load of Sea Salt ', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loaddust = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'loaddust', 'Column Load of Dust ', 'kg/m2', (/ ('', i=1, 10) /))
+          'loaddust', 'Column Load of Dust ', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_loadno3 = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'loadno3', 'Column Load of Nitrate ', 'kg/m2', (/ ('', i=1, 10) /))
+          'loadno3', 'Column Load of Nitrate ', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoaas_nat = ctrl_out((/ 11, 11, 1, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoaas_nat', 'Natural aerosol radiative forcing all-sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoaas_nat', 'Natural aerosol radiative forcing all-sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfas_nat = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfas_nat', 'Natural aerosol radiative forcing all-sky at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfas_nat', 'Natural aerosol radiative forcing all-sky at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoacs_nat = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoacs_nat', 'Natural aerosol radiative forcing clear-sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoacs_nat', 'Natural aerosol radiative forcing clear-sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfcs_nat = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfcs_nat', 'Natural aerosol radiative forcing clear-sky at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfcs_nat', 'Natural aerosol radiative forcing clear-sky at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoaas_ant = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoaas_ant', 'Anthropogenic aerosol radiative forcing all-sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoaas_ant', 'Anthropogenic aerosol radiative forcing all-sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfas_ant = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfas_ant', 'Anthropogenic aerosol radiative forcing all-sky at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfas_ant', 'Anthropogenic aerosol radiative forcing all-sky at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoacs_ant = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoacs_ant', 'Anthropogenic aerosol radiative forcing clear-sky at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoacs_ant', 'Anthropogenic aerosol radiative forcing clear-sky at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfcs_ant = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfcs_ant', 'Anthropogenic aerosol radiative forcing clear-sky at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfcs_ant', 'Anthropogenic aerosol radiative forcing clear-sky at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoacf_nat = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoacf_nat', 'Natural aerosol impact on cloud radiative forcing at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoacf_nat', 'Natural aerosol impact on cloud radiative forcing at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfcf_nat = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfcf_nat', 'Natural aerosol impact on cloud radiative forcing  at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfcf_nat', 'Natural aerosol impact on cloud radiative forcing  at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoacf_ant = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoacf_ant', 'Anthropogenic aerosol impact on cloud radiative forcing at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoacf_ant', 'Anthropogenic aerosol impact on cloud radiative forcing at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfcf_ant = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfcf_ant', 'Anthropogenic aerosol impact on cloud radiative forcing at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfcf_ant', 'Anthropogenic aerosol impact on cloud radiative forcing at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swtoacf_zero = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swtoacf_zero', 'Cloud radiative forcing (allsky-clearsky fluxes) at TOA', 'W/m2', (/ ('', i=1, 10) /))
+          'swtoacf_zero', 'Cloud radiative forcing (allsky-clearsky fluxes) at TOA', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_swsrfcf_zero = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'swsrfcf_zero', 'Cloud radiative forcing (allsky-clearsky fluxes) at SRF', 'W/m2', (/ ('', i=1, 10) /))
+          'swsrfcf_zero', 'Cloud radiative forcing (allsky-clearsky fluxes) at SRF', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldncl = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldncl', 'CDNC at top of liquid water cloud', 'm-3', (/ ('', i=1, 10) /))
+          'cldncl', 'CDNC at top of liquid water cloud', 'm-3', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_reffclwtop = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'reffclwtop', 'Droplet effective radius at top of liquid water cloud', 'm', (/ ('', i=1, 10) /))
+          'reffclwtop', 'Droplet effective radius at top of liquid water cloud', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldnvi = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldnvi', 'Column Integrated Cloud Droplet Number', 'm-2', (/ ('', i=1, 10) /))
+          'cldnvi', 'Column Integrated Cloud Droplet Number', 'm-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lcc = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lcc', 'Cloud liquid fraction at top of cloud', '1', (/ ('', i=1, 10) /))
-
-!--tropopause pressure
+          'lcc', 'Cloud liquid fraction at top of cloud', '1', (/ ('', i = 1, 10) /))
+
+  !--tropopause pressure
   TYPE(ctrl_out), SAVE :: o_p_tropopause = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'p_tropopause', 'Tropopause pressure', 'Pa', (/ ('', i=1, 10) /))
-!--tropopause height
+          'p_tropopause', 'Tropopause pressure', 'Pa', (/ ('', i = 1, 10) /))
+  !--tropopause height
   TYPE(ctrl_out), SAVE :: o_z_tropopause = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'z_tropopause', 'Tropopause height', 'm', (/ ('', i=1, 10) /))
-!--tropopause temperature
+          'z_tropopause', 'Tropopause height', 'm', (/ ('', i = 1, 10) /))
+  !--tropopause temperature
   TYPE(ctrl_out), SAVE :: o_t_tropopause = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    't_tropopause', 'Tropopause temperature', 'K', (/ ('', i=1, 10) /))
-!--Added ThL
+          't_tropopause', 'Tropopause temperature', 'K', (/ ('', i = 1, 10) /))
+  !--Added ThL
   TYPE(ctrl_out), SAVE :: o_col_O3_strato = ctrl_out((/2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'colO3_strat','Ozone stratospheric column', 'DU', (/('', i=1, 10) /))
+          'colO3_strat', 'Ozone stratospheric column', 'DU', (/('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_col_O3_tropo = ctrl_out((/2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'colO3_trop','Ozone tropospheric column', 'DU', (/('', i=1, 10) /))
-!--end add ThL
-
-!---CO2 fluxes for interactive CO2 configuration
+          'colO3_trop', 'Ozone tropospheric column', 'DU', (/('', i = 1, 10) /))
+  !--end add ThL
+
+  !---CO2 fluxes for interactive CO2 configuration
   TYPE(ctrl_out), SAVE :: o_flx_co2_ff = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'flx_co2_ff', 'CO2 flux from fossil fuel and cement', '1', (/ ('', i=1, 10) /))
+          'flx_co2_ff', 'CO2 flux from fossil fuel and cement', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flx_co2_bb = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'flx_co2_bb', 'CO2 flux from biomass burning', '1', (/ ('', i=1, 10) /))
+          'flx_co2_bb', 'CO2 flux from biomass burning', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flx_co2_ocean = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'flx_co2_ocean', 'CO2 flux from the ocean', '1', (/ ('', i=1, 10) /))
+          'flx_co2_ocean', 'CO2 flux from the ocean', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flx_co2_land = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'flx_co2_land', 'CO2 flux from the land', '1', (/ ('', i=1, 10) /))
+          'flx_co2_land', 'CO2 flux from the land', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flx_co2_ocean_cor = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'flx_co2_ocean_cor', 'correction of the CO2 flux from the ocean', 'kg CO2 m-2 s-1', (/ ('', i=1, 10) /))
+          'flx_co2_ocean_cor', 'correction of the CO2 flux from the ocean', 'kg CO2 m-2 s-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flx_co2_land_cor = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'flx_co2_land_cor', 'correction of the CO2 flux from the land', 'kg CO2 m-2 s-1', (/ ('', i=1, 10) /))
-
-!--extinction coefficient
+          'flx_co2_land_cor', 'correction of the CO2 flux from the land', 'kg CO2 m-2 s-1', (/ ('', i = 1, 10) /))
+
+  !--extinction coefficient
   TYPE(ctrl_out), SAVE :: o_ext_strat_550 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'ext_strat_550', 'Strat. aerosol extinction coefficient at 550 nm', '1/m', (/ ('', i=1, 10) /))
+          'ext_strat_550', 'Strat. aerosol extinction coefficient at 550 nm', '1/m', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ext_strat_1020 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'ext_strat_1020', 'Strat. aerosol extinction coefficient at 1020 nm', '1/m', (/ ('', i=1, 10) /))
-!--strat aerosol optical depth
+          'ext_strat_1020', 'Strat. aerosol extinction coefficient at 1020 nm', '1/m', (/ ('', i = 1, 10) /))
+  !--strat aerosol optical depth
   TYPE(ctrl_out), SAVE :: o_tau_strat_550 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'OD550_strat_only', 'Stratospheric Aerosol Optical depth at 550 nm ', '1', (/ ('', i=1, 10) /))
+          'OD550_strat_only', 'Stratospheric Aerosol Optical depth at 550 nm ', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tau_strat_1020 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'OD1020_strat_only', 'Stratospheric Aerosol Optical depth at 1020 nm ', '1', (/ ('', i=1, 10) /))
-!--chemistry
+          'OD1020_strat_only', 'Stratospheric Aerosol Optical depth at 1020 nm ', '1', (/ ('', i = 1, 10) /))
+  !--chemistry
   TYPE(ctrl_out), SAVE :: o_R2SO4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'R2SO4', 'H2SO4 mass fraction in aerosol', '%', (/ ('', i=1, 10) /))
+          'R2SO4', 'H2SO4 mass fraction in aerosol', '%', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_OCS_lifetime = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'OCS_lifetime', 'OCS lifetime', 's', (/ ('', i=1, 10) /))
+          'OCS_lifetime', 'OCS lifetime', 's', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_SO2_lifetime = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'SO2_lifetime', 'SO2 lifetime', 's', (/ ('', i=1, 10) /))
+          'SO2_lifetime', 'SO2 lifetime', 's', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_f_r_wet = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'f_r_wet', 'Conversion factor dry to wet aerosol radius', '-', (/ ('', i=1, 10) /))
-!--budget  3D
+          'f_r_wet', 'Conversion factor dry to wet aerosol radius', '-', (/ ('', i = 1, 10) /))
+  !--budget  3D
   TYPE(ctrl_out), SAVE :: o_budg_3D_nucl = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_3D_nucl', 'H2SO4 nucleation mass flux', 'kg(S)/m2/layer/s', (/ ('', i=1, 10) /))
+          'budg_3D_nucl', 'H2SO4 nucleation mass flux', 'kg(S)/m2/layer/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_3D_cond_evap = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_3D_cond_evap', 'H2SO4 condensation/evaporation mass flux', 'kg(S)/m2/layer/s', (/ ('', i=1, 10) /))
+          'budg_3D_cond_evap', 'H2SO4 condensation/evaporation mass flux', 'kg(S)/m2/layer/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_3D_ocs_to_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_3D_ocs_to_so2', 'OCS mass flux converted to SO2', 'kg(S)/m2/layer/s', (/ ('', i=1, 10) /))
+          'budg_3D_ocs_to_so2', 'OCS mass flux converted to SO2', 'kg(S)/m2/layer/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_3D_so2_to_h2so4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_3D_so2_to_h2so4', 'SO2 mass flux converted to H2SO4', 'kg(S)/m2/layer/s', (/ ('', i=1, 10) /))
+          'budg_3D_so2_to_h2so4', 'SO2 mass flux converted to H2SO4', 'kg(S)/m2/layer/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_3D_backgr_ocs = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_3D_backgr_ocs', 'OCS background tendency', 'kg(S)/m2/layer/s', (/ ('', i=1, 10) /))
+          'budg_3D_backgr_ocs', 'OCS background tendency', 'kg(S)/m2/layer/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_3D_backgr_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_3D_backgr_so2', 'SO2 background tendency', 'kg(S)/m2/layer/s', (/ ('', i=1, 10) /))
+          'budg_3D_backgr_so2', 'SO2 background tendency', 'kg(S)/m2/layer/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_vsed_aer = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'vsed_aer', 'Strat. aerosol sedimentation velocity (mass-weighted)', 'm/s', (/ ('', i=1, 10) /))
-!--budget  2D
+          'vsed_aer', 'Strat. aerosol sedimentation velocity (mass-weighted)', 'm/s', (/ ('', i = 1, 10) /))
+  !--budget  2D
   TYPE(ctrl_out), SAVE :: o_budg_dep_dry_ocs = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_dry_ocs',   'OCS dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_dry_ocs', 'OCS dry deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_wet_ocs = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_wet_ocs',   'OCS wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_wet_ocs', 'OCS wet deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_dry_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_dry_so2',   'SO2 dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_dry_so2', 'SO2 dry deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_wet_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_wet_so2',   'SO2 wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_wet_so2', 'SO2 wet deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_dry_h2so4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_dry_h2so4', 'H2SO4 dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_dry_h2so4', 'H2SO4 dry deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_wet_h2so4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_wet_h2so4', 'H2SO4 wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_wet_h2so4', 'H2SO4 wet deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_dry_part = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_dry_part', 'particle dry deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_dry_part', 'particle dry deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_dep_wet_part = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_dep_wet_part', 'particle wet deposition flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_dep_wet_part', 'particle wet deposition flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_emi_ocs = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_emi_ocs', 'OCS emission flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_emi_ocs', 'OCS emission flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_emi_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_emi_so2', 'SO2 emission flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_emi_so2', 'SO2 emission flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_emi_h2so4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_emi_h2so4', 'H2SO4 emission flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_emi_h2so4', 'H2SO4 emission flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_emi_part = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_emi_part', 'Particle emission flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_emi_part', 'Particle emission flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_ocs_to_so2 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_ocs_to_so2', 'OCS to SO2 flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_ocs_to_so2', 'OCS to SO2 flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_so2_to_h2so4 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_so2_to_h2so4', 'SO2 to H2SO4 flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_so2_to_h2so4', 'SO2 to H2SO4 flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_h2so4_to_part = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_h2so4_to_part', 'H2SO4 to part flux', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
+          'budg_h2so4_to_part', 'H2SO4 to part flux', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_budg_sed_part = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'budg_sed_part', 'Ground sedimentation flux of strat. particles', 'kg(S)/m2/s', (/ ('', i=1, 10) /))
-!--surface PM25 due to strat aerosol
+          'budg_sed_part', 'Ground sedimentation flux of strat. particles', 'kg(S)/m2/s', (/ ('', i = 1, 10) /))
+  !--surface PM25 due to strat aerosol
   TYPE(ctrl_out), SAVE :: o_surf_PM25_sulf = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 1/), &
-    'surf_PM25_sulf', 'Sulfate PM2.5 concentration at the surface', 'ug/m3', (/ ('', i=1, 10) /))
-
-!!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 
+          'surf_PM25_sulf', 'Sulfate PM2.5 concentration at the surface', 'ug/m3', (/ ('', i = 1, 10) /))
+
+  !!!!!!!!!!!!!!!!!!!!!! 3D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   TYPE(ctrl_out), SAVE :: o_ec550aer = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ec550aer', 'Extinction at 550nm', 'm^-1', (/ ('', i=1, 10) /))
+          'ec550aer', 'Extinction at 550nm', 'm^-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lwcon = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lwcon', 'Cloud liquid water content seen by radiation', 'kg/kg', (/ ('', i=1, 10) /))
+          'lwcon', 'Cloud liquid water content seen by radiation', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_iwcon = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'iwcon', 'Cloud ice water content seen by radiation', 'kg/kg', (/ ('', i=1, 10) /))
+          'iwcon', 'Cloud ice water content seen by radiation', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_temp = ctrl_out((/ 2, 3, 4, 10, 10, 10, 11, 11, 11, 11/), &
-    'temp', 'Air temperature', 'K', (/ ('', i=1, 10) /))
+          'temp', 'Air temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_heat_volc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'heat_volc', 'SW heating rate due to volcano', 'K/s', (/ ('', i=1, 10) /))
+          'heat_volc', 'SW heating rate due to volcano', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cool_volc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cool_volc', 'LW cooling rate due to volcano', 'K/s', (/ ('', i=1, 10) /))
+          'cool_volc', 'LW cooling rate due to volcano', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_theta = ctrl_out((/ 2, 3, 4, 10, 10, 10, 11, 11, 11, 11/), &
-    'theta', 'Potential air temperature', 'K', (/ ('', i=1, 10) /))
+          'theta', 'Potential air temperature', 'K', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ovap = ctrl_out((/ 2, 3, 4, 10, 10, 10, 11, 11, 11, 11/), &
-    'ovap', 'Specific humidity', 'kg/kg', (/ ('', i=1, 10) /))
+          'ovap', 'Specific humidity', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ovapinit = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ovapinit', 'Specific humidity (begin of timestep)', 'kg/kg', (/ ('', i=1, 10) /))
+          'ovapinit', 'Specific humidity (begin of timestep)', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_oliq = ctrl_out((/ 2, 3, 4, 10, 10, 10, 11, 11, 11, 11/), &
-    'oliq', 'Liquid water', 'kg/kg', (/ ('', i=1, 10) /))
+          'oliq', 'Liquid water', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ocond = ctrl_out((/ 2, 3, 4, 10, 10, 10, 11, 11, 11, 11/), &
-    'ocond', 'Condensed water', 'kg/kg', (/ ('', i=1, 10) /))
+          'ocond', 'Condensed water', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qbs = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'qbs', 'Specific content of blowing snow', 'kg/kg', (/ ('', i=1, 10) /))
+          'qbs', 'Specific content of blowing snow', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wvapp = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wvapp', '', '', (/ ('', i=1, 10) /))
+          'wvapp', '', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_geop = ctrl_out((/ 2, 3, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'geop', 'Geopotential height', 'm2/s2', (/ ('', i=1, 10) /))
+          'geop', 'Geopotential height', 'm2/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_vitu = ctrl_out((/ 2, 3, 4, 6, 10, 10, 11, 11, 11, 11/), &
-    'vitu', 'Zonal wind', 'm/s', (/ ('', i=1, 10) /))
+          'vitu', 'Zonal wind', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_vitv = ctrl_out((/ 2, 3, 4, 6, 10, 10, 11, 11, 11, 11/), &
-    'vitv', 'Meridional wind', 'm/s', (/ ('', i=1, 10) /))
+          'vitv', 'Meridional wind', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_vitw = ctrl_out((/ 2, 3, 10, 6, 10, 10, 11, 11, 11, 11/), &
-    'vitw', 'Vertical wind', 'Pa/s', (/ ('', i=1, 10) /))
+          'vitw', 'Vertical wind', 'Pa/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pres = ctrl_out((/ 2, 3, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pres', 'Air pressure', 'Pa', (/ ('', i=1, 10) /))
+          'pres', 'Air pressure', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_paprs = ctrl_out((/ 2, 3, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'paprs', 'Air pressure Inter-Couches', 'Pa', (/ ('', i=1, 10) /))
+          'paprs', 'Air pressure Inter-Couches', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_mass = ctrl_out((/ 2, 3, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'mass', 'Masse Couches', 'kg/m2', (/ ('', i=1, 10) /))
+          'mass', 'Masse Couches', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_zfull = ctrl_out((/ 2, 3, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'zfull', 'Altitude of full pressure levels', 'm', (/ ('', i=1, 10) /))
+          'zfull', 'Altitude of full pressure levels', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_zhalf = ctrl_out((/ 2, 3, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'zhalf', 'Altitude of half pressure levels', 'm', (/ ('', i=1, 10) /))
+          'zhalf', 'Altitude of half pressure levels', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rneb = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rneb', 'Cloud fraction', '-', (/ ('', i=1, 10) /))
+          'rneb', 'Cloud fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cldfraliq = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'cldfraliq', 'Liquid fraction of the cloud', '-', (/ ('', i=1, 10) /))
+          'cldfraliq', 'Liquid fraction of the cloud', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sigma2_icefracturb = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'sigma2_icefracturb', 'Variance of the diagnostic supersaturation distribution (icefrac_turb) [-]', '-', (/ ('', i=1, 10) /))
+          'sigma2_icefracturb', 'Variance of the diagnostic supersaturation distribution (icefrac_turb) [-]', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_mean_icefracturb = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'mean_icefracturb', 'Mean of the diagnostic supersaturation distribution (icefrac_turb) [-]', '-', (/ ('', i=1, 10) /))
- 
-  TYPE(ctrl_out), SAVE :: o_rnebjn = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11,11, 11/), &      
-    'rnebjn', 'Cloud fraction in day', '-', (/ ('', i=1, 10) /))
+          'mean_icefracturb', 'Mean of the diagnostic supersaturation distribution (icefrac_turb) [-]', '-', (/ ('', i = 1, 10) /))
+
+  TYPE(ctrl_out), SAVE :: o_rnebjn = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'rnebjn', 'Cloud fraction in day', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rnebcon = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rnebcon', 'Convective Cloud Fraction', '-', (/ ('', i=1, 10) /))
+          'rnebcon', 'Convective Cloud Fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rnebls = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rnebls', 'LS Cloud fraction', '-', (/ ('', i=1, 10) /))
+          'rnebls', 'LS Cloud fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rneblsvol = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rneblsvol', 'LS Cloud fraction by volume', '-', (/ ('', i=1, 10) /))
+          'rneblsvol', 'LS Cloud fraction by volume', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pfraclr = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'pfraclr', 'LS precipitation fraction clear-sky part', '-', (/ ('', i=1, 10) /))
+          'pfraclr', 'LS precipitation fraction clear-sky part', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pfracld = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'pfracld', 'LS precipitation fraction cloudy part', '-', (/ ('', i=1, 10) /))
+          'pfracld', 'LS precipitation fraction cloudy part', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qrainlsc = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'qrainlsc', 'LS specific rain content', 'kg/kg', (/ ('', i=1, 10) /))
+          'qrainlsc', 'LS specific rain content', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsnowlsc = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'qsnowlsc', 'LS specific snow content', 'kg/kg', (/ ('', i=1, 10) /))
+          'qsnowlsc', 'LS specific snow content', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqreva = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqreva', 'LS rain tendency due to evaporation', 'kg/kg/s', (/ ('', i=1, 10) /))
-   TYPE(ctrl_out), SAVE :: o_dqrauto = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqrauto', 'LS rain tendency due to autoconversion', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqreva', 'LS rain tendency due to evaporation', 'kg/kg/s', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_dqrauto = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
+          'dqrauto', 'LS rain tendency due to autoconversion', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqrcol = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqrcol', 'LS rain tendency due to collection', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqrcol', 'LS rain tendency due to collection', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqrmelt = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqrmelt', 'LS rain tendency due to melting', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqrmelt', 'LS rain tendency due to melting', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqrfreez = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqrfreez', 'LS rain tendency due to freezing', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqrfreez', 'LS rain tendency due to freezing', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqssub = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqssub', 'LS snow tendency due to sublimation', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqssub', 'LS snow tendency due to sublimation', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsauto = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqsauto', 'LS snow tendency due to autoconversion', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqsauto', 'LS snow tendency due to autoconversion', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsagg = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqsagg', 'LS snow tendency due to aggregation', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqsagg', 'LS snow tendency due to aggregation', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsrim = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqsrim', 'LS snow tendency due to riming', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqsrim', 'LS snow tendency due to riming', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsmelt = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqsmelt', 'LS snow tendency due to melting', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqsmelt', 'LS snow tendency due to melting', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsfreez = ctrl_out((/ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11/), &
-    'dqsfreez', 'LS snow tendency due to freezing', 'kg/kg/s', (/ ('', i=1, 10) /))
+          'dqsfreez', 'LS snow tendency due to freezing', 'kg/kg/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rhum = ctrl_out((/ 2, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rhum', 'Relative humidity', '-', (/ ('', i=1, 10) /))
+          'rhum', 'Relative humidity', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rhl = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rhl', 'Relative humidity wrt liquid', '%', (/ ('', i=1, 10) /))
+          'rhl', 'Relative humidity wrt liquid', '%', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rhi = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rhi', 'Relative humidity wrt ice', '%', (/ ('', i=1, 10) /))
+          'rhi', 'Relative humidity wrt ice', '%', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ozone = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ozone', 'Ozone mole fraction', '-', (/ ('', i=1, 10) /))
+          'ozone', 'Ozone mole fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ozone_light = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ozone_daylight', 'Daylight ozone mole fraction', '-', (/ ('', i=1, 10) /))
+          'ozone_daylight', 'Daylight ozone mole fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_upwd = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'upwd', 'saturated updraft', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'upwd', 'saturated updraft', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_epmax_diag = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'epmax', 'epmax en fn cape', 'su', (/ ('', i=1, 10) /))
+          'epmax', 'epmax en fn cape', 'su', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ep = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ep', 'ep', 'su', (/ ('', i=1, 10) /))
+          'ep', 'ep', 'su', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_duphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'duphy', 'Physics du', 'm/s2', (/ ('', i=1, 10) /))
+          'duphy', 'Physics du', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtphy', 'Physics dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtphy', 'Physics dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqphy', 'Physics dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqphy', 'Physics dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqphy2d = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqphy2d', 'Physics dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqphy2d', 'Physics dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlphy', 'Physics dQL', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqlphy', 'Physics dQL', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlphy2d = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlphy2d', 'Physics dQL', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqlphy2d', 'Physics dQL', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsphy = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqsphy', 'Physics dQS', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqsphy', 'Physics dQS', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsphy2d = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqsphy2d', 'Physics dQS', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqsphy2d', 'Physics dQS', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbsphy = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbsphy', 'Physics dQBS', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqbsphy', 'Physics dQBS', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbsphy2d = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbsphy2d', 'Physics dQBS', '(kg/m2)/s', (/ ('', i=1, 10) /)) 
+          'dqbsphy2d', 'Physics dQBS', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pr_con_l = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pr_con_l', 'Convective precipitation lic', ' ', (/ ('', i=1, 10) /))
+          'pr_con_l', 'Convective precipitation lic', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pr_con_i = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pr_con_i', 'Convective precipitation ice', ' ', (/ ('', i=1, 10) /))
+          'pr_con_i', 'Convective precipitation ice', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pr_lsc_l = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pr_lsc_l', 'Large scale precipitation lic', ' ', (/ ('', i=1, 10) /))
+          'pr_lsc_l', 'Large scale precipitation lic', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pr_lsc_i = ctrl_out((/ 2, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pr_lsc_i', 'Large scale precipitation ice', ' ', (/ ('', i=1, 10) /))
+          'pr_lsc_i', 'Large scale precipitation ice', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_pr_bs = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'pr_bs', 'profile of blowing snow flux', ' ', (/ ('', i=1, 10) /))
+          'pr_bs', 'profile of blowing snow flux', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_re = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    're', 'Cloud droplet effective radius', 'um', (/ ('', i=1, 10) /))
+          're', 'Cloud droplet effective radius', 'um', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fl = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fl', 'Denominator of Cloud droplet effective radius', ' ', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_scdnc = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'scdnc', 'Cloud droplet number concentration', 'm-3', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_reffclws = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'reffclws', 'Stratiform Cloud Droplet Effective Radius (aerosol diags.)', 'm', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_reffclwc = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'reffclwc', 'Convective Cloud Droplet Effective Radius (aerosol diags.)', 'm', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_lcc3d = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lcc3d', 'Cloud liquid fraction', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_lcc3dcon = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lcc3dcon', 'Convective cloud liquid fraction', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_lcc3dstra = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lcc3dstra', 'Stratiform cloud liquid fraction', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_icc3dcon = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'icc3dcon', 'Convective cloud ice fraction', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_icc3dstra = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'icc3dstra', 'Stratiform cloud ice fraction', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_cldicemxrat = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldicemxrat', 'Cloud Ice Mixing Ratio', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_cldwatmxrat = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cldwatmxrat', 'Cloud Water Mixing Ratio', '1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_solbnd = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'solbnd', 'Top-of-Atmosphere Solar Insolation for each band', 'W m-2', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_stratomask = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'stratomask', 'Stratospheric fraction', '1', (/ ('', i=1, 10) /))
-!FC
-  TYPE(ctrl_out), SAVE :: o_zxfluxt = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fluxt', 'flux h ', 'W/m2', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_zxfluxq = ctrl_out((/ 2,  6, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fluxq', 'flux q ', 'kg/(s*m2)', (/ ('', i=1, 10) /))
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_albe_srf     = (/ &
-      ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/),'albe_ter', "Albedo VIS surf. "//clnsurf(1),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/),'albe_lic', "Albedo VIS surf. "//clnsurf(2),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/),'albe_oce', "Albedo VIS surf. "//clnsurf(3),"-", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/),'albe_sic', "Albedo VIS surf. "//clnsurf(4),"-", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_ages_srf     = (/ &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'ages_ter', "Snow age", "day", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'ages_lic', "Snow age", "day", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'ages_oce',"Snow age", "day", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'ages_sic',"Snow age", "day", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_snow_srf     = (/ &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'snow_ter', "Snow", "kg/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'snow_lic', "Snow", "kg/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'snow_oce',"Snow", "kg/m2", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/),'snow_sic',"Snow", "kg/m2", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_z0m_srf     = (/ &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0m_ter', "Surface roughness "//clnsurf(1),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0m_lic', "Surface roughness "//clnsurf(2),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0m_oce', "Surface roughness "//clnsurf(3),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0m_sic', "Surface roughness "//clnsurf(4),"m", (/ ('', i=1, 10) /)) /)
-
-  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_z0h_srf     = (/ &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0h_ter', "Surface roughness "//clnsurf(1),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0h_lic', "Surface roughness "//clnsurf(2),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0h_oce', "Surface roughness "//clnsurf(3),"m", (/ ('', i=1, 10) /)), &
-      ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/),'z0h_sic', "Surface roughness "//clnsurf(4),"m", (/ ('', i=1, 10) /)) /)
+          'fl', 'Denominator of Cloud droplet effective radius', ' ', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_scdnc = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'scdnc', 'Cloud droplet number concentration', 'm-3', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_reffclws = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'reffclws', 'Stratiform Cloud Droplet Effective Radius (aerosol diags.)', 'm', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_reffclwc = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'reffclwc', 'Convective Cloud Droplet Effective Radius (aerosol diags.)', 'm', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_lcc3d = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'lcc3d', 'Cloud liquid fraction', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_lcc3dcon = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'lcc3dcon', 'Convective cloud liquid fraction', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_lcc3dstra = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'lcc3dstra', 'Stratiform cloud liquid fraction', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_icc3dcon = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'icc3dcon', 'Convective cloud ice fraction', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_icc3dstra = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'icc3dstra', 'Stratiform cloud ice fraction', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_cldicemxrat = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cldicemxrat', 'Cloud Ice Mixing Ratio', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_cldwatmxrat = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'cldwatmxrat', 'Cloud Water Mixing Ratio', '1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_solbnd = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'solbnd', 'Top-of-Atmosphere Solar Insolation for each band', 'W m-2', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_stratomask = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'stratomask', 'Stratospheric fraction', '1', (/ ('', i = 1, 10) /))
+  !FC
+  TYPE(ctrl_out), SAVE :: o_zxfluxt = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'fluxt', 'flux h ', 'W/m2', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_zxfluxq = ctrl_out((/ 2, 6, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'fluxq', 'flux q ', 'kg/(s*m2)', (/ ('', i = 1, 10) /))
+  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_albe_srf = (/ &
+          ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/), 'albe_ter', "Albedo VIS surf. " // clnsurf(1), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/), 'albe_lic', "Albedo VIS surf. " // clnsurf(2), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/), 'albe_oce', "Albedo VIS surf. " // clnsurf(3), "-", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 7, 10, 7, 10, 10, 11, 11, 11, 11/), 'albe_sic', "Albedo VIS surf. " // clnsurf(4), "-", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_ages_srf = (/ &
+          ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ages_ter', "Snow age", "day", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ages_lic', "Snow age", "day", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ages_oce', "Snow age", "day", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ages_sic', "Snow age", "day", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_snow_srf = (/ &
+          ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'snow_ter', "Snow", "kg/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'snow_lic', "Snow", "kg/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'snow_oce', "Snow", "kg/m2", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'snow_sic', "Snow", "kg/m2", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_z0m_srf = (/ &
+          ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0m_ter', "Surface roughness " // clnsurf(1), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0m_lic', "Surface roughness " // clnsurf(2), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0m_oce', "Surface roughness " // clnsurf(3), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0m_sic', "Surface roughness " // clnsurf(4), "m", (/ ('', i = 1, 10) /)) /)
+
+  TYPE(ctrl_out), SAVE, DIMENSION(4) :: o_z0h_srf = (/ &
+          ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0h_ter', "Surface roughness " // clnsurf(1), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0h_lic', "Surface roughness " // clnsurf(2), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0h_oce', "Surface roughness " // clnsurf(3), "m", (/ ('', i = 1, 10) /)), &
+                  ctrl_out((/ 3, 6, 10, 10, 10, 10, 11, 11, 11, 11/), 'z0h_sic', "Surface roughness " // clnsurf(4), "m", (/ ('', i = 1, 10) /)) /)
 
   TYPE(ctrl_out), SAVE :: o_alb1 = ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'alb1', 'Surface VIS albedo', '-', (/ ('', i=1, 10) /))
+          'alb1', 'Surface VIS albedo', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_alb2 = ctrl_out((/ 3, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'alb2', 'Surface Near IR albedo', '-', (/ ('', i=1, 10) /))
+          'alb2', 'Surface Near IR albedo', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_clwcon = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'clwcon', 'Convective Cloud Liquid water content', 'kg/kg', (/ ('', i=1, 10) /))
+          'clwcon', 'Convective Cloud Liquid water content', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Mipsh = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'Mipsh', 'mass flux shed from adiab. ascents', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'Mipsh', 'mass flux shed from adiab. ascents', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Ma = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'Ma', 'undilute adiab updraft mass flux', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'Ma', 'undilute adiab updraft mass flux', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dnwd = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dnwd', 'saturated downdraft', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'dnwd', 'saturated downdraft', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dnwd0 = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dnwd0', 'unsat. downdraft', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'dnwd0', 'unsat. downdraft', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_mc = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'mc', 'Convective mass flux', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'mc', 'Convective mass flux', 'kg/m2/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ftime_deepcv = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ftime_deepcv', 'Fraction of time deep convection Occurs', ' ', (/ ('', i=1, 10) /))
+          'ftime_deepcv', 'Fraction of time deep convection Occurs', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ftime_con = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ftime_con', 'Fraction of time convection Occurs', ' ', (/ ('', i=1, 10) /))
-!!jyg    'ftime_con', 'Fraction of time convection Occurs', ' ',                 &
-!!jyg      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', & 
-!!jyg         'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /))
+          'ftime_con', 'Fraction of time convection Occurs', ' ', (/ ('', i = 1, 10) /))
+  !!jyg    'ftime_con', 'Fraction of time convection Occurs', ' ',                 &
+  !!jyg      (/ 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', &
+  !!jyg         'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)', 'inst(X)' /))
   TYPE(ctrl_out), SAVE :: o_dtdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtdyn', 'Dynamics dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtdyn', 'Dynamics dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqdyn', 'Dynamics dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqdyn', 'Dynamics dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqdyn2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqdyn2d', 'Dynamics dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqdyn2d', 'Dynamics dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqldyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqldyn', 'Dynamics dQL', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqldyn', 'Dynamics dQL', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqldyn2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqldyn2d', 'Dynamics dQL', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqldyn2d', 'Dynamics dQL', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqsdyn', 'Dynamics dQS', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqsdyn', 'Dynamics dQS', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqsdyn2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqsdyn2d', 'Dynamics dQS', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqsdyn2d', 'Dynamics dQS', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbsdyn = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbsdyn', 'Dynamics dQBS', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqbsdyn', 'Dynamics dQBS', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbsdyn2d = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbsdyn2d', 'Dynamics dQBS', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqbsdyn2d', 'Dynamics dQBS', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dudyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dudyn', 'Dynamics dU', 'm/s2', (/ ('', i=1, 10) /))
+          'dudyn', 'Dynamics dU', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dvdyn = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dvdyn', 'Dynamics dV', 'm/s2', (/ ('', i=1, 10) /))
+          'dvdyn', 'Dynamics dV', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtcon = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtcon', 'Convection dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtcon', 'Convection dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ducon = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ducon', 'Convection du', 'm/s2', (/ ('', i=1, 10) /))
+          'ducon', 'Convection du', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dvcon = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dvcon', 'Convection dv', 'm/s2', (/ ('', i=1, 10) /))
+          'dvcon', 'Convection dv', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqcon = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqcon', 'Convection dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqcon', 'Convection dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqcon2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqcon2d', 'Convection dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqcon2d', 'Convection dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtwak = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtwak', 'Wake dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtwak', 'Wake dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqwak = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqwak', 'Wake dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqwak', 'Wake dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqwak2d = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqwak2d', 'Wake dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqwak2d', 'Wake dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cv_gen = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'cv_gen', 'Cumulonimbus genesis', '1/(m2 s)', (/ ('', i=1, 10) /))
+          'cv_gen', 'Cumulonimbus genesis', '1/(m2 s)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wake_h = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wake_h', 'wake_h', '-', (/ ('', i=1, 10) /))
+          'wake_h', 'wake_h', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wake_dens = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wake_dens', 'number of wakes per m2', '1/m2', (/ ('', i=1, 10) /))
+          'wake_dens', 'number of wakes per m2', '1/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wake_s = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wake_s', 'wake_s', '-', (/ ('', i=1, 10) /))
+          'wake_s', 'wake_s', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wake_deltat = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wake_deltat', 'wake_deltat', ' ', (/ ('', i=1, 10) /))
+          'wake_deltat', 'wake_deltat', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wake_deltaq = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wake_deltaq', 'wake_deltaq', ' ', (/ ('', i=1, 10) /))
+          'wake_deltaq', 'wake_deltaq', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_wake_omg = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'wake_omg', 'wake_omg', 'Pa/s', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_wdtrainA = ctrl_out((/ 4, 5, 10,  4, 10, 10, 11, 11, 11, 11 /), &
-    'wdtrainA', 'precipitation from AA', '-', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_wdtrainS = ctrl_out((/ 4, 5, 10,  4, 10, 10, 11, 11, 11, 11 /), &
-    'wdtrainS', 'precipitation from shedding of AA', '-', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_wdtrainM = ctrl_out((/ 4, 5, 10,  4, 10, 10, 11, 11, 11, 11 /), &
-    'wdtrainM', 'precipitation from mixture', '-', (/ ('', i=1, 10) /))
+          'wake_omg', 'wake_omg', 'Pa/s', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_wdtrainA = ctrl_out((/ 4, 5, 10, 4, 10, 10, 11, 11, 11, 11 /), &
+          'wdtrainA', 'precipitation from AA', '-', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_wdtrainS = ctrl_out((/ 4, 5, 10, 4, 10, 10, 11, 11, 11, 11 /), &
+          'wdtrainS', 'precipitation from shedding of AA', '-', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_wdtrainM = ctrl_out((/ 4, 5, 10, 4, 10, 10, 11, 11, 11, 11 /), &
+          'wdtrainM', 'precipitation from mixture', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_Vprecip = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'Vprecip', 'precipitation vertical profile', '-', (/ ('', i=1, 10) /))
+          'Vprecip', 'precipitation vertical profile', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qtaa = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'qtaa', 'specific total water in adiabatic ascents', 'kg/kg', (/ ('', i=1, 10) /))
+          'qtaa', 'specific total water in adiabatic ascents', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_clwaa = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'Clwaa', 'specific condensed water in adiabatic ascents', 'kg/kg', (/ ('', i=1, 10) /))
+          'Clwaa', 'specific condensed water in adiabatic ascents', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ftd = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ftd', 'tend temp due aux descentes precip', '-', (/ ('', i=1, 10) /))
+          'ftd', 'tend temp due aux descentes precip', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_fqd = ctrl_out((/ 4, 5, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'fqd', 'tend vap eau due aux descentes precip', '-', (/ ('', i=1, 10) /))
+          'fqd', 'tend vap eau due aux descentes precip', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlsc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlsc', 'Condensation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtlsc', 'Condensation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlschr = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlschr', 'Large-scale condensational heating rate', 'K/s', (/ ('', i=1, 10) /))
+          'dtlschr', 'Large-scale condensational heating rate', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlsc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlsc', 'Condensation dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqlsc', 'Condensation dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlsc2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlsc2d', 'Condensation dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqlsc2d', 'Condensation dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_beta_prec = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'beta_prec', 'LS Conversion rate to prec', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'beta_prec', 'LS Conversion rate to prec', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtvdf', 'Boundary-layer dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtvdf', 'Boundary-layer dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtdis = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtdis', 'TKE dissipation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtdis', 'TKE dissipation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqvdf', 'Boundary-layer dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqvdf', 'Boundary-layer dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqvdf2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqvdf2d', 'Boundary-layer dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqvdf2d', 'Boundary-layer dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dteva = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dteva', 'Reevaporation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dteva', 'Reevaporation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqeva = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqeva', 'Reevaporation dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqeva', 'Reevaporation dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqeva2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqeva2d', 'Reevaporation dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqeva2d', 'Reevaporation dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbsvdf = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbsvdf', 'Boundary-layer dQBS', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqbsvdf', 'Boundary-layer dQBS', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbsbs = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbsbs', 'Blowing snow dQBS', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqbsbs', 'Blowing snow dQBS', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtbs = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtbs', 'Blowing snow dT', '(K)/s', (/ ('', i=1, 10) /))
+          'dtbs', 'Blowing snow dT', '(K)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqbs = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqbs', 'Blowing snow dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
-
-!!!!!!!!!!!!!!!! Specifique thermiques
+          'dqbs', 'Blowing snow dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
+
+  !!!!!!!!!!!!!!!! Specifique thermiques
   TYPE(ctrl_out), SAVE :: o_dqlscth = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlscth', 'dQ therm.', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqlscth', 'dQ therm.', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlscth2d = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlscth2d', 'dQ therm.', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqlscth2d', 'dQ therm.', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlscst = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlscst', 'dQ strat.', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqlscst', 'dQ strat.', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqlscst2d = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqlscst2d', 'dQ strat.', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqlscst2d', 'dQ strat.', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlscth = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlscth', 'dQ therm.', 'K/s', (/ ('', i=1, 10) /))
+          'dtlscth', 'dQ therm.', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlscst = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlscst', 'dQ strat.', 'K/s', (/ ('', i=1, 10) /))
+          'dtlscst', 'dQ strat.', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_plulth = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'plulth', 'Rainfall therm.', 'K/s', (/ ('', i=1, 10) /))
+          'plulth', 'Rainfall therm.', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_plulst = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'plulst', 'Rainfall strat.', 'K/s', (/ ('', i=1, 10) /))
+          'plulst', 'Rainfall strat.', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lmaxth = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lmaxth', "Upper level thermals", "", (/ ('', i=1, 10) /))
+          'lmaxth', "Upper level thermals", "", (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ptconvth = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ptconvth', 'POINTS CONVECTIFS therm.', ' ', (/ ('', i=1, 10) /))
-!!!!!!!!!!!!!!!!!!!!!!!!
+          'ptconvth', 'POINTS CONVECTIFS therm.', ' ', (/ ('', i = 1, 10) /))
+  !!!!!!!!!!!!!!!!!!!!!!!!
   TYPE(ctrl_out), SAVE :: o_ptconv = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ptconv', 'POINTS CONVECTIFS', ' ', (/ ('', i=1, 10) /))
+          'ptconv', 'POINTS CONVECTIFS', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ratqs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ratqs', 'RATQS', ' ', (/ ('', i=1, 10) /))
+          'ratqs', 'RATQS', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtthe = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtthe', 'Thermal dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtthe', 'Thermal dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_duthe = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'duthe', 'Thermal du', 'm/s2', (/ ('', i=1, 10) /))
+          'duthe', 'Thermal du', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dvthe = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dvthe', 'Thermal dv', 'm/s2', (/ ('', i=1, 10) /))
+          'dvthe', 'Thermal dv', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_f_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'f_th', 'Thermal plume mass flux', 'kg/(m2*s)', (/ ('', i=1, 10) /))
+          'f_th', 'Thermal plume mass flux', 'kg/(m2*s)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_e_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'e_th', 'Thermal plume entrainment', 'K/s', (/ ('', i=1, 10) /))
+          'e_th', 'Thermal plume entrainment', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_w_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'w_th', 'Thermal plume vertical velocity', 'm/s', (/ ('', i=1, 10) /))
+          'w_th', 'Thermal plume vertical velocity', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_lambda_th = ctrl_out((/ 10, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'lambda_th', 'Thermal plume vertical velocity', 'm/s', (/ ('', i=1, 10) /))
+          'lambda_th', 'Thermal plume vertical velocity', 'm/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ftime_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ftime_th', 'Fraction of time Shallow convection occurs', ' ', (/ ('', i=1, 10) /))
+          'ftime_th', 'Fraction of time Shallow convection occurs', ' ', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_q_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'q_th', 'Thermal plume total humidity', 'kg/kg', (/ ('', i=1, 10) /))
+          'q_th', 'Thermal plume total humidity', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_a_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'a_th', "Thermal plume fraction", "", (/ ('', i=1, 10) /))
+          'a_th', "Thermal plume fraction", "", (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_cloudth_sth = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    's_th', "Thermal plume saturation deficit", "kg/kg", (/ ('', i=1, 10) /))
+          's_th', "Thermal plume saturation deficit", "kg/kg", (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cloudth_senv = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    's_env', "Environment saturation deficit", "kg/kg", (/ ('', i=1, 10) /))
+          's_env', "Environment saturation deficit", "kg/kg", (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cloudth_sigmath = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sigma_th', "Thermal plume gauss variance", "kg/kg", (/ ('', i=1, 10) /))
+          'sigma_th', "Thermal plume gauss variance", "kg/kg", (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_cloudth_sigmaenv = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'sigma_env', "Environment gauss variance", "kg/kg", (/ ('', i=1, 10) /))
+          'sigma_env', "Environment gauss variance", "kg/kg", (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE :: o_d_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'd_th', 'Thermal plume detrainment', 'K/s', (/ ('', i=1, 10) /))
+          'd_th', 'Thermal plume detrainment', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_f0_th = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'f0_th', 'Thermal closure mass flux', 'K/s', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_zmax_th = ctrl_out((/ 4,  4,  4,  5, 10, 10, 11, 11, 11, 11/), &
-    'zmax_th', 'Thermal plume height', 'K/s', (/ ('', i=1, 10) /))
+          'f0_th', 'Thermal closure mass flux', 'K/s', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_zmax_th = ctrl_out((/ 4, 4, 4, 5, 10, 10, 11, 11, 11, 11/), &
+          'zmax_th', 'Thermal plume height', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqthe = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqthe', 'Thermal dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqthe', 'Thermal dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqthe2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqthe2d', 'Thermal dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqthe2d', 'Thermal dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtajs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtajs', 'Dry adjust. dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtajs', 'Dry adjust. dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqajs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqajs', 'Dry adjust. dQ', '(kg/kg)/s', (/ ('', i=1, 10) /))
+          'dqajs', 'Dry adjust. dQ', '(kg/kg)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqajs2d = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqajs2d', 'Dry adjust. dQ', '(kg/m2)/s', (/ ('', i=1, 10) /))
+          'dqajs2d', 'Dry adjust. dQ', '(kg/m2)/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtswr = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtswr', 'SW radiation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtswr', 'SW radiation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtsw0 = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtsw0', 'CS SW radiation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtsw0', 'CS SW radiation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlwr = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlwr', 'LW radiation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtlwr', 'LW radiation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlw0 = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlw0', 'CS LW radiation dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtlw0', 'CS LW radiation dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtec = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtec', 'Cinetic dissip dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtec', 'Cinetic dissip dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_duvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'duvdf', 'Boundary-layer dU', 'm/s2', (/ ('', i=1, 10) /))
+          'duvdf', 'Boundary-layer dU', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dvvdf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dvvdf', 'Boundary-layer dV', 'm/s2', (/ ('', i=1, 10) /))
+          'dvvdf', 'Boundary-layer dV', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_duoro = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'duoro', 'Orography dU', 'm/s2', (/ ('', i=1, 10) /))
+          'duoro', 'Orography dU', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dvoro = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dvoro', 'Orography dV', 'm/s2', (/ ('', i=1, 10) /))
+          'dvoro', 'Orography dV', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dulif = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dulif', 'Orography dU', 'm/s2', (/ ('', i=1, 10) /))
+          'dulif', 'Orography dU', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dvlif = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dvlif', 'Orography dV', 'm/s2', (/ ('', i=1, 10) /))
+          'dvlif', 'Orography dV', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_du_gwd_hines = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'du_gwd_hines', 'Hines GWD dU', 'm/s2', (/ ('', i=1, 10) /))
+          'du_gwd_hines', 'Hines GWD dU', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dv_gwd_hines = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dv_gwd_hines', 'Hines GWD dV', 'm/s2', (/ ('', i=1, 10) /))
+          'dv_gwd_hines', 'Hines GWD dV', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_du_gwd_front = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'du_gwd_front', 'Fronts GWD dU', 'm/s2', (/ ('', i=1, 10) /))
+          'du_gwd_front', 'Fronts GWD dU', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dv_gwd_front = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dv_gwd_front', 'Fronts GWD dV', 'm/s2', (/ ('', i=1, 10) /))
+          'dv_gwd_front', 'Fronts GWD dV', 'm/s2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_east_gwstress = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'east_gwstress', 'Eastward GW Stress', 'Pa', (/ ('', i=1, 10) /))
+          'east_gwstress', 'Eastward GW Stress', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_west_gwstress = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'west_gwstress', 'Westward GW Stress', 'Pa', (/ ('', i=1, 10) /))
+          'west_gwstress', 'Westward GW Stress', 'Pa', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtoro = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtoro', 'Orography dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtoro', 'Orography dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dtlif = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dtlif', 'Orography dT', 'K/s', (/ ('', i=1, 10) /))
+          'dtlif', 'Orography dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dthin = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dthin', 'Hines GWD dT', 'K/s', (/ ('', i=1, 10) /))
+          'dthin', 'Hines GWD dT', 'K/s', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dqch4 = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dqch4', 'H2O due to CH4 oxidation & photolysis', '(kg/kg)/s', (/ ('', i=1, 10) /))
-
-  type(ctrl_out), save:: o_du_gwd_rando &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'du_gwd_rando', &
-       "Random gravity waves dU/dt", "m/s2", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_dv_gwd_rando &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dv_gwd_rando', &
-       "Random gravity waves dV/dt", "m/s2", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_ustr_gwd_hines &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustr_gwd_hines', &
-       "zonal wind stress Hines gravity waves", "Pa", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_vstr_gwd_hines &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'vstr_gwd_hines', &
-       "meridional wind stress Hines gravity waves", "Pa", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_ustr_gwd_front &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustr_gwd_front', &
-       "zonal wind stress fronts gravity waves", "Pa", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_vstr_gwd_front &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'vstr_gwd_front', &
-       "meridional wind stress fronts gravity waves", "Pa", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_ustr_gwd_rando &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustr_gwd_rando', &
-       "zonal wind stress random gravity waves", "Pa", (/ ('', i=1, 10) /))
-  type(ctrl_out), save:: o_vstr_gwd_rando &
-       = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'vstr_gwd_rando', &
-       "meridional wind stress random gravity waves", "Pa", (/ ('', i=1, 10) /))
+          'dqch4', 'H2O due to CH4 oxidation & photolysis', '(kg/kg)/s', (/ ('', i = 1, 10) /))
+
+  type(ctrl_out), save :: o_du_gwd_rando &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'du_gwd_rando', &
+                  "Random gravity waves dU/dt", "m/s2", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_dv_gwd_rando &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'dv_gwd_rando', &
+                  "Random gravity waves dV/dt", "m/s2", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_ustr_gwd_hines &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustr_gwd_hines', &
+                  "zonal wind stress Hines gravity waves", "Pa", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_vstr_gwd_hines &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'vstr_gwd_hines', &
+                  "meridional wind stress Hines gravity waves", "Pa", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_ustr_gwd_front &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustr_gwd_front', &
+                  "zonal wind stress fronts gravity waves", "Pa", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_vstr_gwd_front &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'vstr_gwd_front', &
+                  "meridional wind stress fronts gravity waves", "Pa", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_ustr_gwd_rando &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'ustr_gwd_rando', &
+                  "zonal wind stress random gravity waves", "Pa", (/ ('', i = 1, 10) /))
+  type(ctrl_out), save :: o_vstr_gwd_rando &
+          = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), 'vstr_gwd_rando', &
+                  "meridional wind stress random gravity waves", "Pa", (/ ('', i = 1, 10) /))
 
   TYPE(ctrl_out), SAVE, ALLOCATABLE :: o_trac(:)
@@ -2021,86 +2017,86 @@
 
   TYPE(ctrl_out), SAVE :: o_rsu = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsu', 'SW upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rsu', 'SW upward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsd = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsd', 'SW downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rsd', 'SW downward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rlu = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rlu', 'LW upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rlu', 'LW upward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rld = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rld', 'LW downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rld', 'LW downward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsucs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsucs', 'SW CS upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rsucs', 'SW CS upward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsucsaf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsucsaf', 'SW CS clean (no aerosol) upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rsucsaf', 'SW CS clean (no aerosol) upward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsdcs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsdcs', 'SW CS downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rsdcs', 'SW CS downward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsdcsaf = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsdcsaf', 'SW CS clean (no aerosol) downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rsdcsaf', 'SW CS clean (no aerosol) downward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rlucs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rlucs', 'LW CS upward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rlucs', 'LW CS upward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rldcs = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rldcs', 'LW CS downward radiation', 'W m-2', (/ ('', i=1, 10) /))
+          'rldcs', 'LW CS downward radiation', 'W m-2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tnt = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tnt', 'Tendency of air temperature', 'K s-1', (/ ('', i=1, 10) /))
+          'tnt', 'Tendency of air temperature', 'K s-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tntc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tntc', 'Tendency of air temperature due to Moist Convection', 'K s-1', (/ ('', i=1, 10) /))
+          'tntc', 'Tendency of air temperature due to Moist Convection', 'K s-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tntr = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tntr', 'Air temperature tendency due to Radiative heating', 'K s-1', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_tntscpbl = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/),                  &
-    'tntscpbl', 'Air temperature tendency due to St cloud and precipitation and BL mixing', &
-      'K s-1', (/ ('', i=1, 10) /))
+          'tntr', 'Air temperature tendency due to Radiative heating', 'K s-1', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_tntscpbl = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
+          'tntscpbl', 'Air temperature tendency due to St cloud and precipitation and BL mixing', &
+          'K s-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tnhus = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tnhus', 'Tendency of specific humidity', 's-1', (/ ('', i=1, 10) /))
+          'tnhus', 'Tendency of specific humidity', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tnhusc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tnhusc', 'Tendency of specific humidity due to convection', 's-1', (/ ('', i=1, 10) /))
+          'tnhusc', 'Tendency of specific humidity due to convection', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_tnhusscpbl = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'tnhusscpbl', 'Tendency of Specific humidity due to ST cl, precip and BL mixing', 's-1', (/ ('', i=1, 10) /))
+          'tnhusscpbl', 'Tendency of Specific humidity due to ST cl, precip and BL mixing', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_evu = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'evu', 'Eddy viscosity coefficient for Momentum Variables', 'm2 s-1', (/ ('', i=1, 10) /))
+          'evu', 'Eddy viscosity coefficient for Momentum Variables', 'm2 s-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_h2o = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'h2o', 'Mass Fraction of Water', '1', (/ ('', i=1, 10) /))
+          'h2o', 'Mass Fraction of Water', '1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_mcd = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'mcd', 'Downdraft COnvective Mass Flux', 'kg/(m2*s)', (/ ('', i=1, 10) /))
+          'mcd', 'Downdraft COnvective Mass Flux', 'kg/(m2*s)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_dmc = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'dmc', 'Deep COnvective Mass Flux', 'kg/(m2*s)', (/ ('', i=1, 10) /))
+          'dmc', 'Deep COnvective Mass Flux', 'kg/(m2*s)', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ref_liq = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ref_liq', 'Effective radius of convective cloud liquid water particle', 'm', (/ ('', i=1, 10) /))
+          'ref_liq', 'Effective radius of convective cloud liquid water particle', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ref_ice = ctrl_out((/ 4, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'ref_ice', 'Effective radius of startiform cloud ice particle', 'm', (/ ('', i=1, 10) /))
+          'ref_ice', 'Effective radius of startiform cloud ice particle', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsut4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsut4co2', 'TOA Out SW in 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rsut4co2', 'TOA Out SW in 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rlut4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rlut4co2', 'TOA Out LW in 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rlut4co2', 'TOA Out LW in 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsutcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsutcs4co2', 'TOA Out CS SW in 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rsutcs4co2', 'TOA Out CS SW in 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rlutcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rlutcs4co2', 'TOA Out CS LW in 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rlutcs4co2', 'TOA Out CS LW in 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsu4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsu4co2', 'Upwelling SW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rsu4co2', 'Upwelling SW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rlu4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rlu4co2', 'Upwelling LW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rlu4co2', 'Upwelling LW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsucs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsucs4co2', 'Upwelling CS SW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rsucs4co2', 'Upwelling CS SW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rlucs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rlucs4co2', 'Upwelling CS LW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rlucs4co2', 'Upwelling CS LW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsd4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsd4co2', 'Downwelling SW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rsd4co2', 'Downwelling SW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rld4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rld4co2', 'Downwelling LW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rld4co2', 'Downwelling LW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rsdcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rsdcs4co2', 'Downwelling CS SW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rsdcs4co2', 'Downwelling CS SW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rldcs4co2 = ctrl_out((/ 5, 10, 10, 10, 10, 10, 11, 11, 11, 11/), &
-    'rldcs4co2', 'Downwelling CS LW 4xCO2 atmosphere', 'W/m2', (/ ('', i=1, 10) /))
+          'rldcs4co2', 'Downwelling CS LW 4xCO2 atmosphere', 'W/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_snowsrf = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
-    'snowsrf', 'Snow mass at surface', 'kg/m2', (/ ('', i=1, 10) /))
+          'snowsrf', 'Snow mass at surface', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsnow = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
-    'qsnow', 'Water contained in snow', 'kg/m2', (/ ('', i=1, 10) /))
+          'qsnow', 'Water contained in snow', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_snowhgt = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
-    'snowhgt', 'Snow height at surface', 'm', (/ ('', i=1, 10) /))
+          'snowhgt', 'Snow height at surface', 'm', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_toice = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
-    'to_ice', 'Snow passed to ice model', 'kg/m2', (/ ('', i=1, 10) /))
+          'to_ice', 'Snow passed to ice model', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_sissnow = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
-    'sissnow', 'Snow in snow model', 'kg/m2', (/ ('', i=1, 10) /))
+          'sissnow', 'Snow in snow model', 'kg/m2', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_runoff = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
-    'runoff', 'Run-off rate land ice', 'kg/m2/s', (/ ('', i=1, 10) /))
+          'runoff', 'Run-off rate land ice', 'kg/m2/s', (/ ('', i = 1, 10) /))
 #ifdef ISO
   TYPE(ctrl_out), SAVE :: o_runoff_diag = ctrl_out((/ 1, 1, 10, 1, 10, 10, 11, 11, 11, 11/), &
@@ -2108,158 +2104,156 @@
 #endif
   TYPE(ctrl_out), SAVE :: o_albslw3 = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'albslw3', 'Surface albedo LW3', '-', (/ ('', i=1, 10) /))
-
-!--aviation & supersaturation
+          'albslw3', 'Surface albedo LW3', '-', (/ ('', i = 1, 10) /))
+
+  !--aviation & supersaturation
   TYPE(ctrl_out), SAVE :: o_oclr = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'oclr', 'Clear sky total water', 'kg/kg', (/ ('', i=1, 10) /))
+          'oclr', 'Clear sky total water', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ocld = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'ocld', 'Cloudy sky total water', 'kg/kg', (/ ('', i=1, 10) /))
+          'ocld', 'Cloudy sky total water', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_oss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'oss', 'ISSR total water', 'kg/kg', (/ ('', i=1, 10) /))
+          'oss', 'ISSR total water', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_ovc = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'ovc', 'In-cloup vapor', 'kg/kg', (/ ('', i=1, 10) /))
+          'ovc', 'In-cloup vapor', 'kg/kg', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rnebclr = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'rnebclr', 'Clear sky fraction', '-', (/ ('', i=1, 10) /))
+          'rnebclr', 'Clear sky fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rnebss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'rnebss', 'ISSR fraction', '-', (/ ('', i=1, 10) /))
+          'rnebss', 'ISSR fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_rnebseri = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'rnebseri', 'Cloud fraction', '-', (/ ('', i=1, 10) /))
+          'rnebseri', 'Cloud fraction', '-', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_gammass = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'gammass', 'Gamma supersaturation', '', (/ ('', i=1, 10) /))
+          'gammass', 'Gamma supersaturation', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_N1_ss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'N1ss', 'N1', '', (/ ('', i=1, 10) /))
+          'N1ss', 'N1', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_N2_ss = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'N2ss', 'N2', '', (/ ('', i=1, 10) /))
+          'N2ss', 'N2', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_drnebsub = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'drnebsub', 'Cloud fraction change because of sublimation', 's-1', (/ ('', i=1, 10) /))
+          'drnebsub', 'Cloud fraction change because of sublimation', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_drnebcon = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'drnebcon', 'Cloud fraction change because of condensation', 's-1', (/ ('', i=1, 10) /))
+          'drnebcon', 'Cloud fraction change because of condensation', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_drnebtur = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'drnebtur', 'Cloud fraction change because of turbulence', 's-1', (/ ('', i=1, 10) /))
+          'drnebtur', 'Cloud fraction change because of turbulence', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_drnebavi = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'drnebavi', 'Cloud fraction change because of aviation', 's-1', (/ ('', i=1, 10) /))
+          'drnebavi', 'Cloud fraction change because of aviation', 's-1', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsatl = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'qsatl', 'Saturation with respect to liquid water', '', (/ ('', i=1, 10) /))
+          'qsatl', 'Saturation with respect to liquid water', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_qsats = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'qsats', 'Saturation with respect to solid water', '', (/ ('', i=1, 10) /))
+          'qsats', 'Saturation with respect to solid water', '', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flight_m = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'flightm', 'Flown meters', 'm/s/mesh', (/ ('', i=1, 10) /))
+          'flightm', 'Flown meters', 'm/s/mesh', (/ ('', i = 1, 10) /))
   TYPE(ctrl_out), SAVE :: o_flight_h2o = ctrl_out((/ 1, 1, 1, 1, 10, 10, 11, 11, 11, 11/), &
-    'flighth2o', 'H2O flight emission', 'kg H2O/s/mesh', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_Tcontr = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/),&
-    'Tcontr', 'Temperature threshold for contrail formation', 'K', (/ ('',i=1,10) /))
-  TYPE(ctrl_out), SAVE :: o_qcontr = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/),&
-    'qcontr', 'Specific humidity threshold for contrail formation','Pa', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_qcontr2 = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/),&
-    'qcontr2', 'Specific humidity threshold for contrail formation','kg/kg', (/ ('', i=1, 10) /))
-  TYPE(ctrl_out), SAVE :: o_fcontrN = ctrl_out((/ 2, 2, 2, 2, 2, 2, 11, 11, 11, 11/),&
-    'fcontrN', 'Fraction with non-persistent contrail in clear-sky', '-', (/ ('', i=1,10)/))
-  TYPE(ctrl_out), SAVE :: o_fcontrP = ctrl_out((/ 2, 2, 2, 2, 2, 2, 11, 11, 11, 11/),&
-    'fcontrP', 'Fraction with persistent contrail in ISSR', '-', (/ ('', i=1,10)/))
-
-!!!!!!!!!!!!! Sorties niveaux standards de pression NMC 
+          'flighth2o', 'H2O flight emission', 'kg H2O/s/mesh', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_Tcontr = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/), &
+          'Tcontr', 'Temperature threshold for contrail formation', 'K', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_qcontr = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/), &
+          'qcontr', 'Specific humidity threshold for contrail formation', 'Pa', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_qcontr2 = ctrl_out((/ 1, 1, 1, 1, 11, 11, 11, 11, 11, 11/), &
+          'qcontr2', 'Specific humidity threshold for contrail formation', 'kg/kg', (/ ('', i = 1, 10) /))
+  TYPE(ctrl_out), SAVE :: o_fcontrN = ctrl_out((/ 2, 2, 2, 2, 2, 2, 11, 11, 11, 11/), &
+          'fcontrN', 'Fraction with non-persistent contrail in clear-sky', '-', (/ ('', i = 1, 10)/))
+  TYPE(ctrl_out), SAVE :: o_fcontrP = ctrl_out((/ 2, 2, 2, 2, 2, 2, 11, 11, 11, 11/), &
+          'fcontrP', 'Fraction with persistent contrail in ISSR', '-', (/ ('', i = 1, 10)/))
+
+  !!!!!!!!!!!!! Sorties niveaux standards de pression NMC
   TYPE(ctrl_out), SAVE :: o_tnondef = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'tnondef', 'Undefined value of T', 'K', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'tnondef', 'Undefined value of T', 'K', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_ta = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'ta', 'Air temperature', 'K', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
-  TYPE(ctrl_out), SAVE :: o_zg  = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'zg', 'Geopotential height', 'm', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'ta', 'Air temperature', 'K', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+  TYPE(ctrl_out), SAVE :: o_zg = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
+          'zg', 'Geopotential height', 'm', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_hus = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'hus', 'Specific humidity', '1', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'hus', 'Specific humidity', '1', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_hur = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'hur', 'Relative humidity', '%', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'hur', 'Relative humidity', '%', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_ua = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'ua', 'Eastward wind', 'm s-1', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'ua', 'Eastward wind', 'm s-1', (/ "inst(X)", "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_va = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'va', 'Northward wind', 'm s-1', (/ ('', i=1, 10)/))
+          'va', 'Northward wind', 'm s-1', (/ ('', i = 1, 10)/))
   TYPE(ctrl_out), SAVE :: o_wap = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'wap', 'Lagrangian tendency of air pressure', 'Pa s-1', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'wap', 'Lagrangian tendency of air pressure', 'Pa s-1', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_psbg = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'psbg', 'Pressure sfce below ground', '%', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'psbg', 'Pressure sfce below ground', '%', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_tro3 = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'tro3', 'Ozone mole fraction', '1e-9', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'tro3', 'Ozone mole fraction', '1e-9', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_tro3_daylight = ctrl_out((/ 11, 11, 11, 11, 11, 11, 5, 5, 5, 11/), &
-       'tro3_daylight', 'Daylight ozone mole fraction', '1e-9', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'tro3_daylight', 'Daylight ozone mole fraction', '1e-9', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_uxv = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'uv', 'uv', 'm2/s2', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'uv', 'uv', 'm2/s2', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_vxq = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'vxq', 'vxq', 'm/s * (kg/kg)', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'vxq', 'vxq', 'm/s * (kg/kg)', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_vxT = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'vT', 'vT', 'mK/s', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'vT', 'vT', 'mK/s', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_wxq = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'wq', 'wq', '(Pa/s)*(kg/kg)', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'wq', 'wq', '(Pa/s)*(kg/kg)', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_vxphi = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'vphi', 'vphi', 'm2/s', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'vphi', 'vphi', 'm2/s', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_wxT = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'wT', 'wT', '"K*Pa/s', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /)) 
+          'wT', 'wT', '"K*Pa/s', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_uxu = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'u2', 'u2', 'm2/s2', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+          'u2', 'u2', 'm2/s2', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
   TYPE(ctrl_out), SAVE :: o_vxv = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'v2', 'v2', 'm2/s2', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
-   TYPE(ctrl_out), SAVE :: o_TxT = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
-       'T2', 'T2', 'K2', (/ "inst(X)", "inst(X)", "inst(X)", &
-       "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
-
-#ifdef CPP_Dust
-      INCLUDE 'spla_output_dat.h'
-#endif
-
-   type(ctrl_out), save:: o_delta_sst &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'delta_SST', &
-        "ocean-air interface temperature minus bulk SST", "K", '')
-
-   type(ctrl_out), save:: o_delta_sal &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'delta_sal', &
-        "ocean-air interface salinity minus bulk salinity", "ppt", '')
-
-   type(ctrl_out), save:: o_ds_ns &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dS_ns', &
-        "subskin salinity minus foundation salinity", "ppt", '')
-
-   type(ctrl_out), save:: o_dt_ns &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dT_ns', &
-        "subskin temperature minus foundation temperature", "K", '')
-
-   type(ctrl_out), save:: o_dter &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dTer', &
-        "ocean-air interface temperature minus sub-skin temperature", "K", '')
-
-   type(ctrl_out), save:: o_dser &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dSer', &
-        "ocean-air interface salinity minus sub-skin salinity", "ppt", '')
-
-   type(ctrl_out), save:: o_tkt &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'tkt', &
-        "thickness of thermal microlayer", "m", '')
-
-   type(ctrl_out), save:: o_tks &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'tks', &
-        "thickness of salinity microlayer", "m", '')
-
-   type(ctrl_out), save:: o_taur &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'taur', &
-        "momentum flux due to rain", "Pa", '')
-
-   type(ctrl_out), save:: o_sss &
-        = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'SSS', &
-        "bulk sea-surface salinity", "ppt", '')
+          'v2', 'v2', 'm2/s2', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+  TYPE(ctrl_out), SAVE :: o_TxT = ctrl_out((/ 11, 11, 11, 11, 11, 11, 6, 6, 6, 11/), &
+          'T2', 'T2', 'K2', (/ "inst(X)", "inst(X)", "inst(X)", &
+                  "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)", "inst(X)"  /))
+
+  INCLUDE 'spla_output_dat.h'
+
+  type(ctrl_out), save :: o_delta_sst &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'delta_SST', &
+                  "ocean-air interface temperature minus bulk SST", "K", '')
+
+  type(ctrl_out), save :: o_delta_sal &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'delta_sal', &
+                  "ocean-air interface salinity minus bulk salinity", "ppt", '')
+
+  type(ctrl_out), save :: o_ds_ns &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dS_ns', &
+                  "subskin salinity minus foundation salinity", "ppt", '')
+
+  type(ctrl_out), save :: o_dt_ns &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dT_ns', &
+                  "subskin temperature minus foundation temperature", "K", '')
+
+  type(ctrl_out), save :: o_dter &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dTer', &
+                  "ocean-air interface temperature minus sub-skin temperature", "K", '')
+
+  type(ctrl_out), save :: o_dser &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'dSer', &
+                  "ocean-air interface salinity minus sub-skin salinity", "ppt", '')
+
+  type(ctrl_out), save :: o_tkt &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'tkt', &
+                  "thickness of thermal microlayer", "m", '')
+
+  type(ctrl_out), save :: o_tks &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'tks', &
+                  "thickness of salinity microlayer", "m", '')
+
+  type(ctrl_out), save :: o_taur &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'taur', &
+                  "momentum flux due to rain", "Pa", '')
+
+  type(ctrl_out), save :: o_sss &
+          = ctrl_out([1, 10, 10, 1, 10, 10, 11, 11, 11, 11], 'SSS', &
+                  "bulk sea-surface salinity", "ppt", '')
 
 END MODULE phys_output_ctrlout_mod
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_mod.F90	(revision 5099)
@@ -1,4 +1,3 @@
 ! $Id: phys_output_mod.F90 3792 2021-01-04 17:01:25Z evignon $
-!
 
 MODULE phys_output_mod 
@@ -307,5 +306,5 @@
 ! afin d avoir une seule sortie mensuelle par mois lorsque l on tourne 
 ! par annee (IM).
-!
+
      idayref = day_ref
      IF (klon_glo==1) THEN
@@ -411,5 +410,5 @@
           spectband(ISW)=(wn1_sun(ISW)+wn2_sun(ISW))/2
         ENDDO
-!
+
 !!! ajout axe vertical spectband : solar band number
         CALL wxios_add_vaxis("spectband", NSW, spectband, positif='down')
@@ -630,5 +629,5 @@
 
     ipos=scan(str,'0123456789.',.TRUE.)
-    !  
+
     il=len_trim(str)
     WRITE(lunout,*) "ipos = ", ipos
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_var_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_var_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phys_output_var_mod.F90	(revision 5099)
@@ -1,3 +1,3 @@
-!
+
 ! phys_local_var_mod.F90 1327 2010-03-17 15:33:56Z idelkadi $
 
@@ -7,6 +7,6 @@
   ! Variables outputs pour les ecritures des sorties
   !======================================================================
-  !
-  !
+
+
   !======================================================================
   ! Declaration des variables
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5099)
@@ -1,5 +1,5 @@
-!
+
 ! $Id: physiq_mod.F90 3908 2021-05-20 07:11:13Z idelkadi $
-!
+
 !#define IO_DEBUG
 MODULE physiq_mod
@@ -107,19 +107,13 @@
     USE paramLMDZ_phy_mod
 
-
-    !USE cmp_seri_mod
-!    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
-!  &      fl_ebil, fl_cor_ebil
-
-!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
-!
-!
-#ifdef CPP_Dust
-    USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
+        USE phytracr_spl_mod, ONLY: phytracr_spl, phytracr_spl_out_init
     USE phys_output_write_spl_mod
-#else
     USE phytrac_mod, ONLY : phytrac_init, phytrac
     USE phys_output_write_mod
-#endif
+
+    USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DUST
+
+!!!!!!!!!!!!!!!!!! "USE" section for CPP keys !!!!!!!!!!!!!!!!!!!!!!!!
+
 
 #ifdef REPROBUS
@@ -178,6 +172,5 @@
 #endif
 
-!
-!
+
 !!!!!!!!!!!!!!!!!!  END "USE" for CPP keys !!!!!!!!!!!!!!!!!!!!!!
 
@@ -201,5 +194,5 @@
 !       d_t_ajs_w,d_q_ajs_w, &
 !       d_t_ajs_x,d_q_ajs_x, &
-       !
+
        d_t_eva,d_q_eva,d_ql_eva,d_qi_eva, &
        d_qx_eva, &
@@ -208,12 +201,12 @@
        d_t_lscth,d_q_lscth, &
        plul_st,plul_th, &
-       !
+
        d_t_vdf,d_q_vdf, d_qbs_vdf, d_u_vdf,d_v_vdf,d_t_diss, &
        d_t_vdf_x, d_t_vdf_w, &
        d_q_vdf_x, d_q_vdf_w, &
        d_ts, &
-       !
+
        d_t_bsss,d_q_bsss,d_qbs_bsss, &
-       !
+
 !       d_t_oli,d_u_oli,d_v_oli, &
        d_t_oro,d_u_oro,d_v_oro, &
@@ -221,5 +214,5 @@
        d_t_lif,d_u_lif,d_v_lif, &
        d_t_ec, &
-       !
+
        du_gwd_hines,dv_gwd_hines,d_t_hin, &
        dv_gwd_rando,dv_gwd_front, &
@@ -234,5 +227,5 @@
        ZLWFT0_i,ZSWFT0_i,ZFLDN0,  &
        ZFLUP0,ZFSDN0,ZFSUP0,      &
-       !
+
        topswad_aero,solswad_aero,   &
        topswai_aero,solswai_aero,   &
@@ -253,5 +246,5 @@
        toplwai_aero_s2, sollwai_aero_s2,   &
        toplwad0_aero_s2, sollwad0_aero_s2, &
-       !
+
        topsw_aero,solsw_aero,       &
        topsw0_aero,solsw0_aero,     &
@@ -259,5 +252,5 @@
        tausum_aero,tau3d_aero,      &
        drytausum_aero,              &
-       !
+
        !variables CFMIP2/CMIP5
        topswad_aerop, solswad_aerop,   &
@@ -282,9 +275,9 @@
        toplwai_aero_s2, sollwai_aero_s2,   &
        toplwad0_aero_s2, sollwad0_aero_s2, &
-       !
+
        ptstar, pt0, slp, &
-       !
+
        bils, &
-       !
+
        cldh, cldl,cldm, cldq, cldt,      &
        JrNt,                             &
@@ -297,8 +290,8 @@
        zt2m_min_mon, zt2m_max_mon,   &         ! pour calcul_divers.h
        t2m_min_mon, t2m_max_mon,  &            ! pour calcul_divers.h
-       !
+
        s_pblh_x, s_pblh_w, &
        s_lcl_x, s_lcl_w,   &
-       !
+
        slab_wfbils, tpot, tpote,               &
        ue, uq, ve, vq, zxffonte,               &
@@ -309,8 +302,8 @@
        delta_qsurf,                            &
        rain_lsc, rain_num,                     &
-       !
+
        sens_x, sens_w, &
        zxfluxlat_x, zxfluxlat_w, &
-       !
+
        pbl_tke_input, pbl_eps, l_mix, wprime,&
        t_therm, q_therm, u_therm, v_therm, &
@@ -318,5 +311,5 @@
        cdragm_x, cdragm_w, &
        kh, kh_x, kh_w, &
-       !
+
        wake_k, &
        alp_wake, & 
@@ -332,5 +325,5 @@
 !!!       d_s_vdf, d_dens_a_vdf, d_dens_vdf, & ! due to vertical diffusion
 !!!       d_s_the, d_dens_a_the, d_dens_the, & ! due to thermals
-       !                                  
+
        ptconv, ratqsc, &
        wbeff, convoccur, zmax_th, &
@@ -341,5 +334,5 @@
        proba_notrig, random_notrig,  &
 !!       cv_gen,  &  !moved to phys_state_var_mod
-       !
+
        dnwd0,  &
        omega,  &
@@ -361,5 +354,5 @@
        epmlmMm, eplaMm, &
        sij, &
-       !
+
        rneblsvol, &
        pfraclr, pfracld, cldfraliq, sigma2_icefracturb, mean_icefracturb,  &
@@ -375,5 +368,5 @@
        zphi, zx_rh, zx_rhl, zx_rhi,  &
        pmfd, pmfu,  &
-       !
+
        t2m, fluxlat,  &
        fsollw, evap_pot,  &
@@ -381,12 +374,12 @@
        prfl, psfl,bsfl, fraca, Vprecip,  &
        zw2,  &
-       !
+
        fluxu, fluxv,  &
        fluxt,  &
-       !
+
        uwriteSTD, vwriteSTD, &                !pour calcul_STDlev.h
        wwriteSTD, phiwriteSTD, &              !pour calcul_STDlev.h
        qwriteSTD, twriteSTD, rhwriteSTD, &    !pour calcul_STDlev.h
-       ! 
+
        beta_prec,  &
        rneb,  &
@@ -420,5 +413,5 @@
 #endif
 #endif
-       !
+
        USE phys_local_var_mod, ONLY: zfice, dNovrN, ptconv
        USE phys_output_var_mod, ONLY: scdnc, cldncl, reffclwtop, lcc, reffclws, &
@@ -529,21 +522,21 @@
     SAVE ok_journe
     !$OMP THREADPRIVATE(ok_journe)
-    !
+
     LOGICAL ok_mensuel ! sortir le fichier mensuel
     SAVE ok_mensuel
     !$OMP THREADPRIVATE(ok_mensuel)
-    !
+
     LOGICAL ok_instan ! sortir le fichier instantane
     SAVE ok_instan
     !$OMP THREADPRIVATE(ok_instan)
-    !
+
     LOGICAL ok_LES ! sortir le fichier LES 
     SAVE ok_LES                            
     !$OMP THREADPRIVATE(ok_LES)                  
-    !
+
     LOGICAL callstats ! sortir le fichier stats 
     SAVE callstats                            
     !$OMP THREADPRIVATE(callstats)                  
-    !
+
     LOGICAL ok_region ! sortir le fichier regional
     PARAMETER (ok_region=.FALSE.)
@@ -567,5 +560,5 @@
 
     !======================================================================
-    !
+
     ! indices de traceurs eau vapeur, liquide, glace, fraction nuageuse LS (optional), blowing snow (optional)
 !    INTEGER,SAVE :: ivap, iliq, isol, irneb, ibs
@@ -577,8 +570,8 @@
     INTEGER,SAVE :: irneb, ibs
 !$OMP THREADPRIVATE(irneb, ibs)
-!
-    !
+
+
     ! Variables argument:
-    !
+
     INTEGER nlon
     INTEGER nlev
@@ -634,19 +627,19 @@
 
     ! variables a une pression donnee
-    !
+
     include "declare_STDlev.h"
-    !
-    !
+
+
     include "radepsi.h"
     include "radopt.h"
-    !
-    !
+
+
     INTEGER n
     !ym      INTEGER npoints
     !ym      PARAMETER(npoints=klon) 
-    !
+
     INTEGER nregISCtot
     PARAMETER(nregISCtot=1) 
-    !
+
     ! imin_debut, nbpti, jmin_debut, nbptj : parametres pour sorties
     ! sur 1 region rectangulaire y compris pour 1 point
@@ -661,5 +654,5 @@
     PARAMETER(region='3d')
     LOGICAL ok_hf
-    !
+
     SAVE ok_hf
     !$OMP THREADPRIVATE(ok_hf)
@@ -668,5 +661,5 @@
     REAL, SAVE :: clesphy0(longcles)
     !$OMP THREADPRIVATE(clesphy0)
-    !
+
     ! Variables propres a la physique
     INTEGER, SAVE :: itap         ! compteur pour la physique
@@ -675,16 +668,15 @@
     INTEGER, SAVE :: abortphy=0   ! Reprere si on doit arreter en fin de phys
     !$OMP THREADPRIVATE(abortphy)
-    !
+
     REAL,SAVE ::  solarlong0
     !$OMP THREADPRIVATE(solarlong0)
 
-    !
     !  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
-    !
+
     !IM 141004     REAL zulow(klon),zvlow(klon),zustr(klon), zvstr(klon)
     REAL zulow(klon),zvlow(klon)
-    !
+
     INTEGER igwd,idx(klon),itest(klon)
-    !
+
     !      REAL,allocatable,save :: run_off_lic_0(:)
     ! !$OMP THREADPRIVATE(run_off_lic_0)
@@ -692,10 +684,10 @@
     !KE43
     ! Variables liees a la convection de K. Emanuel (sb):
-    !
+
     REAL, SAVE :: bas, top             ! cloud base and top levels
     !$OMP THREADPRIVATE(bas, top)
     !------------------------------------------------------------------
     ! Upmost level reached by deep convection and related variable (jyg)
-    !
+
 !    INTEGER izero
     INTEGER k_upper_cv
@@ -705,5 +697,5 @@
     SAVE Ncvpaseq1
     !$OMP THREADPRIVATE(Ncvpaseq1)
-    !
+
     !==========================================================================
     !CR04.12.07: on ajoute les nouvelles variables du nouveau schema
@@ -713,10 +705,10 @@
 !!    REAL mipsh(klon,klev)  ! mass flux shed by the adiab ascent at each level
 !!      Moved to phys_state_var_mod
-    !
+
     REAL wape_prescr, fip_prescr
     INTEGER it_wape_prescr
     SAVE wape_prescr, fip_prescr, it_wape_prescr
     !$OMP THREADPRIVATE(wape_prescr, fip_prescr, it_wape_prescr)
-    !
+
     ! variables supplementaires de concvl
     REAL Tconv(klon,klev)
@@ -764,7 +756,7 @@
     REAL wake_dp_deltomg(klon,klev) ! Wake : gradient vertical de wake_omg
     REAL wake_spread(klon,klev)     ! spreading term in wake_delt
-    !
+
     !pourquoi y'a pas de save??
-    !
+
 !!!    INTEGER, SAVE, DIMENSION(klon)   :: wake_k
 !!!    !$OMP THREADPRIVATE(wake_k) 
@@ -773,5 +765,5 @@
     REAL xt_w(ntraciso,klon,klev)
 #endif
-    !
+
     !jyg<
     !cc      REAL wake_pe(klon)              ! Wake potential energy - WAPE 
@@ -781,6 +773,6 @@
     REAL wake_gfl(klon)             ! Gust Front Length
 !!!    REAL wake_dens(klon)         ! moved to phys_state_var_mod
-    !
-    !
+
+
     REAL dt_dwn(klon,klev)
     REAL dq_dwn(klon,klev)
@@ -808,6 +800,5 @@
     REAL d_xt_adjwk(ntraciso,klon,klev)
 #endif
-  
-    !
+
     !RR:fin declarations poches froides
     !==========================================================================
@@ -858,11 +849,11 @@
 
     ! Variables locales pour la couche limite (al1):
-    !
+
     !Al1      REAL pblh(klon)           ! Hauteur de couche limite
     !Al1      SAVE pblh
     !34EK
-    !
+
     ! Variables locales:
-    !
+
     !AA
     !AA  Pour phytrac 
@@ -881,5 +872,5 @@
     !IM cf FH pour Tiedtke 080604
     REAL rain_tiedtke(klon),snow_tiedtke(klon)
-    !
+
     !IM 050204 END
     REAL devap(klon) ! evaporation et sa derivee
@@ -888,8 +879,8 @@
     REAL dxtevap(ntraciso,klon) 
 #endif
-    !
+
     ! Conditions aux limites
-    !
-    !
+
+
     REAL :: day_since_equinox
     ! Date de l'equinoxe de printemps
@@ -899,5 +890,4 @@
     LOGICAL, parameter :: new_orbit = .TRUE.
 
-    !
     INTEGER lmt_pas
     SAVE lmt_pas                ! frequence de mise a jour
@@ -914,7 +904,7 @@
     !$OMP THREADPRIVATE(itapm1)
     !======================================================================
-    !
+
     ! Declaration des procedures appelees
-    !
+
     EXTERNAL angle     ! calculer angle zenithal du soleil
     EXTERNAL alboc     ! calculer l'albedo sur ocean
@@ -937,19 +927,19 @@
     ! moyenne globale d'1 var ponderee par l'aire de la maille (moyglo_pondaire)
     ! par la masse/airetot (moyglo_pondaima) et la vraie masse (moyglo_pondmass)
-    !
-    !
+
+
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     ! Local variables
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-    !
+
 !    REAL rhcl(klon,klev)    ! humiditi relative ciel clair
     REAL dialiq(klon,klev)  ! eau liquide nuageuse
     REAL diafra(klon,klev)  ! fraction nuageuse
     REAL radocond(klon,klev)  ! eau condensee nuageuse
-    !
+
     !XXX PB 
     REAL fluxq(klon,klev, nbsrf)   ! flux turbulent d'humidite
     REAL fluxqbs(klon,klev, nbsrf)   ! flux turbulent de neige soufflee
-    !
+
     !FC    REAL zxfluxt(klon, klev)
     !FC    REAL zxfluxq(klon, klev)
@@ -967,26 +957,26 @@
     !ym      SAVE  sollwdownclr, toplwdown, toplwdownclr
     !ym      SAVE  topsw0,toplw0,solsw0,sollw0, heat0, cool0
-    !
+
     INTEGER itaprad
     SAVE itaprad
     !$OMP THREADPRIVATE(itaprad)
-    !
+
     REAL conv_q(klon,klev) ! convergence de l'humidite (kg/kg/s)
     REAL conv_t(klon,klev) ! convergence de la temperature(K/s)
-    !
+
     REAL zsav_tsol(klon)
-    !
+
     REAL dist, rmu0(klon), fract(klon)
     REAL zrmu0(klon), zfract(klon)
     REAL zdtime, zdtime1, zdtime2, zlongi
-    !
+
     REAL qcheck
     REAL z_avant(klon), z_apres(klon), z_factor(klon)
     LOGICAL zx_ajustq
-    !
+
     REAL za
     REAL zx_t, zx_qs, zdelta, zcor
     real zqsat(klon,klev)
-    !
+
     INTEGER i, k, iq, nsrf, l, itr
 #ifdef ISO
@@ -997,5 +987,5 @@
     real wake_deltaq_prec(klon,klev)  
 #endif
-    !
+
     REAL t_coup
     PARAMETER (t_coup=234.0)
@@ -1004,5 +994,5 @@
     !ym      REAL zx_relief(iim,jjmp1)
     !ym      REAL zx_aire(iim,jjmp1)
-    !
+
     ! Grandeurs de sorties
     REAL s_capCL(klon)
@@ -1016,5 +1006,5 @@
     !ym      SAVE  
     !ym      SAVE  
-    !
+
     INTEGER itapcv, itapwk
     SAVE itapcv, itapwk
@@ -1039,7 +1029,7 @@
     ! --
     !34EK
-    !
+
     ! Variables du changement
-    !
+
     ! con: convection
     ! lsc: condensation a grande echelle (Large-Scale-Condensation)
@@ -1047,5 +1037,5 @@
     ! eva: evaporation de l'eau liquide nuageuse
     ! vdf: couche limite (Vertical DiFfusion)
-    !
+
     ! tendance nulles
     REAL, dimension(klon,klev):: du0, dv0, dt0, dq0, dql0, dqi0, dqbs0
@@ -1060,5 +1050,5 @@
     REAL, DIMENSION(ntraciso,klon,klev)  :: d_xt_ch4_dtime
 #endif
-    !
+
     ! Flag pour pouvoir ne pas ajouter les tendances. 
     ! Par defaut, les tendances doivente etre ajoutees et
@@ -1069,10 +1059,10 @@
     INTEGER :: flag_inhib_tend = 0 !  0 is the default value
 !!    INTEGER :: flag_inhib_tend = 2
-    !
+
     ! Logical switch to a bug : reseting to 0 convective variables at the 
     ! begining of physiq.
     LOGICAL, SAVE :: ok_bug_cv_trac = .TRUE.
     !$OMP THREADPRIVATE(ok_bug_cv_trac)
-    !
+
     ! Logical switch to a bug : changing wake_deltat when thermals are active
     ! even when there are no wakes.
@@ -1084,5 +1074,5 @@
     LOGICAL, SAVE :: ok_bug_ajs_cv = .TRUE.
     !$OMP THREADPRIVATE(ok_bug_ajs_cv)
-    !
+
     !********************************************************
     !     declarations
@@ -1090,9 +1080,9 @@
     !********************************************************
     !IM 081204 END
-    !
+
     REAL pen_u(klon,klev), pen_d(klon,klev)
     REAL pde_u(klon,klev), pde_d(klon,klev)
     INTEGER kcbot(klon), kctop(klon), kdtop(klon)
-    !
+
     REAL ratqsbas,ratqshaut,tau_ratqs
     SAVE ratqsbas,ratqshaut,tau_ratqs
@@ -1117,15 +1107,15 @@
     REAL zrel_oro(klon)
     !IM cf. AM 081204 END
-    !
+
     ! Variables liees a l'ecriture de la bande histoire physique
-    !
+
     !======================================================================
-    !
-    !
+
+
 !JLD    integer itau_w   ! pas de temps ecriture = itap + itau_phy
-    !
-    !
+
+
     ! Variables locales pour effectuer les appels en serie
-    !
+
     !IM RH a 2m (la surface)
     REAL Lheat
@@ -1134,8 +1124,8 @@
     PARAMETER    ( length = 100 )
     REAL tabcntr0( length       )
-    !
+
 !JLD    INTEGER ndex2d(nbp_lon*nbp_lat)
     !IM
-    !
+
     !IM AMIP2 BEG
 !JLD    REAL moyglo, mountor
@@ -1158,5 +1148,5 @@
     !ym      REAL zm_wo(jjmp1, klev)
     !IM AMIP2 END
-    !
+
     REAL zx_tmp_fi2d(klon)      ! variable temporaire grille physique
     REAL zx_tmp_fi3d(klon,klev) ! variable temporaire pour champs 3D 
@@ -1164,19 +1154,19 @@
 !JLD    REAL zx_lon(nbp_lon,nbp_lat)
 !JLD    REAL zx_lat(nbp_lon,nbp_lat)
-    !
+
     INTEGER nid_ctesGCM
     SAVE nid_ctesGCM
     !$OMP THREADPRIVATE(nid_ctesGCM)
-    !
+
     !IM 280405 BEG
     !  INTEGER nid_bilKPins, nid_bilKPave
     !  SAVE nid_bilKPins, nid_bilKPave
     !  !$OMP THREADPRIVATE(nid_bilKPins, nid_bilKPave)
-    !
+
     REAL ve_lay(klon,klev) ! transport meri. de l'energie a chaque niveau vert.
     REAL vq_lay(klon,klev) ! transport meri. de l'eau a chaque niveau vert.
     REAL ue_lay(klon,klev) ! transport zonal de l'energie a chaque niveau vert.
     REAL uq_lay(klon,klev) ! transport zonal de l'eau a chaque niveau vert.
-    !
+
 !JLD    REAL zjulian
 !JLD    SAVE zjulian
@@ -1240,9 +1230,9 @@
     LOGICAL, SAVE :: flag_bc_internal_mixture
     !$OMP THREADPRIVATE(flag_bc_internal_mixture)
-    !
+
     !--STRAT AEROSOL
     INTEGER, SAVE :: flag_aerosol_strat
     !$OMP THREADPRIVATE(flag_aerosol_strat)
-    !
+
     !--INTERACTIVE AEROSOL FEEDBACK ON RADIATION
     LOGICAL, SAVE :: flag_aer_feedback
@@ -1250,7 +1240,7 @@
 
     !c-fin STRAT AEROSOL
-    !
+
     ! Declaration des constantes et des fonctions thermodynamiques
-    !
+
     LOGICAL,SAVE :: first=.TRUE.
     !$OMP THREADPRIVATE(first)
@@ -1284,5 +1274,5 @@
     include "compbl.h"
     !IM 100106 END : pouvoir sortir les ctes de la physique
-    !
+
     ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     ! Declarations pour Simulateur COSP
@@ -1344,5 +1334,5 @@
     REAL, SAVE :: betalwoff 
     !$OMP THREADPRIVATE(betalwoff)
-!
+
     INTEGER :: nbtr_tmp ! Number of tracer inside concvl
     REAL, dimension(klon,klev) :: sh_in ! Specific humidity entering in phytrac
@@ -1417,5 +1407,5 @@
     !======================================================================
     ! Gestion calendrier : mise a jour du module phys_cal_mod
-    !
+
     pdtphys=pdtphys_
     CALL update_time(pdtphys)
@@ -1475,5 +1465,5 @@
        WRITE(lunout,*) '================================================='
        CALL phys_local_var_init
-       !
+
        !     appel a la lecture du run.def physique
        CALL conf_phys(ok_journe, ok_mensuel, &
@@ -1510,5 +1500,5 @@
 
        print*, '================================================='
-       !
+
        !CR: check sur le nb de traceurs de l eau
        IF ((iflag_ice_thermo>0).and.(nqo==2)) THEN
@@ -1629,10 +1619,10 @@
        iflag_phytrac = 1 ! by default we do want to call phytrac
        CALL getin_p('iflag_phytrac',iflag_phytrac)
-#ifdef CPP_Dust
+IF (CPPKEY_DUST) THEN
        IF (iflag_phytrac.EQ.0) THEN 
          WRITE(lunout,*) 'In order to run with SPLA, iflag_phytrac will be forced to 1'
          iflag_phytrac = 1
        ENDIF
-#endif
+END IF
        nvm_lmdz = 13
        CALL getin_p('NVM',nvm_lmdz)
@@ -1672,11 +1662,10 @@
     !======================================================================
     ! Gestion calendrier : mise a jour du module phys_cal_mod
-    !
+
     !     CALL phys_cal_update(jD_cur,jH_cur)
 
-    !
     ! Si c'est le debut, il faut initialiser plusieurs choses
     !          ********
-    !
+
     IF (debut) THEN
        !rv CRinitialisation de wght_th et lalim_conv pour la
@@ -1732,17 +1721,16 @@
        clwcon(:,:) = 0.0
 
-       !
        print*,'iflag_coupl,iflag_clos,iflag_wake', &
             iflag_coupl,iflag_clos,iflag_wake
        print*,'iflag_cycle_diurne', iflag_cycle_diurne
-       !
+
        IF (iflag_con==2.AND.iflag_cld_th>-1) THEN
           abort_message = 'Tiedtke needs iflag_cld_th=-2 or -1'
           CALL abort_physic (modname,abort_message,1)
        ENDIF
-       !
-       !
+
+
        ! Initialiser les compteurs:
-       !
+
        itap    = 0
        itaprad = 0
@@ -1864,5 +1852,4 @@
              ENDIF
 
-             !
              ALLOCATE(tabCFMIP(nCFMIP))
              ALLOCATE(lonCFMIP(nCFMIP), latCFMIP(nCFMIP))
@@ -1870,11 +1857,11 @@
              ALLOCATE(lonGCM(nCFMIP), latGCM(nCFMIP))
              ALLOCATE(iGCM(nCFMIP), jGCM(nCFMIP))
-             !
+
              ! lecture des nCFMIP stations CFMIP, de leur numero 
              ! et des coordonnees geographiques lonCFMIP, latCFMIP
-             !
+
              CALL read_CFMIP_point_locations(nCFMIP, tabCFMIP,  &
                   lonCFMIP, latCFMIP)
-             !
+
              ! identification des
              ! 1) coordonnees lonGCM, latGCM des points CFMIP dans la
@@ -1883,8 +1870,8 @@
              ! klon points
              ! 3) indices iGCM, jGCM de la grille physique 2d
-             !
+
              CALL LMDZ_CFMIP_point_locations(nCFMIP, lonCFMIP, latCFMIP, &
                   tabijGCM, lonGCM, latGCM, iGCM, jGCM)
-             !
+
           ELSE
              ALLOCATE(tabijGCM(0))
@@ -1932,5 +1919,4 @@
        date0 = jD_ref 
        WRITE(*,*) 'physiq date0 : ',date0
-       !
 
 !       CALL create_climoz(read_climoz)
@@ -1996,6 +1982,5 @@
       ENDIF
 
-       !
-       !
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        ! Nouvelle initialisation pour le rayonnement RRTM
@@ -2038,11 +2023,10 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-       !
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write*
-       !
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-#ifdef CPP_Dust
+IF (CPPKEY_DUST) THEN
        ! Quand on utilise SPLA, on force iflag_phytrac=1
        CALL phytracr_spl_out_init()
@@ -2053,5 +2037,5 @@
                                 ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
                                 flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#else
+ELSE
        ! phys_output_write écrit des variables traceurs seulement si iflag_phytrac == 1 
        ! donc seulement dans ce cas on doit appeler phytrac_init()
@@ -2065,5 +2049,5 @@
                               ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
                               flag_aerosol, flag_aerosol_strat, ok_cdnc, t, u1, v1)
-#endif
+END IF
 
 
@@ -2106,7 +2090,7 @@
 
        ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-       !
+
        ! on remet le calendrier a zero
-       !
+
        IF (raz_date == 1) THEN
           itau_phy = 0
@@ -2132,5 +2116,5 @@
           CALL abort_physic(modname,abort_message,1)
        ENDIF
-       !
+
        IF (phys_tstep*REAL(radpas)>21600..AND.iflag_cycle_diurne>=1) THEN
           WRITE(lunout,*)'Nbre d appels au rayonnement insuffisant'
@@ -2142,10 +2126,10 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        ! Initialisation pour la convection de K.E. et pour les poches froides
-       !
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
        WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con
        WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl
-       !
+
        !KE43
        ! Initialisation pour la convection de K.E. (sb):
@@ -2178,5 +2162,5 @@
              ! 11/09/06 rajout initialisation ALE et ALP du wake et PBL(YU)
              !        print*,'apres ini_wake iflag_cld_th=', iflag_cld_th
-             !
+
              ! Initialize tendencies of wake state variables (for some flag values
              ! they are not computed).
@@ -2211,5 +2195,5 @@
        !   ALLOCATE(iGCM(0), jGCM(0))
        ENDIF  !  (iflag_con.GE.3)
-       !
+
        DO i=1,klon
           rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
@@ -2243,10 +2227,10 @@
           ENDDO
        ENDIF
-       !
-       !
+
+
        lmt_pas = NINT(86400./phys_tstep * 1.0)   ! tous les jours
        WRITE(lunout,*)'La frequence de lecture surface est de ',  &
             lmt_pas
-       !
+
        capemaxcels = 't_max(X)'
        t2mincels = 't_min(X)'
@@ -2257,5 +2241,5 @@
        write(lunout,*)'AVANT HIST IFLAG_CON=',iflag_con
        !IM cf. AM 081204 END
-       !
+
        !=============================================================
        !   Initialisation des sorties
@@ -2274,5 +2258,5 @@
          IF (is_omp_master) CALL xios_get_field_attr("temp",default_value=missing_val)
          CALL bcast_omp(missing_val)
-       ! 
+
        ! Now we activate some double radiation call flags only if some
        ! diagnostics are requested, otherwise there is no point in doing this
@@ -2299,5 +2283,5 @@
              IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE. 
            ENDDO
-           !
+
           !--setting up ok_4xCO2atm to TRUE in XIOS case 
            IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. & 
@@ -2315,11 +2299,11 @@
            CALL bcast(ok_4xCO2atm)
          ENDIF !using_xios
-       !
+
        CALL printflag( tabcntr0,radpas,ok_journe, &
             ok_instan, ok_region )
-       !
-       !
+
+
        ! Prescrire l'ozone dans l'atmosphere
-       !
+
        !c         DO i = 1, klon
        !c         DO k = 1, klev
@@ -2327,5 +2311,5 @@
        !c         ENDDO
        !c         ENDDO
-       !
+
        IF (ANY(type_trac == ['inca','inco'])) THEN ! ModThL
 IF (CPPKEY_INCA) THEN
@@ -2402,6 +2386,4 @@
           piz_aero(:,:,:,:) = init_pizinca
           cg_aero(:,:,:,:) = init_cginca
-!          
-
 
           CALL VTe(VTinca)
@@ -2409,5 +2391,5 @@
 END IF
        ENDIF
-       !
+
        IF (type_trac == 'repr') THEN
 #ifdef REPROBUS
@@ -2429,5 +2411,5 @@
            press_edg_climoz, time_climoz, ok_daily_climoz, adjust_tropopause)
        !$omp end single
-       !
+
        !IM betaCRF
        pfree=70000. !Pa
@@ -2489,5 +2471,5 @@
       ENDIF
       WRITE(*,*)'ok_lwoff=',ok_lwoff
-      ! 
+
       !lwoff=y to begin only sollw and sollwdown are set up to CS values
       sollw = sollw + betalwoff * (sollw0 - sollw)
@@ -2498,10 +2480,10 @@
 
     ENDIF
-    !
+
     !   ****************     Fin  de   IF ( debut  )   ***************
-    !
-    !
+
+
     ! Incrementer le compteur de la physique
-    !
+
     itap   = itap + 1
     IF (is_master .OR. prt_level > 9) THEN
@@ -2512,10 +2494,10 @@
       ENDIF
     ENDIF
-    !
-    !
+
+
     ! Update fraction of the sub-surfaces (pctsrf) and 
     ! initialize, where a new fraction has appeared, all variables depending 
     ! on the surface fraction.
-    !
+
     CALL change_srf_frac(itap, phys_tstep, days_elapsed+1,  &
          pctsrf, fevap, z0m, z0h, agesno,              &
@@ -2552,7 +2534,7 @@
     ddens0(:) = 0.
     wkoccur1(:)=1
-    !
+
     ! Mettre a zero des variables de sortie (pour securite)
-    !
+
     DO i = 1, klon
        d_ps(i) = 0.0
@@ -2574,5 +2556,5 @@
     beta_prec_fisrt(:,:)=0.
     beta_prec(:,:)=0.
-    !
+
     !   Output variables from the convective scheme should not be set to 0 
     !   since convection is not always called at every time step.
@@ -2591,7 +2573,7 @@
       ! RomP <<<
     ENDIF
-    !
+
     ! Ne pas affecter les valeurs entrees de u, v, h, et q
-    !
+
     DO k = 1, klev
        DO i = 1, klon
@@ -2655,5 +2637,5 @@
 #endif
 ! #ifdef ISO
-    !
+
     !--OB mass fixer 
     IF (mass_fixer) THEN
@@ -2703,5 +2685,5 @@
        tr_seri(:,:,strIdx(tracers(:)%name,addPhase('H2O','g'))) = 0.0
     ENDIF
-!
+
 ! Temporary solutions adressing ticket #104 and the non initialisation of tr_ancien
 ! LF
@@ -2715,5 +2697,5 @@
        enddo
     ENDIF
-    !
+
     DO i = 1, klon
        ztsol(i) = 0.
@@ -2773,7 +2755,7 @@
 #endif
 #endif
-    !
+
     IF (ancien_ok) THEN
-    !
+
        d_u_dyn(:,:)  = (u_seri(:,:)-u_ancien(:,:))/phys_tstep
        d_v_dyn(:,:)  = (v_seri(:,:)-v_ancien(:,:))/phys_tstep
@@ -2910,7 +2892,7 @@
 #endif
     ENDIF
-    !
+
     ! Ajouter le geopotentiel du sol:
-    !
+
     DO k = 1, klev
        DO i = 1, klon
@@ -2918,7 +2900,7 @@
        ENDDO
     ENDDO
-    !
+
     ! Verifier les temperatures
-    !
+
     !IM BEG
     IF (check) THEN
@@ -2929,13 +2911,12 @@
           amx=MAX(ftsol(i,is_ter),amx)
        ENDDO
-       !
+
        PRINT*,' debut avant hgardfou min max ftsol',itap,amn,amx
     ENDIF !(check) THEN
     !IM END
-    !
+
     CALL hgardfou(t_seri,ftsol,'debutphy',abortphy)
     IF (abortphy==1) Print*,'ERROR ABORT hgardfou debutphy'
 
-    !
     !IM BEG
     IF (check) THEN
@@ -2946,12 +2927,12 @@
           amx=MAX(ftsol(i,is_ter),amx)
        ENDDO
-       !
+
        PRINT*,' debut apres hgardfou min max ftsol',itap,amn,amx
     ENDIF !(check) THEN
     !IM END
-    !
+
     ! Mettre en action les conditions aux limites (albedo, sst, etc.).
     ! Prescrire l'ozone et calculer l'albedo sur l'ocean.
-    !
+
     ! Update ozone if day change
     IF (MOD(itap-1,lmt_pas) == 0) THEN
@@ -2983,5 +2964,5 @@
              B=Z2-fac*alog(pplay(i,itroprep(i)))
              ttrop(i)= fac*alog(ptrop(i))+B
-!
+
              Z1= 1.e-3 * ( pphi(i,itroprep(i)+1)+pphis(i) ) / gravit
              Z2= 1.e-3 * ( pphi(i,itroprep(i))  +pphis(i) ) / gravit
@@ -3029,7 +3010,7 @@
 #endif
 #endif
-    !
+
     ! Re-evaporer l'eau liquide nuageuse
-    !
+
      CALL reevap (klon,klev,iflag_ice_thermo,t_seri,qx_seri, &
              d_t_eva,d_qx_eva)
@@ -3099,5 +3080,5 @@
     CALL ymds2ju(year_cur, mth_eq, day_eq,0., jD_eq)
     day_since_equinox = (jD_cur + jH_cur) - jD_eq
-    !
+
     !   choix entre calcul de la longitude solaire vraie ou valeur fixee a 
     !   solarlong0
@@ -3165,7 +3146,7 @@
           CALL zenang(zlongi,jH_cur,zdtime1,zdtime2, &
                latitude_deg,longitude_deg,rmu0,fract)
-          !
+
           ! Calcul des poids
-          !
+
           zdtime1=-phys_tstep !--on corrige le rayonnement pour representer le
           zdtime2=0.0    !--pas de temps de la physique qui se termine
@@ -3193,5 +3174,5 @@
     ! Cela implique tous les interactions des sous-surfaces et la
     ! partie diffusion turbulent du couche limit.
-    ! 
+
     ! Certains varibales de sorties de pbl_surface sont utiliser que pour 
     ! ecriture des fihiers hist_XXXX.nc, ces sont :
@@ -3205,8 +3186,7 @@
     !   d_ts,      fevap,     fluxlat, t2m,
     !   wfbils,    fluxt,   fluxu, fluxv,
-    !
+
     ! Certains ne sont pas utiliser du tout : 
     !   dsens, devap, zxsnow, zxfluxt, zxfluxq, q2m, fluxq
-    !
 
     ! Calcul de l'humidite de saturation au niveau du sol
@@ -3248,5 +3228,5 @@
        ! !!
        !>jyg+nrlmd
-       !
+
        !-------gustiness calculation-------!
        !ym : Warning gustiness non inialized for iflag_gusts=2 & iflag_gusts=3
@@ -3415,5 +3395,5 @@
 #endif 
 !#ifdef ISO
-       !
+
        !  Add turbulent diffusion tendency to the wake difference variables
 !!jyg       IF (mod(iflag_pbl_split,2) .NE. 0) THEN
@@ -3560,7 +3540,7 @@
        write(lunout,'(i4,f15.4)') (k,1000.*zqsat(igout,k),k=1,klev)
     ENDIF
-    !
+
     ! Appeler la convection (au choix)
-    !
+
     DO k = 1, klev
        DO i = 1, klon
@@ -3598,7 +3578,7 @@
     IF (prt_level>=1) write(lunout,*) 'omega(igout, :) = ', &
          omega(igout, :)
-    !
+
     ! Appel de la convection tous les "cvpas"
-    !
+
 !!jyg    IF (MOD(itapcv,cvpas).EQ.0) THEN
 !!    print *,' physiq : itapcv, cvpas, itap-1, cvpas_0 ', &
@@ -3606,7 +3586,6 @@
     IF (MOD(itapcv,cvpas)==0 .OR. MOD(itap-1,cvpas_0)==0) THEN
 
-    !
     ! Mettre a zero des variables de sortie (pour securite)
-    !
+
     pmflxr(:,:) = 0.
     pmflxs(:,:) = 0.
@@ -3636,5 +3615,5 @@
     xtwdtrainA(:,:,:) = 0.
 #endif
-    !
+
     IF (iflag_con==1) THEN
        abort_message ='reactiver le call conlmd dans physiq.F'
@@ -3783,5 +3762,5 @@
         endif ! if (iso_eau.gt.0) then
 #endif
-       !
+
        !jyg<
        ! Perform dry adiabatic adjustment on wake profile
@@ -3797,5 +3776,5 @@
 #endif         
          )
-             !
+
              DO k=1,klev
                 DO i=1,klon
@@ -3833,6 +3812,5 @@
        ENDIF ! (iflag_wake>=1)
        !>jyg
-       !
-        
+
 !!      print *,'physiq. q_w(1,k), q_x(1,k) ', &
 !!             (k, q_w(1,k), q_x(1,k),k=1,25)
@@ -3846,12 +3824,11 @@
                     Ale, Alp , Ale_wake, Alp_wake)
 !>jyg
-!
+
        ! sb, oct02:
        ! Schema de convection modularise et vectorise:
        ! (driver commun aux versions 3 et 4)
-       !
+
        IF (ok_cvl) THEN ! new driver for convectL
-          !
-        
+
 #ifdef ISO
 #ifdef ISOVERIF
@@ -3955,5 +3932,5 @@
                   k_upper_cv
           ENDIF
-          !
+
           !>jyg
           IF (type_trac == 'repr') THEN
@@ -4034,5 +4011,5 @@
           pmfu(:,:)=upwd(:,:)+dnwd(:,:)
           fm_cv(:,:)=upwd(:,:)+dnwd(:,:)+dnwd0(:,:)
-          !
+
           !jyg<
           ! If convective tendencies are too large, then call convection 
@@ -4048,5 +4025,5 @@
              ENDDO
           ENDDO
-!
+
           DO k=1,k_upper_cv
              DO i=1,klon
@@ -4065,9 +4042,9 @@
 !!!   ------------------------------------------------------------
           !>jyg
-          !
+
           DO i = 1, klon
              IF (iflagctrl(i)<=1) itau_con(i)=itau_con(i)+cvpas
           ENDDO
-          !
+
           !jyg<
           !    Add the tendency due to the dry adjustment of the wake profile
@@ -4091,5 +4068,5 @@
           ENDIF   ! (iflag_wake>=1)
           !>jyg
-          !
+
        ELSE ! ok_cvl
 
@@ -4109,5 +4086,4 @@
        ENDIF ! ok_cvl
 
-       !
        ! Correction precip
        rain_con = rain_con * cvl_corr
@@ -4117,5 +4093,4 @@
           xtsnow_con = xtsnow_con * cvl_corr
 #endif
-       !
 
        IF (.NOT. ok_gust) THEN
@@ -4127,5 +4102,4 @@
        ! =================================================================== c
        ! Calcul des proprietes des nuages convectifs
-       !
 
        !   calcul des proprietes des nuages convectifs
@@ -4203,7 +4177,7 @@
     itapcv = 0
     ENDIF !  (MOD(itapcv,cvpas).EQ.0 .OR. MOD(itapcv,cvpas_0).EQ.0)
-!
+
     itapcv = itapcv+1
-    !
+
     ! Compter les steps ou cvpas=1
     IF (cvpas == 1) THEN
@@ -4335,21 +4309,20 @@
 #endif 
 
-    !
     !==========================================================================
     !RR:Evolution de la poche froide: on ne fait pas de separation wake/env 
     !pour la couche limite diffuse pour l instant
-    !
-    !
+
+
     ! nrlmd le 22/03/2011---Si on met les poches hors des thermiques
     ! il faut rajouter cette tendance calcul\'ee hors des poches
     ! froides
-    !
+
     IF (iflag_wake>=1) THEN
-       !
-       !
+
+
        ! Call wakes every "wkpas" step
-       !
+
        IF (MOD(itapwk,wkpas)==0) THEN
-          !
+
           DO k=1,klev
              DO i=1,klon
@@ -4419,5 +4392,5 @@
         enddo        
 #endif 
-          !
+
           !calcul caracteristiques de la poche froide
           CALL calWAKE (iflag_wake_tend, paprs, pplay, phys_tstep, &
@@ -4442,9 +4415,9 @@
 #endif      
          )
-          !
+
           !jyg    Reinitialize itapwk when wakes have been called
           itapwk = 0
        ENDIF !  (MOD(itapwk,wkpas).EQ.0)
-       !
+
        itapwk = itapwk+1
 #ifdef ISOVERIF
@@ -4460,5 +4433,5 @@
         enddo
 #endif
-       !
+
        !-----------------------------------------------------------------------
        ! ajout des tendances des poches froides
@@ -4484,5 +4457,5 @@
           CALL prt_enerbil('wake',itap)
        ENDIF   ! (iflag_wake_tend .GT. 0.)
-       !
+
        IF (prt_level >= 10) THEN
          print *,' physiq, after calwake, wake_s: ',wake_s(:)
@@ -4500,9 +4473,9 @@
 
     ENDIF  ! (iflag_wake>=1)
-    !
+
     !===================================================================
     ! Convection seche (thermiques ou ajustement)
     !===================================================================
-    !
+
     CALL stratocu_if(klon,klev,pctsrf,paprs, pplay,t_seri &
          ,seuil_inversion,weak_inversion,dthmin)
@@ -4521,9 +4494,9 @@
       d_xt_ajsb(:,:,:)=0.0
 #endif
-    !
+
     !      fm_therm(:,:)=0.
     !      entr_therm(:,:)=0.
     !      detr_therm(:,:)=0.
-    !
+
     IF (prt_level>9) WRITE(lunout,*) &
          'AVANT LA CONVECTION SECHE , iflag_thermals=' &
@@ -4757,5 +4730,5 @@
 #endif         
          )
-          !
+
           !jyg<
 !!jyg          IF (mod(iflag_pbl_split/2,2) .EQ. 1) THEN
@@ -4766,8 +4739,8 @@
              DO k=1,klev
                 DO i=1,klon
-                   !
+
                    d_deltat_the(i,k) = - d_t_ajs(i,k) 
                    d_deltaq_the(i,k) = - d_q_ajs(i,k) 
-                   !
+
                    d_u_ajs(i,k) = d_u_ajs(i,k)*(1.-wake_s(i)) 
                    d_v_ajs(i,k) = d_v_ajs(i,k)*(1.-wake_s(i)) 
@@ -4780,8 +4753,8 @@
                    enddo
 #endif
-                   !
+
                 ENDDO
              ENDDO
-          !
+
              IF (ok_bug_split_th) THEN
                CALL add_wake_tend &
@@ -4800,7 +4773,7 @@
              ENDIF
              CALL prt_enerbil('the',itap)
-          !
+
           ENDIF  ! (mod(iflag_pbl_split/10,10) .GE. 1)
-          !
+
           CALL add_phys_tend(d_u_ajs,d_v_ajs,d_t_ajs,d_q_ajs,  &
                              dql0,dqi0,dqbs0,paprs,'thermals', abortphy,flag_inhib_tend,itap,0 &
@@ -4810,6 +4783,6 @@
          )
           CALL prt_enerbil('thermals',itap)
-          !
-!
+
+
           CALL alpale_th( phys_tstep, lmax_th, t_seri, cell_area,  &
                           cin, s2, n2, strig, &
@@ -4937,5 +4910,5 @@
 
     ENDIF
-    !
+
     !===================================================================
     ! Computation of ratqs, the width (normalized) of the subrid scale 
@@ -4964,5 +4937,4 @@
          ratqs,ratqsc,ratqs_inter_)
 
-    !
     ! Appeler le processus de condensation a grande echelle
     ! et le processus de precipitation
@@ -4971,5 +4943,5 @@
        print *,'itap, ->fisrtilp ',itap
     ENDIF
-    !
+
 #ifdef ISO    
 #ifdef ISOVERIF
@@ -5096,5 +5068,5 @@
          )
     ENDIF
-    !
+
     WHERE (rain_lsc < 0) rain_lsc = 0.
     WHERE (snow_lsc < 0) snow_lsc = 0.
@@ -5325,5 +5297,4 @@
     ENDIF
 
-    !
     !-------------------------------------------------------------------
     !  PRESCRIPTION DES NUAGES POUR LE RAYONNEMENT
@@ -5331,5 +5302,5 @@
 
     ! 1. NUAGES CONVECTIFS
-    !
+
     !IM cf FH
     !     IF (iflag_cld_th.eq.-1) THEN ! seulement pour Tiedtke
@@ -5353,7 +5324,6 @@
           ENDDO
        ENDIF
-       !
+
        !     call dump2d(iim,jjm,rain_tiedtke(2:klon-1),'PSEUDO PRECIP ')
-       !
 
        ! Nuages diagnostiques pour Tiedtke
@@ -5456,7 +5426,7 @@
     !        enddo prfl, psfl,
     !     enddo
-    !
+
     ! 2. NUAGES STARTIFORMES
-    !
+
     IF (ok_stratus) THEN
        CALL diagcld2(paprs,pplay,t_seri,q_seri, diafra,dialiq)
@@ -5470,7 +5440,7 @@
        ENDDO
     ENDIF
-    !
+
     ! Precipitation totale
-    !
+
     DO i = 1, klon
        rain_fall(i) = rain_con(i) + rain_lsc(i)
@@ -5543,7 +5513,7 @@
         endif
 #endif    
-    !
+
     ! Calculer l'humidite relative pour diagnostique
-    !
+
     DO k = 1, klev
        DO i = 1, klon
@@ -5578,5 +5548,5 @@
     !IM Calcul temp.potentielle a 2m (tpot) et temp. potentielle 
     !   equivalente a 2m (tpote) pour diagnostique
-    !
+
     DO i = 1, klon
        tpot(i)=zt2m(i)*(100000./paprs(i,1))**RKAPPA
@@ -5661,10 +5631,8 @@
     ENDIF
 
-    !
     ! Appeler le rayonnement mais calculer tout d'abord l'albedo du sol.
-    !
+
     IF (MOD(itaprad,radpas)==0) THEN
 
-       !
        !jq - introduce the aerosol direct and first indirect radiative forcings
        !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
@@ -5672,5 +5640,5 @@
           IF (iflag_rrtm == 0) THEN !--old radiation
              IF (.NOT. aerosol_couple) THEN
-                !
+
                 CALL readaerosol_optic( &
                      debut, flag_aerosol, itap, jD_cur-jD_ref, &
@@ -5685,10 +5653,10 @@
                 CALL abort_physic(modname,abort_message,1)
              ELSE
-                !
+
 #ifdef CPP_RRTM
                 IF (NSW.EQ.6) THEN
                    !--new aerosol properties SW and LW
-                   !
-#ifdef CPP_Dust
+
+IF (CPPKEY_DUST) THEN
                    !--SPL aerosol model
                    CALL splaerosol_optic_rrtm( ok_alw, pplay, paprs, t_seri, rhcl, &
@@ -5696,5 +5664,5 @@
                         tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
                         tausum_aero, tau3d_aero)
-#else
+ELSE
                    !--climatologies or INCA aerosols
                    CALL readaerosol_optic_rrtm( debut, aerosol_couple, ok_alw, ok_volcan, &
@@ -5704,5 +5672,5 @@
                         tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
                         tausum_aero, drytausum_aero, tau3d_aero)
-#endif
+END IF
 
                    IF (flag_aerosol .EQ. 7) THEN
@@ -5711,8 +5679,7 @@
                    ENDIF
 
-                   !
                 ELSE IF (NSW.EQ.2) THEN 
                    !--for now we use the old aerosol properties
-                   !
+
                    CALL readaerosol_optic( &
                         debut, flag_aerosol, itap, jD_cur-jD_ref, &
@@ -5721,5 +5688,5 @@
                         tau_aero, piz_aero, cg_aero,  &
                         tausum_aero, tau3d_aero)
-                   !
+
                    !--natural aerosols
                    tau_aero_sw_rrtm(:,:,1,:)=tau_aero(:,:,3,:)
@@ -5730,8 +5697,8 @@
                    piz_aero_sw_rrtm(:,:,2,:)=piz_aero(:,:,2,:)
                    cg_aero_sw_rrtm (:,:,2,:)=cg_aero (:,:,2,:)
-                   !
+
                    !--no LW optics
                    tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
-                   !
+
                 ELSE
                    abort_message='Only NSW=2 or 6 are possible with ' &
@@ -5744,5 +5711,5 @@
                 CALL abort_physic(modname,abort_message,1)
 #endif
-                !
+
              ENDIF
           ELSE IF (iflag_rrtm ==2) THEN    ! ecrad RADIATION
@@ -5774,8 +5741,8 @@
           ENDIF
        ENDIF
-       !
+
        !--WMO criterion to determine tropopause
        CALL stratosphere_mask(missing_val, pphis, t_seri, pplay, latitude_deg)
-       !
+
        !--STRAT AEROSOL
        !--updates tausum_aero,tau_aero,piz_aero,cg_aero
@@ -5814,5 +5781,5 @@
           tausum_aero(:,:,id_STRAT_phy) = 0. 
        ENDIF
-!
+
 #ifdef CPP_RRTM
 IF (CPPKEY_STRATER) THEN
@@ -5824,9 +5791,8 @@
 #endif
        !--fin STRAT AEROSOL
-       !     
 
        ! Calculer les parametres optiques des nuages et quelques
        ! parametres pour diagnostiques:
-       !
+
        IF (aerosol_couple.AND.config_inca=='aero') THEN 
           mass_solu_aero(:,:)    = ccm(:,:,1) 
@@ -5845,7 +5811,6 @@
                zfice, dNovrN, ptconv, rnebcon, clwcon)
 
-       !
        !IM betaCRF
-       !
+
        cldtaurad   = cldtau
        cldtaupirad = cldtaupi
@@ -5853,10 +5818,9 @@
        cldfrarad   = cldfra
 
-       !
        IF (lon1_beta==-180..AND.lon2_beta==180..AND. &
            lat1_beta==90..AND.lat2_beta==-90.) THEN
-          !
+
           ! global
-          !
+
 !IM 251017 begin
 !               print*,'physiq betaCRF global zdtime=',zdtime
@@ -5878,12 +5842,12 @@
              ENDDO
           ENDDO
-          !
+
        ELSE
-          !
+
           ! regional
-          !
+
           DO k=1, klev
              DO i=1,klon
-                !
+
                 IF (longitude_deg(i)>=lon1_beta.AND. &
                     longitude_deg(i)<=lon2_beta.AND. &
@@ -5903,8 +5867,8 @@
                    cldfrarad(i,k)   = cldfra(i,k) * beta(i,k)
                 ENDIF
-             !
+
              ENDDO
           ENDDO
-       !
+
        ENDIF
 
@@ -5932,8 +5896,7 @@
        ENDIF
 
-       !
        !sonia : If Iflag_radia >=2, pertubation of some variables
        !input to radiation (DICE)
-       !
+
        IF (iflag_radia >= 2) THEN
           zsav_tsol (:) = zxtsol(:)
@@ -5964,7 +5927,7 @@
 END IF
        ELSE
-          !
+
           !IM calcul radiatif pour le cas actuel
-          !
+
           RCO2 = RCO2_act
           RCH4 = RCH4_act
@@ -5972,15 +5935,15 @@
           RCFC11 = RCFC11_act
           RCFC12 = RCFC12_act
-          ! 
+
           !--interactive CO2 in ppm from carbon cycle
           IF (carbon_cycle_rad) RCO2=RCO2_glo
-          !
+
           IF (prt_level >=10) THEN
              print *,' ->radlwsw, number 1 '
           ENDIF
-          !
+
           ! AI namelist utilise pour l appel principal de radlwsw (ecrad)
           namelist_ecrad_file='namelist_ecrad'
-          !
+
           CALL radlwsw &
                (debut, dist, rmu0, fract,  &
@@ -6035,9 +5998,9 @@
  
           IF (.NOT. using_xios) THEN
-            !
+
             !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
             !IM des taux doit etre different du taux actuel
             !IM Par defaut on a les taux perturbes egaux aux taux actuels
-            !
+
             IF (RCO2_per/=RCO2_act.OR. &
                 RCH4_per/=RCH4_act.OR. &
@@ -6046,7 +6009,7 @@
                 RCFC12_per/=RCFC12_act) ok_4xCO2atm =.TRUE.
           ENDIF
-   ! 
+
           IF (ok_4xCO2atm) THEN
-                !
+
                 RCO2 = RCO2_per
                 RCH4 = RCH4_per
@@ -6054,12 +6017,12 @@
                 RCFC11 = RCFC11_per
                 RCFC12 = RCFC12_per
-                !
+
                 IF (prt_level >=10) THEN
                    print *,' ->radlwsw, number 2 '
                 ENDIF
-                !
+
                 ! AI namelist utilise pour l appel principal de radlwsw (ecrad)
                 namelist_ecrad_file='namelist_ecrad'
-                !
+
                 CALL radlwsw &
                      (debut, dist, rmu0, fract,  &
@@ -6153,7 +6116,7 @@
        ENDIF ! aerosol_couple
        itaprad = 0
-       !
+
        !  If Iflag_radia >=2, reset pertubed variables
-       !
+
        IF (iflag_radia >= 2) THEN
           zxtsol(:) = zsav_tsol (:)
@@ -6182,9 +6145,8 @@
     ENDIF
 
-    !
     ! Calculer radsol a l'exterieur de radlwsw
     ! pour prendre en compte le cycle diurne
     ! recode par Olivier Boucher en sept 2015
-    !
+
     radsol=solsw*swradcorr+sollw
 
@@ -6193,8 +6155,6 @@
     ENDIF
 
-    !
     ! Ajouter la tendance des rayonnements (tous les pas)
     ! avec une correction pour le cycle diurne dans le SW
-    !
 
     DO k=1, klev
@@ -6218,5 +6178,4 @@
     CALL prt_enerbil('LW',itap)
 
-    !
     IF (mydebug) THEN
        CALL writefield_phy('u_seri',u_seri,nbp_lev)
@@ -6227,12 +6186,10 @@
 
     ! Calculer l'hydrologie de la surface
-    !
+
     !      CALL hydrol(dtime,pctsrf,rain_fall, snow_fall, zxevap,
     !     .            agesno, ftsol,fqsurf,fsnow, ruis)
-    !
-
-    !
+
     ! Calculer le bilan du sol et la derive de temperature (couplage)
-    !
+
     DO i = 1, klon
        !         bils(i) = radsol(i) - sens(i) - evap(i)*RLVTT
@@ -6240,15 +6197,15 @@
        bils(i) = radsol(i) - sens(i) + zxfluxlat(i)
     ENDDO
-    !
+
     !moddeblott(jan95)
     ! Appeler le programme de parametrisation de l'orographie
     ! a l'echelle sous-maille:
-    !
+
     IF (prt_level >=10) THEN
        print *,' call orography ? ', ok_orodr
     ENDIF
-    !
+
     IF (ok_orodr) THEN
-       !
+
        !  selection des points pour lesquels le shema est actif:
        igwd=0
@@ -6268,5 +6225,5 @@
        ENDDO
        !        igwdim=MAX(1,igwd)
-       !
+
        IF (ok_strato) THEN
 
@@ -6286,5 +6243,5 @@
                d_t_oro, d_u_oro, d_v_oro)
        ENDIF
-       !
+
        !  ajout des tendances
        !-----------------------------------------------------------------------
@@ -6298,7 +6255,7 @@
        CALL prt_enerbil('oro',itap)
        !----------------------------------------------------------------------
-       !
+
     ENDIF ! fin de test sur ok_orodr
-    !
+
     IF (mydebug) THEN
        CALL writefield_phy('u_seri',u_seri,nbp_lev)
@@ -6309,5 +6266,5 @@
 
     IF (ok_orolf) THEN
-       !
+
        !  selection des points pour lesquels le shema est actif:
        igwd=0
@@ -6325,5 +6282,5 @@
        ENDDO
        !        igwdim=MAX(1,igwd)
-       !
+
        IF (ok_strato) THEN
 
@@ -6447,7 +6404,7 @@
        ENDDO
     ENDDO
-    !
+
     !IM calcul composantes axiales du moment angulaire et couple des montagnes
-    !
+
     IF (is_sequential .and. ok_orodr) THEN 
        CALL aaam_bud (27,klon,klev,jD_cur-jD_ref,jH_cur, &
@@ -6485,6 +6442,6 @@
 #endif
     ENDIF
-    !
-    !
+
+
 IF (CPPKEY_STRATER) THEN
     IF (ok_qemiss) THEN
@@ -6510,5 +6467,5 @@
                 m_H2O_emiss_vol_daily = m_H2O_emiss_vol(ieru)/(REAL(injdur)&
                      *REAL(ponde_lonlat_vol(ieru)))
-                !
+
                 CALL STRATEMIT(pdtphys,pdtphys,latitude_deg,longitude_deg,t_seri,&
                     pplay,paprs,tr_seri,&
@@ -6535,5 +6492,5 @@
 !            Additional tendency of TKE due to orography
 !===============================================================
-!
+
 ! Inititialization
 !------------------
@@ -6561,5 +6518,4 @@
 !      ** 1 we include a fraction alphatkeoro of the whole tendency duoro
 !      ** 2 we include a fraction alphatkeoro of the gravity wave part of duoro
-!
 
        IF (addtkeoro > 0 .AND. ok_orodr ) THEN
@@ -6628,8 +6584,7 @@
 
     CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke)
-   !
+
    ! Prevent pbl_tke_w from becoming negative
     wake_delta_pbl_tke(:,:,:) = max(wake_delta_pbl_tke(:,:,:), -pbl_tke(:,:,:))
-   !
 
        ENDIF
@@ -6842,5 +6797,4 @@
     !   Calcul  des tendances traceurs
     !====================================================================
-    !
 
     IF (type_trac == 'repr') THEN
@@ -6862,5 +6816,5 @@
     ENDIF
 
-#ifdef CPP_Dust
+IF (CPPKEY_DUST) THEN
     !  Avec SPLA, iflag_phytrac est forcé =1 
     CALL       phytracr_spl ( debut,lafin , jD_cur,jH_cur,iflag_con,       &  ! I
@@ -6879,5 +6833,5 @@
                       d_tr_dyn,tr_seri)
 
-#else
+ELSE
     IF (iflag_phytrac == 1 ) THEN
       CALL phytrac ( &
@@ -6920,5 +6874,5 @@
     ENDIF    ! (iflag_phytrac=1)
 
-#endif
+END IF
     !ENDIF    ! (iflag_phytrac=1)
 
@@ -6939,21 +6893,19 @@
     ENDIF
 
-    !
     ! Calculer le transport de l'eau et de l'energie (diagnostique)
-    !
+
     CALL transp (paprs,zxtsol, t_seri, q_seri, ql_seri, qs_seri, u_seri, v_seri, zphi, &
                  ue, ve, uq, vq, uwat, vwat)
-    !
+
     !IM global posePB BEG
     IF(1==0) THEN
-       !
+
        CALL transp_lay (paprs,zxtsol, t_seri, q_seri, u_seri, v_seri, zphi, &
             ve_lay, vq_lay, ue_lay, uq_lay)
-       !
+
     ENDIF !(1.EQ.0) THEN
     !IM global posePB END
-    !
+
     ! Accumuler les variables a stocker dans les fichiers histoire:
-    !
 
     !================================================================
@@ -7058,18 +7010,18 @@
     !   SORTIES
     !=======================================================================
-    !
+
     !IM initialisation + calculs divers diag AMIP2
-    !
+
     include "calcul_divers.h"
-    !
+
     !IM Interpolation sur les niveaux de pression du NMC
     !   -------------------------------------------------
-    !
+
     include "calcul_STDlev.h"
-    !
+
     ! slp sea level pressure derived from Arpege-IFS : CALL ctstar + CALL pppmer
     CALL diag_slp(klon,t_seri,paprs,pplay,pphis,ptstar,pt0,slp)
-    !
-    !
+
+
     IF (ANY(type_trac == ['inca','inco'])) THEN
 IF (CPPKEY_INCA) THEN
@@ -7102,11 +7054,10 @@
     ENDIF
 
-    !
     ! Convertir les incrementations en tendances
-    !
+
     IF (prt_level >=10) THEN
        print *,'Convertir les incrementations en tendances '
     ENDIF
-    !
+
     IF (mydebug) THEN
        CALL writefield_phy('u_seri',u_seri,nbp_lev)
@@ -7168,11 +7119,11 @@
        ENDDO
     ENDDO
-    !
+
     !IM rajout diagnostiques bilan KP pour analyse MJO par Jun-Ichi Yano
     !IM global posePB      include "write_bilKP_ins.h"
     !IM global posePB      include "write_bilKP_ave.h"
-    !
+
     ! Sauvegarder les valeurs de t et q a la fin de la physique:
-    !
+
     u_ancien(:,:)  = u_seri(:,:)
     v_ancien(:,:)  = v_seri(:,:)
@@ -7261,5 +7212,4 @@
        ENDDO
     ENDDO
-    !
 
     ! 22.03.04 BEG
@@ -7311,5 +7261,5 @@
     !On effectue les sorties:
 
-#ifdef CPP_Dust
+IF (CPPKEY_DUST) THEN
   CALL phys_output_write_spl(itap, pdtphys, paprs, pphis,  &
        pplay, lmax_th, aerosol_couple,                 &
@@ -7318,5 +7268,5 @@
        ptconvth, d_t, qx, d_qx, d_tr_dyn, zmasse,      &
        flag_aerosol, flag_aerosol_strat, ok_cdnc)
-#else
+ELSE
     CALL phys_output_write(itap, pdtphys, paprs, pphis,  &
          pplay, lmax_th, aerosol_couple,                 &
@@ -7325,5 +7275,5 @@
          ptconvth, d_u, d_t, qx, d_qx, zmasse,           &
          flag_aerosol, flag_aerosol_strat, ok_cdnc,t, u1, v1)
-#endif
+END IF
 
     IF (.NOT. using_xios) THEN
@@ -7348,9 +7298,9 @@
 
     ! 22.03.04 END
-    !
+
     !====================================================================
     ! Si c'est la fin, il faut conserver l'etat de redemarrage
     !====================================================================
-    !
+
 #ifdef ISO   
 #ifdef ISOVERIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/reevap.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/reevap.F90	(revision 5098)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/reevap.F90	(revision 5099)
@@ -34,8 +34,8 @@
     include "FCTTRE.h"
     !IM 100106 BEG : pouvoir sortir les ctes de la physique
-    !
+
 do ixt=1,1+ntiso
     ! Re-evaporer l'eau liquide nuageuse
-    !
+
     iliqcur= iqWIsoPha(ixt,iliq)
     ivapcur= iqWIsoPha(ixt,ivap)
