Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/addfi.F90	(revision 5113)
@@ -120,5 +120,5 @@
 
   if (planet_type=="earth") then
-    ! ! earth case, special treatment for first 2 tracers (water)
+    ! earth case, special treatment for first 2 tracers (water)
     DO iq = 1, 2
       DO k = 1, llm
@@ -139,5 +139,5 @@
     ENDDO
   else
-    ! ! general case, treat all tracers equally)
+    ! general case, treat all tracers equally)
     DO iq = 1, nqtot
       DO k = 1, llm
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/caladvtrac.F90	(revision 5113)
@@ -84,7 +84,7 @@
       ENDDO
 
-      ! !write(*,*) 'caladvtrac 87'
+      !write(*,*) 'caladvtrac 87'
       CALL qminimum(q, nqtot, finmasse)
-      ! !write(*,*) 'caladvtrac 89'
+      !write(*,*) 'caladvtrac 89'
 
       CALL SCOPY   (ip1jmp1 * llm, masse, 1, finmasse, 1)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/caldyn.F90	(revision 5113)
@@ -69,39 +69,39 @@
   !--------------------------------
 
-  ! ! compute contravariant winds ucont() and vcont
+  ! compute contravariant winds ucont() and vcont
   CALL covcont  (llm, ucov, vcov, ucont, vcont)
-  ! ! compute pressure p()
+  ! compute pressure p()
   CALL pression (ip1jmp1, ap, bp, ps, p)
-  ! ! compute psexbarxy() XY-area weighted-averaged surface pressure (what for?)
+  ! compute psexbarxy() XY-area weighted-averaged surface pressure (what for?)
   CALL psextbar (ps, psexbarxy)
-  ! ! compute mass in each atmospheric mesh: masse()
+  ! compute mass in each atmospheric mesh: masse()
   CALL massdair (p, masse)
-  ! ! compute X and Y-averages of mass, massebx() and masseby()
+  ! compute X and Y-averages of mass, massebx() and masseby()
   CALL massbar  (masse, massebx, masseby)
-  ! ! compute XY-average of mass, massebxy()
+  ! compute XY-average of mass, massebxy()
   CALL massbarxy(masse, massebxy)
-  ! ! compute mass fluxes pbaru() and pbarv()
+  ! compute mass fluxes pbaru() and pbarv()
   CALL flumass  (massebx, masseby, vcont, ucont, pbaru, pbarv)
-  ! ! compute dteta() , horizontal converging flux of theta
+  ! compute dteta() , horizontal converging flux of theta
   CALL dteta1   (teta, pbaru, pbarv, dteta)
-  ! ! compute convm(), horizontal converging flux of mass
+  ! compute convm(), horizontal converging flux of mass
   CALL convmas  (pbaru, pbarv, convm)
 
-  ! ! compute pressure variation due to mass convergence
+  ! compute pressure variation due to mass convergence
   DO ij = 1, ip1jmp1
     dp(ij) = convm(ij, 1) / airesurg(ij)
   ENDDO
 
-  ! ! compute vertical velocity w()
+  ! compute vertical velocity w()
   CALL vitvert (convm, w)
-  ! ! compute potential vorticity vorpot()
+  ! compute potential vorticity vorpot()
   CALL tourpot (vcov, ucov, massebxy, vorpot)
-  ! ! compute rotation induced du() and dv()
+  ! compute rotation induced du() and dv()
   CALL dudv1   (vorpot, pbaru, pbarv, du, dv)
-  ! ! compute kinetic energy ecin()
+  ! compute kinetic energy ecin()
   CALL enercin (vcov, ucov, vcont, ucont, ecin)
-  ! ! compute Bernouilli function bern()
+  ! compute Bernouilli function bern()
   CALL bernoui (ip1jmp1, llm, phi, ecin, bern)
-  ! ! compute and add du() and dv() contributions from Bernouilli and pressure
+  ! compute and add du() and dv() contributions from Bernouilli and pressure
   CALL dudv2   (teta, pkf, bern, du, dv)
 
@@ -112,5 +112,5 @@
   ENDDO
 
-  ! ! compute vertical advection contributions to du(), dv() and dteta()
+  ! compute vertical advection contributions to du(), dv() and dteta()
   CALL advect(ang, vcov, teta, w, massebx, masseby, du, dv, dteta)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/conf_gcm.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/conf_gcm.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/conf_gcm.f90	(revision 5113)
@@ -6,5 +6,5 @@
   use IOIPSL
   USE infotrac, ONLY: type_trac
-  use assert_m, only: assert
+  use lmdz_assert, only: assert
   USE comconst_mod, ONLY: dissip_deltaz, dissip_factz, dissip_zref, &
           iflag_top_bound, mode_top_bound, tau_top_bound, &
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dissip.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dissip.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dissip.F90	(revision 5113)
@@ -39,5 +39,5 @@
   REAL, INTENT(IN) :: teta(ip1jmp1, llm) ! potential temperature
   REAL, INTENT(IN) :: p(ip1jmp1, llmp1) ! pressure
-  ! ! tendencies (.../s) on covariant winds and potential temperature
+  ! tendencies (.../s) on covariant winds and potential temperature
   REAL, INTENT(OUT) :: dv(ip1jm, llm)
   REAL, INTENT(OUT) :: du(ip1jmp1, llm)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/dynetat0.F90	(revision 5113)
@@ -12,5 +12,5 @@
   USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey
   USE control_mod, ONLY: planet_type
-  USE assert_eq_m, ONLY: assert_eq
+  USE lmdz_assert_eq, ONLY: assert_eq
   USE comvert_mod, ONLY: pa,preff
   USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa, lllm, omeg, rad
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/friction.F90	(revision 5113)
@@ -45,5 +45,5 @@
 
   IF (firstcall) THEN
-    ! ! set friction type
+    ! set friction type
     CALL getin("friction_type", friction_type)
     if ((friction_type<0).or.(friction_type>1)) then
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/getparam.F90	(revision 5113)
@@ -8,5 +8,5 @@
      MODULE PROCEDURE getparamr,getparami,getparaml
    END INTERFACE
-   private getparamr,getparami,getparaml
+   PRIVATE getparamr,getparami,getparaml
 
    INTEGER, PARAMETER :: out_eff=99
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/groupe.F90	(revision 5113)
@@ -5,5 +5,5 @@
   use comconst_mod, only: ngroup
 
-  implicit none
+  IMPLICIT NONE
 
   !   sous-programme servant a fitlrer les champs de flux de masse aux
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/guide_mod.F90	(revision 5113)
@@ -924,5 +924,5 @@
     use serre_mod, only: clon, clat, grossismx, grossismy
     
-    implicit none
+    IMPLICIT NONE
 
     include "dimensions.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/iniinterp_horiz.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/iniinterp_horiz.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/iniinterp_horiz.F90	(revision 5113)
@@ -6,5 +6,5 @@
         ktotal, iik, jjk, jk, ik, intersec, airen)
 
-  implicit none
+  IMPLICIT NONE
 
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/integrd.F90	(revision 5113)
@@ -46,5 +46,5 @@
   real, intent(inout) :: masse(ip1jmp1, llm) ! atmospheric mass
   real, intent(in) :: phis(ip1jmp1) ! ground geopotential !!! unused
-  ! ! values at previous time step
+  ! values at previous time step
   real, intent(inout) :: vcovm1(ip1jm, llm)
   real, intent(inout) :: ucovm1(ip1jmp1, llm)
@@ -52,5 +52,5 @@
   real, intent(inout) :: psm1(ip1jmp1)
   real, intent(inout) :: massem1(ip1jmp1, llm)
-  ! ! the tendencies to add
+  ! the tendencies to add
   real, intent(in) :: dv(ip1jm, llm)
   real, intent(in) :: du(ip1jmp1, llm)
@@ -100,5 +100,5 @@
       write(lunout, *) "integrd: negative surface pressure ", ps(ij)
       write(lunout, *) " at node ij =", ij
-      ! ! since ij=j+(i-1)*jjp1 , we have
+      ! since ij=j+(i-1)*jjp1 , we have
       j = modulo(ij, jjp1)
       i = 1 + (ij - j) / jjp1
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/leapfrog.F90	(revision 5113)
@@ -294,5 +294,5 @@
 
   IF(purmats) THEN
-    ! ! Purely Matsuno time stepping
+    ! Purely Matsuno time stepping
     IF(MOD(itau, iconser) ==0.AND.  forward) conser = .TRUE.
     IF(MOD(itau, dissip_period)==0.AND..NOT.forward) &
@@ -301,5 +301,5 @@
             .and. physic) apphys = .TRUE.
   ELSE
-    ! ! Leapfrog/Matsuno time stepping
+    ! Leapfrog/Matsuno time stepping
     IF(MOD(itau, iconser) == 0) conser = .TRUE.
     IF(MOD(itau + 1, dissip_period)==0 .AND. .NOT. forward) &
@@ -320,5 +320,5 @@
   !   --------------------------------
 
-  ! ! compute geopotential phi()
+  ! compute geopotential phi()
   CALL geopot  (ip1jmp1, teta, pk, pks, phis, phi)
 
@@ -341,5 +341,5 @@
             p, masse, dq, teta, &
             flxw, pk)
-    ! !write(*,*) 'caladvtrac 346'
+    !write(*,*) 'caladvtrac 346'
 
     IF (offline) THEN
@@ -409,5 +409,5 @@
 
     IF (planet_type =="generic") THEN
-      ! ! AS: we make jD_cur to be pday
+      ! AS: we make jD_cur to be pday
       jD_cur = int(day_ini + itau / day_step)
     ENDIF
@@ -450,5 +450,5 @@
             ucov, vcov, teta, q, ps, &
             dufi, dvfi, dtetafi, dqfi, dpfi)
-    ! ! since addfi updates ps(), also update p(), masse() and pk()
+    ! since addfi updates ps(), also update p(), masse() and pk()
     CALL pression (ip1jmp1, ap, bp, ps, p)
     CALL massdair(p, masse)
@@ -486,5 +486,5 @@
 
     if (planet_type=="giant") then
-      ! ! add an intrinsic heat flux at the base of the atmosphere
+      ! add an intrinsic heat flux at the base of the atmosphere
       teta(:, 1) = teta(:, 1) + dtvr * aire(:) * ihf / cpp / masse(:, 1)
     endif
@@ -492,5 +492,5 @@
     CALL friction(ucov, vcov, dtvr)
 
-    ! ! Sponge layer (if any)
+    ! Sponge layer (if any)
     IF (ok_strato) THEN
       ! dufi(:,:)=0.
@@ -646,5 +646,5 @@
       ENDIF
 
-      ! ! Ehouarn: re-compute geopotential for outputs
+      ! Ehouarn: re-compute geopotential for outputs
       CALL geopot(ip1jmp1, teta, pk, pks, phis, phi)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/qminimum.F90	(revision 5113)
@@ -41,7 +41,7 @@
   SAVE imprim
   DATA imprim /0/
-  ! !INTEGER ijb,ije
-  ! !INTEGER Index_pump(ij_end-ij_begin+1)
-  ! !INTEGER nb_pump
+  !INTEGER ijb,ije
+  !INTEGER Index_pump(ij_end-ij_begin+1)
+  !INTEGER nb_pump
   INTEGER :: ixt
 
@@ -113,13 +113,13 @@
   ENDIF
 
-  ! !write(*,*) 'qminimum 128'
+  !write(*,*) 'qminimum 128'
   if (niso > 0) then
-    ! ! CRisi: traiter de même les traceurs d'eau
-    ! ! Mais il faut les prendre à l'envers pour essayer de conserver la
-    ! ! masse.
-    ! ! 1) pompage dans le sol
-    ! ! On suppose que ce pompage se fait sans isotopes -> on ne modifie
-    ! ! rien ici et on croise les doigts pour que ça ne soit pas trop
-    ! ! génant
+    ! CRisi: traiter de même les traceurs d'eau
+    ! Mais il faut les prendre à l'envers pour essayer de conserver la
+    ! masse.
+    ! 1) pompage dans le sol
+    ! On suppose que ce pompage se fait sans isotopes -> on ne modifie
+    ! rien ici et on croise les doigts pour que ça ne soit pas trop
+    ! génant
     DO i = 1, ip1jmp1
       if (zx_pump(i)>0.0) then
@@ -128,10 +128,10 @@
     enddo !DO i = 1,ip1jmp1
 
-    ! ! 2) transfert de vap vers les couches plus hautes
-    ! !write(*,*) 'qminimum 139'
+    ! 2) transfert de vap vers les couches plus hautes
+    !write(*,*) 'qminimum 139'
     do k = 2, llm
       DO i = 1, ip1jmp1
         if (zx_defau_diag(i, k, 1)>0.0) then
-          ! ! on ajoute la vapeur en k
+          ! on ajoute la vapeur en k
           do ixt = 1, ntiso
             q(i, k, iqIsoPha(ixt, iq_vap)) = q(i, k, iqIsoPha(ixt, iq_vap)) &
@@ -139,5 +139,5 @@
                             * q(i, k - 1, iqIsoPha(ixt, iq_vap)) / q_follow(i, k - 1, 1)
 
-            ! ! et on la retranche en k-1
+            ! et on la retranche en k-1
             q(i, k - 1, iqIsoPha(ixt, iq_vap)) = &
                     q(i, k - 1, iqIsoPha(ixt, iq_vap)) &
@@ -160,6 +160,6 @@
 
 
-    ! ! 3) transfert d'eau de la vapeur au liquide
-    ! !write(*,*) 'qminimum 164'
+    ! 3) transfert d'eau de la vapeur au liquide
+    !write(*,*) 'qminimum 164'
     do k = 1, llm
       DO i = 1, ip1jmp1
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/top_bound.F90	(revision 5113)
@@ -114,5 +114,5 @@
   CALL massbar(masse, massebx, masseby)
 
-  ! ! compute zonal average of vcov and u
+  ! compute zonal average of vcov and u
   if (mode_top_bound>=2) then
     do l = 1, llm
@@ -146,5 +146,5 @@
   endif ! of if (mode_top_bound.ge.2)
 
-  ! ! compute zonal average of potential temperature, if necessary
+  ! compute zonal average of potential temperature, if necessary
   if (mode_top_bound>=3) then
     do l = 1, llm
@@ -162,5 +162,5 @@
 
   if (mode_top_bound>=1) then
-    ! ! Apply sponge quenching on vcov:
+    ! Apply sponge quenching on vcov:
     do l = 1, llm
       do i = 1, iip1
@@ -172,5 +172,5 @@
     enddo
 
-    ! ! Apply sponge quenching on ucov:
+    ! Apply sponge quenching on ucov:
     do l = 1, llm
       do i = 1, iip1
@@ -184,5 +184,5 @@
 
   if (mode_top_bound>=3) then
-    ! ! Apply sponge quenching on teta:
+    ! Apply sponge quenching on teta:
     do l = 1, llm
       do i = 1, iip1
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/vlsplt.F90	(revision 5113)
@@ -89,5 +89,5 @@
      ENDDO
   ENDDO
-  ! ! CRisi: aussi pour les fils
+  ! CRisi: aussi pour les fils
   do ifils=1,tracers(iq)%nqDescen
     iq2=tracers(iq)%iqDescen(ifils)
@@ -143,5 +143,5 @@
   REAL :: u_mq(ip1jmp1,llm)
 
-  ! ! CRisi
+  ! CRisi
   REAL :: masseq(ip1jmp1,llm,nqtot),Ratio(ip1jmp1,llm,nqtot)
   INTEGER :: ifils,iq2 ! CRisi
@@ -361,5 +361,5 @@
   ! CRisi: appel récursif de l'advection sur les fils.
   ! Il faut faire ça avant d'avoir mis à jour q et masse
-  ! !write(*,*) 'vlsplt 326: iq,nqDesc(iq)=',iq,tracers(iq)%nqDescen
+  !write(*,*) 'vlsplt 326: iq,nqDesc(iq)=',iq,tracers(iq)%nqDescen
 
   do ifils=1,tracers(iq)%nqDescen
@@ -367,8 +367,8 @@
     DO l=1,llm
       DO ij=iip2,ip1jm
-        ! ! On a besoin de q et masse seulement entre iip2 et ip1jm
-        ! !masseq(ij,l,iq2)=masse(ij,l,iq)*q(ij,l,iq)
+        ! On a besoin de q et masse seulement entre iip2 et ip1jm
+        !masseq(ij,l,iq2)=masse(ij,l,iq)*q(ij,l,iq)
   !           !Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq)
-        ! !Mvals: veiller a ce qu'on n'ait pas de denominateur nul
+        !Mvals: veiller a ce qu'on n'ait pas de denominateur nul
         masseq(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass)
         if (q(ij,l,iq)>min_qParent) then
@@ -391,5 +391,5 @@
   DO l=1,llm
      DO ij=iip2+1,ip1jm
-        ! !MVals: veiller a ce qu'on ait pas de denominateur nul
+        !MVals: veiller a ce qu'on ait pas de denominateur nul
         new_m=max(masse(ij,l,iq)+u_m(ij-1,l)-u_m(ij,l),min_qMass)
         q(ij,l,iq)=(q(ij,l,iq)*masse(ij,l,iq)+ &
@@ -404,7 +404,7 @@
   ENDDO
 
-  ! ! retablir les fils en rapport de melange par rapport a l'air:
-  ! ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio
-  ! ! puis on boucle en longitude
+  ! retablir les fils en rapport de melange par rapport a l'air:
+  ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio
+  ! puis on boucle en longitude
   do ifils=1,tracers(iq)%nqDescen
     iq2=tracers(iq)%iqDescen(ifils)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/vlspltqs.F90	(revision 5113)
@@ -159,5 +159,5 @@
     ENDDO
   ENDDO
-  ! ! CRisi: aussi pour les fils
+  ! CRisi: aussi pour les fils
   do ifils = 1, tracers(iq)%nqDescen
     iq2 = tracers(iq)%iqDescen(ifils)
@@ -171,5 +171,5 @@
     ENDDO
   enddo
-  ! !write(*,*) 'vlspltqs 183: fin de la routine'
+  !write(*,*) 'vlspltqs 183: fin de la routine'
 
 
@@ -212,5 +212,5 @@
   REAL :: u_mq(ip1jmp1, llm)
 
-  ! ! CRisi
+  ! CRisi
   REAL :: masseq(ip1jmp1, llm, nqtot), Ratio(ip1jmp1, llm, nqtot)
   INTEGER :: ifils, iq2 ! CRisi
@@ -452,5 +452,5 @@
   ! CRisi: appel récursif de l'advection sur les fils.
   ! Il faut faire ça avant d'avoir mis à jour q et masse
-  ! !write(*,*) 'vlspltqs 326: iq,nqChildren(iq)=',iq,
+  !write(*,*) 'vlspltqs 326: iq,nqChildren(iq)=',iq,
   ! &                 tracers(iq)%nqChildren
 
@@ -459,5 +459,5 @@
     DO l = 1, llm
       DO ij = iip2, ip1jm
-        ! ! On a besoin de q et masse seulement entre iip2 et ip1jm
+        ! On a besoin de q et masse seulement entre iip2 et ip1jm
         masseq(ij, l, iq2) = masse(ij, l, iq) * q(ij, l, iq)
         Ratio(ij, l, iq2) = q(ij, l, iq2) / q(ij, l, iq)
@@ -488,7 +488,7 @@
   ENDDO
 
-  ! ! retablir les fils en rapport de melange par rapport a l'air:
-  ! ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio
-  ! ! puis on boucle en longitude
+  ! retablir les fils en rapport de melange par rapport a l'air:
+  ! On calcule q entre iip2+1,ip1jm -> on fait pareil pour ratio
+  ! puis on boucle en longitude
   do ifils = 1, tracers(iq)%nqDescen
     iq2 = tracers(iq)%iqDescen(ifils)
@@ -758,5 +758,5 @@
   ! CRisi: appel récursif de l'advection sur les fils.
   ! Il faut faire ça avant d'avoir mis à jour q et masse
-  ! !write(*,*) 'vlyqs 689: iq,nqChildren(iq)=',iq,
+  !write(*,*) 'vlyqs 689: iq,nqChildren(iq)=',iq,
   ! &              tracers(iq)%nqChildren
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d/wrgrads.f90	(revision 5113)
@@ -2,5 +2,5 @@
 
 subroutine wrgrads(if, nl, field, name, titlevar)
-  implicit none
+  IMPLICIT NONE
 
   !   Declarations
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/com_io_dyn_mod.F90	(revision 5113)
@@ -4,5 +4,5 @@
 module com_io_dyn_mod
 
-  implicit none 
+  IMPLICIT NONE
 
 ! Names of various files for outputs (in the dynamics)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_dat_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_dat_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/conf_dat_m.F90	(revision 5113)
@@ -24,5 +24,5 @@
 !  * interbar is TRUE for barycentric interpolation.
 !-------------------------------------------------------------------------------
-  USE assert_eq_m, ONLY: assert_eq
+  USE lmdz_assert_eq, ONLY: assert_eq
   IMPLICIT NONE
 !-------------------------------------------------------------------------------
@@ -128,5 +128,5 @@
 !  * interbar is TRUE for barycentric interpolation.
 !-------------------------------------------------------------------------------
-  USE assert_eq_m, ONLY: assert_eq
+  USE lmdz_assert_eq, ONLY: assert_eq
   IMPLICIT NONE
 !-------------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert.F90	(revision 5113)
@@ -5,5 +5,5 @@
   use ioipsl, only: getin
   use new_unit_m, only: new_unit
-  use assert_m, only: assert
+  use lmdz_assert, only: assert
   USE comvert_mod, ONLY: ap, bp, aps, bps, nivsigs, nivsig, dpres, presnivs, &
                          pseudoalt, pa, preff, scaleheight, presinter
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert_noterre.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert_noterre.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/disvert_noterre.f90	(revision 5113)
@@ -295,5 +295,5 @@
 
 
-  implicit none
+  IMPLICIT NONE
   real :: x1, x2, sig,pa,preff, newsig, F
   integer :: j
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxhyp_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxhyp_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxhyp_m.F90	(revision 5113)
@@ -18,5 +18,5 @@
     ! 1., taux=0., clon=0.) est à - 180 degrés.
 
-    use arth_m, only: arth
+    use lmdz_arth, only: arth
     use invert_zoom_x_m, only: invert_zoom_x, nmax
     use nrtype, only: pi, pi_d, twopi, twopi_d, k8
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_int_dyn.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_int_dyn.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/gr_int_dyn.f90	(revision 5113)
@@ -3,5 +3,5 @@
 
 SUBROUTINE gr_int_dyn(champin,champdyn,iim,jp1)
-  implicit none
+  IMPLICIT NONE
   !=======================================================================
   !   passage d'un champ interpole a un champ sur grille scalaire
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigrads.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigrads.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inigrads.f90	(revision 5113)
@@ -5,5 +5,5 @@
         , dt, file, titlel)
 
-  implicit none
+  IMPLICIT NONE
 
   integer :: if, im, jm, lm, i, j, l
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initdynav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initdynav.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initdynav.F90	(revision 5113)
@@ -11,5 +11,5 @@
   USE temps_mod, ONLY: itau_dyn
   
-  implicit none
+  IMPLICIT NONE
 
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initfluxsto.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initfluxsto.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/initfluxsto.f90	(revision 5113)
@@ -11,5 +11,5 @@
   USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inithist.F90	(revision 5113)
@@ -11,5 +11,5 @@
   USE temps_mod, ONLY: itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/inter_barxy_m.F90	(revision 5113)
@@ -6,7 +6,7 @@
   ! Authors: Robert SADOURNY, Phu LE VAN, Lionel GUEZ
 
-  implicit none
-
-  private
+  IMPLICIT NONE
+
+  PRIVATE
   public inter_barxy
 
@@ -15,6 +15,6 @@
   SUBROUTINE inter_barxy(dlonid, dlatid, champ, rlonimod, rlatimod, champint)
 
-    use assert_eq_m, only: assert_eq
-    use assert_m, only: assert
+    use lmdz_assert_eq, only: assert_eq
+    use lmdz_assert, only: assert
 
     include "dimensions.h"
@@ -117,5 +117,5 @@
     !      ( Les abscisses sont exprimees en degres)
 
-    use assert_eq_m, only: assert_eq
+    use lmdz_assert_eq, only: assert_eq
 
     IMPLICIT NONE
@@ -299,5 +299,5 @@
     ! L'indice 1 correspond à l'interface maille 1 -- maille 2.
 
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
 
     IMPLICIT NONE
@@ -373,5 +373,5 @@
     ! Finally, the procedure adds 90° as the last value of the array.
 
-    use assert_eq_m, only: assert_eq
+    use lmdz_assert_eq, only: assert_eq
     use comconst_mod, only: pi
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpost.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpost.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpost.f90	(revision 5113)
@@ -4,5 +4,5 @@
   SUBROUTINE interpost(q,qppm)
 
-   implicit none
+   IMPLICIT NONE
 
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpre.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpre.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/interpre.f90	(revision 5113)
@@ -9,5 +9,5 @@
   USE comvert_mod, ONLY: ap, bp
 
-   implicit none
+   IMPLICIT NONE
 
   include "dimensions.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/invert_zoom_x_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/invert_zoom_x_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/invert_zoom_x_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module invert_zoom_x_m
 
-  implicit none
+  IMPLICIT NONE
 
   INTEGER, PARAMETER:: nmax = 30000
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/iso_verif_dyn.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/iso_verif_dyn.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/iso_verif_dyn.f90	(revision 5113)
@@ -1,12 +1,12 @@
   function iso_verif_noNaN_nostop(x,err_msg)
-    implicit none
-    ! ! si x est NaN, on affiche message
-    ! ! d'erreur et return 1 si erreur
+    IMPLICIT NONE
+    ! si x est NaN, on affiche message
+    ! d'erreur et return 1 si erreur
 
-    ! ! input:
+    ! input:
     real :: x
     character(len=*) :: err_msg ! message d''erreur à afficher
 
-    ! ! output
+    ! output
     real :: borne
     parameter (borne=1e19)
@@ -27,14 +27,14 @@
   function iso_verif_egalite_nostop &
           (a,b,err_msg)
-    implicit none
-    ! ! compare a et b. Si pas egal, on affiche message
-    ! ! d'erreur et stoppe
-    ! ! pour egalite, on verifie erreur absolue et arreur relative
+    IMPLICIT NONE
+    ! compare a et b. Si pas egal, on affiche message
+    ! d'erreur et stoppe
+    ! pour egalite, on verifie erreur absolue et arreur relative
 
-    ! ! input:
+    ! input:
     real :: a, b
     character(len=*) :: err_msg ! message d''erreur à afficher
 
-    ! ! locals
+    ! locals
     real :: errmax ! erreur maximale en absolu.
     real :: errmaxrel ! erreur maximale en relatif autorisée
@@ -42,5 +42,5 @@
     parameter (errmaxrel=1e-3)
 
-    ! ! output
+    ! output
     integer :: iso_verif_egalite_nostop
 
@@ -65,12 +65,12 @@
           (x,iso,q,err_msg)
     USE infotrac, ONLY: isoName, getKey
-    implicit none
+    IMPLICIT NONE
 
-    ! ! input:
+    ! input:
     real :: x,q
     integer :: iso ! 2=HDO, 1=O18
     character(len=*) :: err_msg ! message d''erreur à afficher
 
-    ! ! locals
+    ! locals
     real :: qmin,deltaD
     real :: deltaDmax,deltaDmin,tnat
@@ -78,10 +78,10 @@
     parameter (deltaDmax=200.0,deltaDmin=-999.9)
 
-    ! ! output
+    ! output
     integer :: iso_verif_aberrant_nostop
 
     iso_verif_aberrant_nostop=0
 
-    ! ! verifier que HDO est raisonable
+    ! verifier que HDO est raisonable
      if (q>qmin) then
          IF(getKey('tnat', tnat, isoName(iso))) THEN
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ppm3d.f90	(revision 5113)
@@ -65,5 +65,5 @@
         JNP,j1,NLAY,AP,BP,PT,AE,fill,dum,Umax)
 
-  implicit none
+  IMPLICIT NONE
 
   ! rajout de déclarations
@@ -791,5 +791,5 @@
 SUBROUTINE FZPPM(IMR,JNP,NLAY,j1,DQ,WZ,P,DC,DQDT,AR,AL,A6, &
         flux,wk1,wk2,wz2,delp,KORD)
-  implicit none
+  IMPLICIT NONE
   integer,parameter :: kmax = 150
   real,parameter :: R23 = 2./3., R3 = 1./3.
@@ -966,5 +966,5 @@
 SUBROUTINE xtp(IMR,JNP,IML,j1,j2,JN,JS,PU,DQ,Q,UC, &
         fx1,xmass,IORD)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,IML,j1,j2,JN,JS,IORD
   real :: PU,DQ,Q,UC,fx1,xmass
@@ -1088,5 +1088,5 @@
 !
 SUBROUTINE fxppm(IMR,IML,UT,P,DC,flux,IORD)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,IML,IORD
   real :: UT,P,DC,flux
@@ -1151,5 +1151,5 @@
 !
 SUBROUTINE xmist(IMR,IML,P,DC)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,IML
   real,parameter :: R24 = 1./24.
@@ -1169,5 +1169,5 @@
 SUBROUTINE ytp(IMR,JNP,j1,j2,acosp,RCAP,DQ,P,VC,DC2 &
         ,ymass,fx,A6,AR,AL,JORD)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,j1,j2,JORD
   real :: acosp,RCAP,DQ,P,VC,DC2,ymass,fx,A6,AR,AL
@@ -1239,5 +1239,5 @@
 !
 subroutine  ymist(IMR,JNP,j1,P,DC,ID)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,j1,ID
   real,parameter :: R24 = 1./24.
@@ -1321,5 +1321,5 @@
 !
 SUBROUTINE fyppm(VC,P,DC,flux,IMR,JNP,j1,j2,A6,AR,AL,JORD)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,j1,j2,JORD
   real,parameter :: R3 = 1./3., R23 = 2./3.
@@ -1401,5 +1401,5 @@
 !
   SUBROUTINE yadv(IMR,JNP,j1,j2,p,VA,ady,wk,IAD)
-    implicit none
+    IMPLICIT NONE
     integer :: IMR,JNP,j1,j2,IAD
     REAL :: p(IMR,JNP),ady(IMR,JNP),VA(IMR,JNP)
@@ -1491,5 +1491,5 @@
 !
   SUBROUTINE xadv(IMR,JNP,j1,j2,p,UA,JS,JN,IML,adx,IAD)
-    implicit none
+    IMPLICIT NONE
     INTEGER :: IMR,JNP,j1,j2,JS,JN,IML,IAD
     REAL :: p(IMR,JNP),adx(IMR,JNP),qtmp(-IMR:IMR+IMR),UA(IMR,JNP)
@@ -1584,5 +1584,5 @@
 !
 SUBROUTINE lmtppm(DC,A6,AR,AL,P,IM,LMT)
-  implicit none
+  IMPLICIT NONE
   !
   ! A6 =  CURVATURE OF THE TEST PARABOLA
@@ -1665,5 +1665,5 @@
 !
 SUBROUTINE A2C(U,V,IMR,JMR,j1,j2,CRX,CRY,dtdx5,DTDY5)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JMR,j1,j2
   real :: U(IMR,*),V(IMR,*),CRX(IMR,*),CRY(IMR,*),DTDX5(*),DTDY5
@@ -1687,5 +1687,5 @@
 !
 SUBROUTINE cosa(cosp,cose,JNP,PI,DP)
-  implicit none
+  IMPLICIT NONE
   integer :: JNP
   real :: cosp(*),cose(*),PI,DP
@@ -1720,5 +1720,5 @@
 !
 SUBROUTINE cosc(cosp,cose,JNP,PI,DP)
-  implicit none
+  IMPLICIT NONE
   integer :: JNP
   real :: cosp(*),cose(*),PI,DP
@@ -1853,5 +1853,5 @@
 !
 SUBROUTINE filcr(q,IMR,JNP,j1,j2,cosp,acosp,icr,tiny)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,j1,j2,icr
   real :: q(IMR,*),cosp(*),acosp(*),tiny
@@ -1956,5 +1956,5 @@
 !
 SUBROUTINE filns(q,IMR,JNP,j1,j2,cosp,acosp,ipy,tiny)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,j1,j2,ipy
   real :: q(IMR,*),cosp(*),acosp(*),tiny
@@ -2043,5 +2043,5 @@
 !
 SUBROUTINE filew(q,qtmp,IMR,JNP,j1,j2,ipx,tiny)
-  implicit none
+  IMPLICIT NONE
   integer :: IMR,JNP,j1,j2,ipx
   real :: q(IMR,*),qtmp(JNP,IMR),tiny
@@ -2125,5 +2125,5 @@
 !
 SUBROUTINE zflip(q,im,km,nc)
-  implicit none
+  IMPLICIT NONE
   ! This routine flip the array q (in the vertical).
   integer :: im,km,nc
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/principal_cshift_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/principal_cshift_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/principal_cshift_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module principal_cshift_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/sortvarc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/sortvarc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/sortvarc.f90	(revision 5113)
@@ -160,6 +160,6 @@
   END IF
 
-  ! ! compute relative changes in etot,... (except if 'reference' values
-  ! ! are zero, which can happen when using iniacademic)
+  ! compute relative changes in etot,... (except if 'reference' values
+  ! are zero, which can happen when using iniacademic)
   if (etot0/=0) then
     etot= etot/etot0
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/traceurpole.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/traceurpole.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/traceurpole.f90	(revision 5113)
@@ -4,5 +4,5 @@
     SUBROUTINE traceurpole(q,masse)
 
-      implicit none
+      IMPLICIT NONE
 
   include "dimensions.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/ugeostr.F90	(revision 5113)
@@ -13,5 +13,5 @@
   use comconst_mod, only: omeg, rad
   
-  implicit none
+  IMPLICIT NONE
 
   include "dimensions.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writedynav.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writedynav.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writedynav.F90	(revision 5113)
@@ -9,5 +9,5 @@
   USE temps_mod, ONLY: itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !   Ecriture du fichier histoire au format IOIPSL
Index: LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writehist.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writehist.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3d_common/writehist.f90	(revision 5113)
@@ -9,5 +9,5 @@
   USE temps_mod, ONLY: itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/addfi_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/addfi_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/addfi_loc.f90	(revision 5113)
@@ -159,5 +159,5 @@
 
   if (planet_type=="earth") then
-  ! ! earth case, special treatment for first 2 tracers (water)
+  ! earth case, special treatment for first 2 tracers (water)
   DO iq = 1, 2
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -182,5 +182,5 @@
   ENDDO
   else
-  ! ! general case, treat all tracers equally)
+  ! general case, treat all tracers equally)
    DO iq = 1, nqtot
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/bands.F90	(revision 5113)
@@ -28,5 +28,5 @@
   SUBROUTINE AllocateBands
     USE parallel_lmdz
-    implicit none
+    IMPLICIT NONE
     
     allocate(jj_Nb_Caldyn(0:MPI_Size-1))
@@ -42,5 +42,5 @@
   SUBROUTINE Read_distrib
     USE parallel_lmdz
-    implicit none
+    IMPLICIT NONE
 
     include "dimensions.h"
@@ -177,5 +177,5 @@
       use times
       USE parallel_lmdz
-      implicit none
+      IMPLICIT NONE
       TYPE(distrib),INTENT(INOUT) :: new_dist
 
@@ -244,5 +244,5 @@
       use times
       USE parallel_lmdz
-      implicit none
+      IMPLICIT NONE
       TYPE(distrib),INTENT(INOUT) :: new_dist
 
@@ -313,5 +313,5 @@
       use times
       USE parallel_lmdz
-      implicit none
+      IMPLICIT NONE
       TYPE(distrib),INTENT(INOUT) :: new_dist
       
@@ -387,5 +387,5 @@
 
       USE parallel_lmdz
-      implicit none
+      IMPLICIT NONE
 
       integer :: i,Index
@@ -438,5 +438,5 @@
     SUBROUTINE WriteBands
     USE parallel_lmdz
-    implicit none
+    IMPLICIT NONE
     include "dimensions.h"
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caladvtrac_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caladvtrac_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caladvtrac_loc.f90	(revision 5113)
@@ -54,5 +54,5 @@
   !$OMP THREADPRIVATE(Request_vanleer)
 
-  ! !write(*,*) 'caladvtrac 58: entree'
+  !write(*,*) 'caladvtrac 58: entree'
   ijbu = ij_begin
   ijeu = ij_end
@@ -107,5 +107,5 @@
 
   IF (iadvtr==iapp_tracvl) THEN
-    ! !write(*,*) 'caladvtrac 133'
+    !write(*,*) 'caladvtrac 133'
     !$OMP MASTER
     CALL suspend_timer(timer_caldyn)
@@ -181,9 +181,9 @@
       CALL WriteField_u('wg1', wg_adv)
     END IF
-    ! !write(*,*) 'caladvtrac 185'
+    !write(*,*) 'caladvtrac 185'
     CALL advtrac_loc(pbarug_adv, pbarvg_adv, wg_adv, &
             p_adv, massem_adv, q_adv, teta_adv, &
             pk_adv)
-    ! !write(*,*) 'caladvtrac 189'
+    !write(*,*) 'caladvtrac 189'
 
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caldyn_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caldyn_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/caldyn_loc.f90	(revision 5113)
@@ -66,21 +66,21 @@
   !--------------------------------
 
-  ! ! compute contravariant winds ucont() and vcont
+  ! compute contravariant winds ucont() and vcont
   CALL covcont_loc  (llm, ucov, vcov, ucont, vcont)
-  ! ! compute pressure p()
+  ! compute pressure p()
   CALL pression_loc (ip1jmp1, ap, bp, ps, p)
   !ym      CALL psextbar (   ps   , psexbarxy                          )
   !$OMP BARRIER
-  ! ! compute mass in each atmospheric mesh: masse()
+  ! compute mass in each atmospheric mesh: masse()
   CALL massdair_loc (p, masse)
-  ! ! compute X and Y-averages of mass, massebx() and masseby()
+  ! compute X and Y-averages of mass, massebx() and masseby()
   CALL massbar_loc  (masse, massebx, masseby)
-  ! ! compute XY-average of mass, massebxy()
+  ! compute XY-average of mass, massebxy()
   CALL massbarxy_loc(masse, massebxy)
-  ! ! compute mass fluxes pbaru() and pbarv()
+  ! compute mass fluxes pbaru() and pbarv()
   CALL flumass_loc  (massebx, masseby, vcont, ucont, pbaru, pbarv)
-  ! ! compute dteta() , horizontal converging flux of theta
+  ! compute dteta() , horizontal converging flux of theta
   CALL dteta1_loc   (teta, pbaru, pbarv, dteta)
-  ! ! compute convm(), horizontal converging flux of mass
+  ! compute convm(), horizontal converging flux of mass
   CALL convmas1_loc  (pbaru, pbarv, convm)
   !$OMP BARRIER
@@ -105,5 +105,5 @@
   ijb = ij_begin
   ije = ij_end
-  ! ! compute pressure variation due to mass convergence
+  ! compute pressure variation due to mass convergence
   DO ij = ijb, ije
     dp(ij) = convm(ij, 1) / airesurg(ij)
@@ -112,9 +112,9 @@
   !$OMP BARRIER
 
-  ! ! compute vertical velocity w()
+  ! compute vertical velocity w()
   CALL vitvert_loc (convm, w)
-  ! ! compute potential vorticity vorpot()
+  ! compute potential vorticity vorpot()
   CALL tourpot_loc (vcov, ucov, massebxy, vorpot)
-  ! ! compute rotation induced du() and dv()
+  ! compute rotation induced du() and dv()
   CALL dudv1_loc   (vorpot, pbaru, pbarv, du, dv)
 
@@ -126,9 +126,9 @@
   END IF
 
-  ! ! compute kinetic energy ecin()
+  ! compute kinetic energy ecin()
   CALL enercin_loc (vcov, ucov, vcont, ucont, ecin)
-  ! ! compute Bernouilli function bern()
+  ! compute Bernouilli function bern()
   CALL bernoui_loc (ip1jmp1, llm, phi, ecin, bern)
-  ! ! compute and add du() and dv() contributions from Bernouilli and pressure
+  ! compute and add du() and dv() contributions from Bernouilli and pressure
   CALL dudv2_loc   (teta, pkf, bern, du, dv)
 
@@ -155,5 +155,5 @@
   !$OMP END DO
 
-  ! ! compute vertical advection contributions to du(), dv() and dteta()
+  ! compute vertical advection contributions to du(), dv() and dteta()
   CALL advect_new_loc(ang, vcov, teta, w, massebx, masseby, du, dv, dteta)
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/conf_gcm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/conf_gcm.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/conf_gcm.F90	(revision 5113)
@@ -11,5 +11,5 @@
   USE mod_hallo, ONLY: use_mpi_alloc
   USE infotrac, ONLY: type_trac
-  USE assert_m, ONLY: assert
+  USE lmdz_assert, ONLY: assert
   USE comconst_mod, ONLY: dissip_deltaz, dissip_factz, dissip_zref, &
                           iflag_top_bound, mode_top_bound, tau_top_bound, &
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dissip_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dissip_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dissip_loc.f90	(revision 5113)
@@ -42,5 +42,5 @@
   REAL, INTENT(IN) :: teta(ijb_u:ije_u, llm) ! potential temperature
   REAL, INTENT(IN) :: p(ijb_u:ije_u, llmp1) ! interlayer pressure
-  ! ! tendencies (.../s) on covariant winds and potential temperature
+  ! tendencies (.../s) on covariant winds and potential temperature
   REAL, INTENT(OUT) :: dv(ijb_v:ije_v, llm)
   REAL, INTENT(OUT) :: du(ijb_u:ije_u, llm)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90	(revision 5113)
@@ -13,5 +13,5 @@
   USE readTracFiles_mod, ONLY: new2oldH2O, newHNO3, oldHNO3, getKey
   USE control_mod, ONLY: planet_type
-  USE assert_eq_m, ONLY: assert_eq
+  USE lmdz_assert_eq, ONLY: assert_eq
   USE comvert_mod, ONLY: pa,preff
   USE comconst_mod, ONLY: cpp, daysec, dtvr, g, im, jm, kappa, lllm, omeg, rad
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/filtreg_p.F90	(revision 5113)
@@ -183,9 +183,9 @@
      IF (.NOT. use_filtre_fft) THEN
 
-  ! !---------------------------------!
-  ! ! Agregation des niveau verticaux !
-  ! ! uniquement necessaire pour une  !
-  ! ! execution OpenMP                !
-  ! !---------------------------------!
+  !---------------------------------!
+  ! Agregation des niveau verticaux !
+  ! uniquement necessaire pour une  !
+  ! execution OpenMP                !
+  !---------------------------------!
         ll_nb = 0
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -298,9 +298,9 @@
         IF( ifiltre==2 )  THEN
 
-  ! !-------------------------------------!
-  ! ! Dés-agregation des niveau verticaux !
-  ! ! uniquement necessaire pour une      !
-  ! ! execution OpenMP                    !
-  ! !-------------------------------------!
+  !-------------------------------------!
+  ! Dés-agregation des niveau verticaux !
+  ! uniquement necessaire pour une      !
+  ! execution OpenMP                    !
+  !-------------------------------------!
            ll_nb = 0
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/fluxstokenc_p.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/fluxstokenc_p.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/fluxstokenc_p.f90	(revision 5113)
@@ -44,5 +44,5 @@
 
 
-  ! !write(*,*) 'caladvtrac 58: entree'
+  !write(*,*) 'caladvtrac 58: entree'
   ijbu = ij_begin
   ijeu = ij_end
@@ -99,5 +99,5 @@
 
   IF (pasflx==(iphysiq * istphy)) THEN
-    ! !write(*,*) 'caladvtrac 133'
+    !write(*,*) 'caladvtrac 133'
     !$OMP MASTER
     CALL suspend_timer(timer_caldyn)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/friction_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/friction_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/friction_loc.f90	(revision 5113)
@@ -49,5 +49,5 @@
 !$OMP SINGLE
   IF (firstcall) THEN
-    ! ! set friction type
+    ! set friction type
     CALL getin("friction_type",friction_type)
     if ((friction_type<0).or.(friction_type>1)) then
@@ -168,5 +168,5 @@
 
   if (friction_type==1) then
-   ! ! for ucov()
+   ! for ucov()
     jjb=jj_begin
     jje=jj_end
@@ -181,5 +181,5 @@
 !$OMP END DO NOWAIT
 
-   ! ! for vcoc()
+   ! for vcoc()
     jjb=jj_begin
     jje=jj_end
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/getparam.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/getparam.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/getparam.F90	(revision 5113)
@@ -8,5 +8,5 @@
      MODULE PROCEDURE getparamr,getparami,getparaml
    END INTERFACE
-   private getparamr,getparami,getparaml
+   PRIVATE getparamr,getparami,getparaml
 
    INTEGER, PARAMETER :: out_eff=99
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/groupe_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/groupe_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/groupe_loc.f90	(revision 5113)
@@ -5,5 +5,5 @@
   USE comconst_mod, ONLY: ngroup
   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO
-  implicit none
+  IMPLICIT NONE
 
   !   sous-programme servant a fitlrer les champs de flux de masse aux
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/guide_loc_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/guide_loc_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/guide_loc_mod.F90	(revision 5113)
@@ -1406,5 +1406,5 @@
     use serre_mod, only: clat, clon, grossismx, grossismy
     
-    implicit none
+    IMPLICIT NONE
 
     include "dimensions.h"
@@ -2392,5 +2392,5 @@
 use parallel_lmdz
 use mod_hallo
-implicit none
+IMPLICIT NONE
 include 'dimensions.h'
 include 'paramet.h'
@@ -2422,5 +2422,5 @@
 !====================================================================
 SUBROUTINE dumpall
-     implicit none
+     IMPLICIT NONE
      include "dimensions.h"
      include "paramet.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.f90	(revision 5113)
@@ -16,5 +16,5 @@
    USE temps_mod, ONLY: itau_dyn
 
-   implicit none
+   IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.f90	(revision 5113)
@@ -15,5 +15,5 @@
    USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F90	(revision 5113)
@@ -14,5 +14,5 @@
   USE temps_mod, ONLY: itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/integrd_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/integrd_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/integrd_loc.f90	(revision 5113)
@@ -52,5 +52,5 @@
   REAL,INTENT(INOUT) :: masse(ijb_u:ije_u,llm) ! atmospheric mass
   REAL,INTENT(INOUT) :: phis(ijb_u:ije_u) ! ground geopotential !!! unused
-  ! ! values at previous time step
+  ! values at previous time step
   REAL,INTENT(INOUT) :: vcovm1(ijb_v:ije_v,llm)
   REAL,INTENT(INOUT) :: ucovm1(ijb_u:ije_u,llm)
@@ -58,5 +58,5 @@
   REAL,INTENT(INOUT) :: psm1(ijb_u:ije_u)
   REAL,INTENT(INOUT) :: massem1(ijb_u:ije_u,llm)
-  ! ! the tendencies to add
+  ! the tendencies to add
   REAL,INTENT(INOUT) :: dv(ijb_v:ije_v,llm)
   REAL,INTENT(INOUT) :: du(ijb_u:ije_u,llm)
@@ -86,5 +86,5 @@
   INTEGER :: ierr
 
-  ! !write(*,*) 'integrd 88: entree, nq=',nq
+  !write(*,*) 'integrd 88: entree, nq=',nq
   !-----------------------------------------------------------------------
 
@@ -153,5 +153,5 @@
      write(lunout,*) "integrd: ps = ", ps(stop_it)
      write(lunout,*) " at node ij =", stop_it
-     ! ! since ij=j+(i-1)*jjp1 , we have
+     ! since ij=j+(i-1)*jjp1 , we have
       j=modulo(stop_it,jjp1)
       i=1+(stop_it-j)/jjp1
@@ -163,5 +163,5 @@
 !$OMP END MASTER
 !$OMP BARRIER
-    ! !write(*,*) 'integrd 170'
+    !write(*,*) 'integrd 170'
   IF (.NOT. Checksum_all) THEN
     CALL WriteField_v('int_vcov',vcov)
@@ -220,5 +220,5 @@
 !$OMP END MASTER
 !$OMP BARRIER
-  ! !write(*,*) 'integrd 217'
+  !write(*,*) 'integrd 217'
   !
   !  ... Calcul  de la nouvelle masse d'air au dernier temps integre t+1 ...
@@ -349,7 +349,7 @@
     CALL check_isotopes(q,ijb,ije,'integrd 342')
 
-    ! !write(*,*) 'integrd 341'
+    !write(*,*) 'integrd 341'
     CALL qminimum_loc( q, nq, deltap )
-    ! !write(*,*) 'integrd 343'
+    !write(*,*) 'integrd 343'
 
     CALL check_isotopes(q,ijb,ije,'integrd 346')
@@ -421,5 +421,5 @@
   ! .....   FIN  de l'integration  de   q    .......
 
-      ! !write(*,*) 'integrd 410'
+      !write(*,*) 'integrd 410'
 
 !$OMP DO SCHEDULE(STATIC)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90	(revision 5113)
@@ -432,5 +432,5 @@
 
   IF(purmats) THEN
-    ! ! Purely Matsuno time stepping
+    ! Purely Matsuno time stepping
     IF(MOD(itau, iconser) ==0.AND.  forward) conser = .TRUE.
     IF(MOD(itau, dissip_period)==0.AND..NOT.forward) &
@@ -439,5 +439,5 @@
             .and. physic) apphys = .TRUE.
   ELSE
-    ! ! Leapfrog/Matsuno time stepping
+    ! Leapfrog/Matsuno time stepping
     IF(MOD(itau, iconser) == 0) conser = .TRUE.
     IF(MOD(itau + 1, dissip_period)==0 .AND. .NOT. forward) &
@@ -652,5 +652,5 @@
   CALL start_timer(timer_caldyn)
 
-  ! ! compute geopotential phi()
+  ! compute geopotential phi()
   CALL geopot_loc  (ip1jmp1, teta, pk, pks, phis, phi)
 
@@ -699,5 +699,5 @@
   IF(forward .OR.  leapf)  THEN
     ! Ehouarn: NB: fields sent to advtrac are those at the beginning of the time step
-    ! !write(*,*) 'leapfrog 679: avant CALL caladvtrac_loc'
+    !write(*,*) 'leapfrog 679: avant CALL caladvtrac_loc'
     CALL caladvtrac_loc(q, pbaru, pbarv, &
             p, masse, dq, teta, &
@@ -709,5 +709,5 @@
     ENDIF
 
-    ! !write(*,*) 'leapfrog 719'
+    !write(*,*) 'leapfrog 719'
     CALL check_isotopes(q, ijb_u, ije_u, &
             'leapfrog 698: apres caladvtrac')
@@ -744,8 +744,8 @@
   ! CALL FTRACE_REGION_BEGIN("integrd")
 
-  ! !write(*,*) 'leapfrog 720'
+  !write(*,*) 'leapfrog 720'
   CALL check_isotopes(q, ijb_u, ije_u, 'leapfrog 756')
 
-  ! ! CRisi: pourquoi aller jusqu'à 2 et non pas jusqu'à nqtot??
+  ! CRisi: pourquoi aller jusqu'à 2 et non pas jusqu'à nqtot??
   CALL integrd_loc (nqtot, vcovm1, ucovm1, tetam1, psm1, massem1, &
           dv, du, dteta, dq, dp, vcov, ucov, teta, q, ps, masse, phis)
@@ -812,5 +812,5 @@
 
   CALL check_isotopes(q, ijb_u, ije_u, 'leapfrog 1132')
-  ! !write(*,*) 'leapfrog 1134: iflag_phys=',iflag_phys
+  !write(*,*) 'leapfrog 1134: iflag_phys=',iflag_phys
 
   IF(iflag_phys==2) THEN ! "Newtonian" case
@@ -841,5 +841,5 @@
     !$OMP MASTER
     if (planet_type=="giant") then
-      ! ! add an intrinsic heat flux at the base of the atmosphere
+      ! add an intrinsic heat flux at the base of the atmosphere
       teta(ijb:ije, 1) = teta(ijb:ije, 1) &
               + dtvr * aire(ijb:ije) * ihf / cpp / masse(ijb:ije, 1)
@@ -857,5 +857,5 @@
     !$OMP BARRIER
 
-    ! ! Sponge layer (if any)
+    ! Sponge layer (if any)
     IF (ok_strato) THEN
       CALL top_bound_loc(vcov, ucov, teta, masse, dtvr)
@@ -948,6 +948,6 @@
 
     if (ok_guide) then
-      ! ! set ok_guide to false to avoid extra output
-      ! ! in following forward step
+      ! set ok_guide to false to avoid extra output
+      ! in following forward step
       ok_guide = .FALSE.
     endif
@@ -1039,5 +1039,5 @@
       ENDIF
 
-      ! ! Ehouarn: re-compute geopotential for outputs
+      ! Ehouarn: re-compute geopotential for outputs
       !$OMP BARRIER
       !$OMP MASTER
@@ -1067,5 +1067,5 @@
 
     IF(MOD(itau, iecri)==0) THEN
-      ! ! Ehouarn: output only during LF or Backward Matsuno
+      ! Ehouarn: output only during LF or Backward Matsuno
       if (leapf.or.(.not.leapf.and.(.not.forward))) then
 
@@ -1104,6 +1104,6 @@
       ! endif ! of if (planet_type.eq."earth")
       if (ok_guide) then
-        ! ! set ok_guide to false to avoid extra output
-        ! ! in following forward step
+        ! set ok_guide to false to avoid extra output
+        ! in following forward step
         ok_guide = .FALSE.
       endif
@@ -1144,5 +1144,5 @@
       GO TO 2
     END IF ! of IF (MOD(itau,iperiod).EQ.0)
-    ! !    ELSEIF (MOD(itau-1,iperiod).EQ.0)
+    !    ELSEIF (MOD(itau-1,iperiod).EQ.0)
 
   ELSE ! of IF (.not.purmats)
@@ -1203,5 +1203,5 @@
         ENDIF
 
-          ! ! Ehouarn: re-compute geopotential for outputs
+          ! Ehouarn: re-compute geopotential for outputs
 !$OMP BARRIER
 !$OMP MASTER
@@ -1253,6 +1253,6 @@
         ! endif ! of if (planet_type.eq."earth")
         if (ok_guide) then
-          ! ! set ok_guide to false to avoid extra output
-          ! ! in following forward step
+          ! set ok_guide to false to avoid extra output
+          ! in following forward step
           ok_guide = .FALSE.
         endif
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/lmdz_filtreg_p.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/lmdz_filtreg_p.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/lmdz_filtreg_p.F90	(revision 5113)
@@ -186,9 +186,9 @@
       IF (.NOT. use_filtre_fft) THEN
 
-        ! !---------------------------------!
-        ! ! Agregation des niveau verticaux !
-        ! ! uniquement necessaire pour une  !
-        ! ! execution OpenMP                !
-        ! !---------------------------------!
+        !---------------------------------!
+        ! Agregation des niveau verticaux !
+        ! uniquement necessaire pour une  !
+        ! execution OpenMP                !
+        !---------------------------------!
         ll_nb = 0
         !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -304,9 +304,9 @@
         IF(ifiltre==2)  THEN
 
-          ! !-------------------------------------!
-          ! ! DÃ©s-agregation des niveau verticaux !
-          ! ! uniquement necessaire pour une      !
-          ! ! execution OpenMP                    !
-          ! !-------------------------------------!
+          !-------------------------------------!
+          ! DÃ©s-agregation des niveau verticaux !
+          ! uniquement necessaire pour une      !
+          ! execution OpenMP                    !
+          !-------------------------------------!
           ll_nb = 0
           !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -344,5 +344,5 @@
         DO l = 1, nbniv
           DO j = jdfil, jffil
-            ! ! add redundant longitude
+            ! add redundant longitude
             champ(iip1, j, l) = champ(1, j, l)
           ENDDO
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_hallo.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_hallo.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/mod_hallo.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module mod_Hallo
 USE parallel_lmdz
-implicit none
+IMPLICIT NONE
   logical,save :: use_mpi_alloc
   integer, parameter :: MaxProc=512
@@ -70,5 +70,5 @@
   USE dimensions_mod
   USE IOIPSL
-    implicit none
+    IMPLICIT NONE
     integer :: jj_nb_gather(0:mpi_size-1)
     
@@ -138,5 +138,5 @@
       
   SUBROUTINE allocate_buffer(Size,Index,Pos)
-  implicit none
+  IMPLICIT NONE
     integer :: Size
     integer :: Index
@@ -162,5 +162,5 @@
      
   SUBROUTINE deallocate_buffer(Index)
-  implicit none
+  IMPLICIT NONE
     integer :: Index
     
@@ -174,5 +174,5 @@
   
   SUBROUTINE SetTag(a_request,tag)
-  implicit none
+  IMPLICIT NONE
     type(request):: a_request
     integer :: tag
@@ -216,5 +216,5 @@
   SUBROUTINE Register_SendField(Field,ij,ll,offset,size,target,a_request)
   USE dimensions_mod
-  implicit none
+  IMPLICIT NONE
 
     
@@ -232,5 +232,5 @@
   SUBROUTINE Register_RecvField(Field,ij,ll,offset,size,target,a_request)
   USE dimensions_mod
-  implicit none
+  IMPLICIT NONE
 
    
@@ -249,5 +249,5 @@
   SUBROUTINE Register_SwapField(FieldS,FieldR,ij,ll,jj_Nb_New,a_request)
   USE dimensions_mod
-      implicit none
+      IMPLICIT NONE
 
     
@@ -298,5 +298,5 @@
   USE dimensions_mod
   
-      implicit none
+      IMPLICIT NONE
     
     INTEGER :: ij,ll,Up,Down
@@ -1150,5 +1150,5 @@
   USE dimensions_mod
   USE lmdz_mpi
-      implicit none
+      IMPLICIT NONE
 
       INTEGER :: ij,ll
@@ -1215,5 +1215,5 @@
   USE dimensions_mod
   USE lmdz_mpi
-      implicit none
+      IMPLICIT NONE
       INTEGER :: ll
       REAL, dimension(ijb_u:ije_u,ll) :: Field
@@ -1278,5 +1278,5 @@
   USE dimensions_mod
   USE lmdz_mpi
-      implicit none
+      IMPLICIT NONE
       INTEGER :: ll
       REAL, dimension(ijb_v:ije_v,ll) :: Field
@@ -1341,5 +1341,5 @@
     USE dimensions_mod
     USE lmdz_mpi
-      implicit none
+      IMPLICIT NONE
 
       type(request),target :: a_request
@@ -1459,5 +1459,5 @@
    USE dimensions_mod
    USE lmdz_mpi
-   implicit none
+   IMPLICIT NONE
       
       type(request),target :: a_request
@@ -1544,5 +1544,5 @@
    USE lmdz_mpi
    USE dimensions_mod
-   implicit none
+   IMPLICIT NONE
    
       type(request),target :: a_request
@@ -1592,5 +1592,5 @@
    USE dimensions_mod
    USE lmdz_mpi
-   implicit none
+   IMPLICIT NONE
       type(request),target :: a_request
       type(request_SR),pointer :: Req
@@ -1663,5 +1663,5 @@
     USE dimensions_mod
   
-      implicit none
+      IMPLICIT NONE
     
     INTEGER :: ij,ll,l
@@ -1701,5 +1701,5 @@
   USE dimensions_mod
   
-      implicit none
+      IMPLICIT NONE
     
     INTEGER :: ij,ll,Up,Down
@@ -1740,5 +1740,5 @@
    SUBROUTINE Gather_field_u(field_loc,field_glo,ll)
    USE dimensions_mod
-   implicit none
+   IMPLICIT NONE
      integer :: ll
      real :: field_loc(ijb_u:ije_u,ll)
@@ -1763,5 +1763,5 @@
    SUBROUTINE Gather_field_v(field_loc,field_glo,ll)
    USE dimensions_mod
-   implicit none
+   IMPLICIT NONE
      integer :: ll
      real :: field_loc(ijb_v:ije_v,ll)
@@ -1791,5 +1791,5 @@
    SUBROUTINE Scatter_field_u(field_glo,field_loc,ll)
    USE dimensions_mod
-   implicit none
+   IMPLICIT NONE
      integer :: ll
      real :: field_glo(ip1jmp1,ll)
@@ -1825,5 +1825,5 @@
    SUBROUTINE Scatter_field_v(field_glo,field_loc,ll)
    USE dimensions_mod
-   implicit none
+   IMPLICIT NONE
      integer :: ll
      real :: field_glo(ip1jmp1,ll)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/parallel_lmdz.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/parallel_lmdz.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/parallel_lmdz.F90	(revision 5113)
@@ -84,5 +84,5 @@
     USE vampir
     USE lmdz_mpi
-    implicit none
+    IMPLICIT NONE
       INCLUDE "dimensions.h"
       INCLUDE "paramet.h"
@@ -391,7 +391,7 @@
 ! Ehouarn: surface_data module is in 'phylmd' ...
       use surface_data, ONLY: type_ocean
-      implicit none
+      IMPLICIT NONE
 #else
-      implicit none
+      IMPLICIT NONE
 ! without the surface_data module, we declare (and set) a dummy 'type_ocean'
       character(len=6),parameter :: type_ocean="dummy"
@@ -437,5 +437,5 @@
         
     SUBROUTINE Pack_Data(Field,ij,ll,row,Buffer)
-    implicit none
+    IMPLICIT NONE
 
       INCLUDE "dimensions.h"
@@ -460,5 +460,5 @@
      
     SUBROUTINE Unpack_Data(Field,ij,ll,row,Buffer)
-    implicit none
+    IMPLICIT NONE
 
       INCLUDE "dimensions.h"
@@ -499,5 +499,5 @@
     USE lmdz_mpi
     USE Vampir
-    implicit none
+    IMPLICIT NONE
       INCLUDE "dimensions.h"
       INCLUDE "paramet.h"    
@@ -616,5 +616,5 @@
     SUBROUTINE Gather_Field(Field,ij,ll,rank)
     USE lmdz_mpi
-    implicit none
+    IMPLICIT NONE
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h" 
@@ -696,5 +696,5 @@
     SUBROUTINE AllGather_Field(Field,ij,ll)
     USE lmdz_mpi
-    implicit none
+    IMPLICIT NONE
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h"    
@@ -714,5 +714,5 @@
    SUBROUTINE Broadcast_Field(Field,ij,ll,rank)
     USE lmdz_mpi
-    implicit none
+    IMPLICIT NONE
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h"    
@@ -734,5 +734,5 @@
 !  Subroutine verif_hallo(Field,ij,ll,up,down)
 !    USE lmdz_mpi
-!    implicit none
+!    IMPLICIT NONE
 !      INCLUDE "dimensions.h"
 !      INCLUDE "paramet.h"    
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/qminimum_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/qminimum_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/qminimum_loc.f90	(revision 5113)
@@ -55,5 +55,5 @@
 !$OMP BARRIER
 
-  ! !write(lunout,*) 'qminimum 52: entree'
+  !write(lunout,*) 'qminimum 52: entree'
   IF(first) THEN
      iq_vap = strIdx(tracers(:)%name, addPhase('H2O', 'g'))
@@ -83,5 +83,5 @@
   ENDDO
 
-  ! !write(lunout,*) 'qminimum 57'
+  !write(lunout,*) 'qminimum 57'
   DO k = 1, llm
 !$OMP DO SCHEDULE(STATIC)
@@ -103,5 +103,5 @@
   ! le defaut en prennant de l'eau vapeur de la couche au-dessous.
   !
-  ! !write(lunout,*) 'qminimum 81'
+  !write(lunout,*) 'qminimum 81'
   DO k = llm, 2, -1
   !cc      zx_abc = dpres(k) / dpres(k-1)
@@ -127,5 +127,5 @@
   ! doit imprimer un message d'avertissement (saturation possible).
   !
-  ! !write(lunout,*) 'qminimum 106'
+  !write(lunout,*) 'qminimum 106'
   nb_pump=0
 !$OMP DO SCHEDULE(STATIC)
@@ -149,19 +149,19 @@
   ENDIF
 
-  ! !write(lunout,*) 'qminimum 128'
+  !write(lunout,*) 'qminimum 128'
   if (niso > 0) then
-          ! !write(lunout,*) 'qminimum 140'
-  ! ! CRisi: traiter de même les traceurs d'eau
-  ! ! Mais il faut les prendre à l'envers pour essayer de conserver la
-  ! ! masse.
-  ! ! 1) pompage dans le sol
-  ! ! On suppose que ce pompage se fait sans isotopes -> on ne modifie
-  ! ! rien ici et on croise les doigts pour que ça ne soit pas trop
-  ! ! génant
-  ! ! en fait, si, c'est genant quand les isotopes doivent eux même transporter des
-  ! ! traceurs -> apporter aussi un peu d'isotopes... Combien?
-  ! ! Essayer tnat/2 = -500 permil? C'est déjà mieux que -1000
-  ! ! permil...
-  ! ! pb: que faire pour les traceurs?
+          !write(lunout,*) 'qminimum 140'
+  ! CRisi: traiter de même les traceurs d'eau
+  ! Mais il faut les prendre à l'envers pour essayer de conserver la
+  ! masse.
+  ! 1) pompage dans le sol
+  ! On suppose que ce pompage se fait sans isotopes -> on ne modifie
+  ! rien ici et on croise les doigts pour que ça ne soit pas trop
+  ! génant
+  ! en fait, si, c'est genant quand les isotopes doivent eux même transporter des
+  ! traceurs -> apporter aussi un peu d'isotopes... Combien?
+  ! Essayer tnat/2 = -500 permil? C'est déjà mieux que -1000
+  ! permil...
+  ! pb: que faire pour les traceurs?
 !$OMP DO SCHEDULE(STATIC)
   DO i = ijb, ije
@@ -172,11 +172,11 @@
 !$OMP END DO NOWAIT
 
-  ! ! 2) transfert de vap vers les couches plus hautes
-  ! !write(lunout,*) 'qminimum 158'
+  ! 2) transfert de vap vers les couches plus hautes
+  !write(lunout,*) 'qminimum 158'
   do k=2,llm
 !$OMP DO SCHEDULE(STATIC)
     DO i = ijb, ije
       if (zx_defau_diag(i,k,1)>0.0) then
-          ! ! on ajoute la vapeur en k
+          ! on ajoute la vapeur en k
           !  write(lunout,*) 'i,k,q_follow(i,k-1,ivap)=',
   ! :                 i,k,q_follow(i,k-1,1)
@@ -218,5 +218,5 @@
           endif
 
-          ! ! et on la retranche en k-1
+          ! et on la retranche en k-1
            q(i,k-1,iqIsoPha(ixt,iq_vap)) = &
                  q(i,k-1,iqIsoPha(ixt,iq_vap)) &
@@ -257,6 +257,6 @@
 
 
-    ! ! 3) transfert d'eau de la vapeur au liquide
-    ! !write(*,*) 'qminimum 164'
+    ! 3) transfert d'eau de la vapeur au liquide
+    !write(*,*) 'qminimum 164'
     do k=1,llm
 !$OMP DO SCHEDULE(STATIC)
@@ -264,10 +264,10 @@
       if (zx_defau_diag(i,k,2)>0.0) then
 
-          ! ! on ajoute eau liquide en k en k
+          ! on ajoute eau liquide en k en k
           do ixt=1,ntiso
            q(i,k,iqIsoPha(ixt,iq_liq))=q(i,k,iqIsoPha(ixt,iq_liq)) &
                  +zx_defau_diag(i,k,2) &
                  *q(i,k,iqIsoPha(ixt,iq_vap))/q_follow(i,k,1)
-          ! ! et on la retranche à la vapeur en k
+          ! et on la retranche à la vapeur en k
            q(i,k,iqIsoPha(ixt,iq_vap))=q(i,k,iqIsoPha(ixt,iq_vap)) &
                  -zx_defau_diag(i,k,2) &
@@ -286,5 +286,5 @@
 
   endif !if (niso > 0) then
-  ! !write(*,*) 'qminimum 188'
+  !write(*,*) 'qminimum 188'
 !$OMP BARRIER
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/sw_case_williamson91_6_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/sw_case_williamson91_6_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/sw_case_williamson91_6_loc.f90	(revision 5113)
@@ -82,5 +82,5 @@
 
 
-   ! ! allocate (global) arrays
+   ! allocate (global) arrays
    allocate(vcov_glo(ip1jm,llm))
    allocate(ucov_glo(ip1jmp1,llm))
@@ -166,5 +166,5 @@
   CALL massdair(p,masse_glo)
 
-  ! ! copy data from global array to local array:
+  ! copy data from global array to local array:
   teta(ijb_u:ije_u,:)=teta_glo(ijb_u:ije_u,:)
   ucov(ijb_u:ije_u,:)=ucov_glo(ijb_u:ije_u,:)
@@ -173,5 +173,5 @@
   ps(ijb_u:ije_u)=ps_glo(ijb_u:ije_u)
 
-  ! ! cleanup
+  ! cleanup
   deallocate(teta_glo)
   deallocate(ucov_glo)
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/times.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/times.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/times.F90	(revision 5113)
@@ -1,6 +1,6 @@
 module times
-  integer,private,save :: Last_Count=0
-  real, private,save :: Last_cpuCount=0
-  logical, private,save :: AllTimer_IsActive=.FALSE.
+  integer,PRIVATE,save :: Last_Count=0
+  real, PRIVATE,save :: Last_cpuCount=0
+  logical, PRIVATE,save :: AllTimer_IsActive=.FALSE.
   
   integer, parameter :: nb_timer = 4
@@ -26,5 +26,5 @@
   SUBROUTINE init_timer
     USE parallel_lmdz
-    implicit none
+    IMPLICIT NONE
     INCLUDE "dimensions.h"
     INCLUDE "paramet.h"
@@ -49,5 +49,5 @@
   
   SUBROUTINE start_timer(no_timer)
-    implicit none
+    IMPLICIT NONE
     integer :: no_timer
     
@@ -68,5 +68,5 @@
   
   SUBROUTINE suspend_timer(no_timer)
-    implicit none
+    IMPLICIT NONE
     integer :: no_timer
      
@@ -85,5 +85,5 @@
   
   SUBROUTINE resume_timer(no_timer)
-    implicit none
+    IMPLICIT NONE
     integer :: no_timer
      
@@ -102,5 +102,5 @@
   SUBROUTINE stop_timer(no_timer)
     USE parallel_lmdz
-    implicit none
+    IMPLICIT NONE
     integer :: no_timer
     integer :: N
@@ -138,5 +138,5 @@
     USE parallel_lmdz
     USE lmdz_mpi
-    implicit none
+    IMPLICIT NONE
 
     integer :: ierr
@@ -168,5 +168,5 @@
     USE parallel_lmdz
     USE lmdz_mpi
-    implicit none
+    IMPLICIT NONE
     integer :: ierr
     integer :: data_size
@@ -198,5 +198,5 @@
   
   SUBROUTINE InitTime
-  implicit none
+  IMPLICIT NONE
     integer :: count,count_rate,count_max
     
@@ -210,5 +210,5 @@
   
   function DiffTime()
-  implicit none
+  IMPLICIT NONE
     double precision :: DiffTime
     integer :: count,count_rate,count_max
@@ -224,5 +224,5 @@
   
   function DiffCpuTime()
-  implicit none
+  IMPLICIT NONE
     real :: DiffCpuTime
     real :: Count
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/top_bound_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/top_bound_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/top_bound_loc.f90	(revision 5113)
@@ -124,5 +124,5 @@
   CALL massbar_loc(masse,massebx,masseby)
 
-  ! ! compute zonal average of vcov (or set it to zero)
+  ! compute zonal average of vcov (or set it to zero)
   if (mode_top_bound>=2) then
    jjb=jj_begin
@@ -152,5 +152,5 @@
   endif ! of if (mode_top_bound.ge.2)
 
-  ! ! compute zonal average of u (or set it to zero)
+  ! compute zonal average of u (or set it to zero)
   if (mode_top_bound>=2) then
    jjb=jj_begin
@@ -179,5 +179,5 @@
   endif ! of if (mode_top_bound.ge.2)
 
-  ! ! compute zonal average of potential temperature, if necessary
+  ! compute zonal average of potential temperature, if necessary
   if (mode_top_bound>=3) then
    jjb=jj_begin
@@ -201,5 +201,5 @@
 
   if (mode_top_bound>=1) then
-   ! ! Apply sponge quenching on vcov:
+   ! Apply sponge quenching on vcov:
    jjb=jj_begin
    jje=jj_end
@@ -217,5 +217,5 @@
 !$OMP END DO NOWAIT
 
-   ! ! Apply sponge quenching on ucov:
+   ! Apply sponge quenching on ucov:
    jjb=jj_begin
    jje=jj_end
@@ -236,5 +236,5 @@
 
   if (mode_top_bound>=3) then
-   ! ! Apply sponge quenching on teta:
+   ! Apply sponge quenching on teta:
    jjb=jj_begin
    jje=jj_end
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlsplt_loc.f90	(revision 5113)
@@ -53,5 +53,5 @@
   INTEGER :: ijb, ije, ijb_x, ije_x
 
-  ! !write(*,*) 'vlsplt 58: entree dans vlx_loc, iq,ijb_x=',
+  !write(*,*) 'vlsplt 58: entree dans vlx_loc, iq,ijb_x=',
   ! &   iq,ijb_x
   !   calcul de la pente a droite et a gauche de la maille
@@ -68,5 +68,5 @@
     !   calcul des pentes avec limitation, Van Leer scheme I:
     !   -----------------------------------------------------
-    ! ! on a besoin de q entre ijb et ije
+    ! on a besoin de q entre ijb et ije
     !   calcul de la pente aux points u
     !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
@@ -145,5 +145,5 @@
   ENDIF ! (pente_max.lt.-1.e-5)
 
-  ! !write(*,*) 'vlx 156: iq,ijb_x=',iq,ijb_x
+  !write(*,*) 'vlx 156: iq,ijb_x=',iq,ijb_x
 
   !   bouclage de la pente en iip1:
@@ -169,5 +169,5 @@
   ! PRINT*,'Cumule ....'
   !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
-  ! ! on a besoin de masse entre ijb et ije
+  ! on a besoin de masse entre ijb et ije
   DO l = 1, llm
     DO ij = ijb, ije - 1
@@ -244,5 +244,5 @@
       ENDDO
       niju = iju
-      ! !PRINT*,'vlx 278, niju,nl',niju,nl(l)
+      !PRINT*,'vlx 278, niju,nl',niju,nl(l)
 
       !  traitement des mailles
@@ -302,14 +302,14 @@
 
   do ifils = 1, tracers(iq)%nqDescen
-    ! ! attention: comme Ratio est utilisé comme q dans l'appel
-    ! ! recursif, il doit contenir à lui seul tous les indices de tous
-    ! ! les descendants!
+    ! attention: comme Ratio est utilisé comme q dans l'appel
+    ! recursif, il doit contenir à lui seul tous les indices de tous
+    ! les descendants!
     iq2 = tracers(iq)%iqDescen(ifils)
     !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     DO l = 1, llm
       DO ij = ijb, ije
-        ! ! On a besoin de q et masse seulement entre ijb et ije. On ne
-        ! ! les calcule donc que de ijb à ije
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        ! On a besoin de q et masse seulement entre ijb et ije. On ne
+        ! les calcule donc que de ijb à ije
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         masse(ij, l, iq2) = max(masse(ij, l, iq) * q(ij, l, iq), min_qMass)
         if (q(ij, l, iq)>min_qParent) then ! modif 13 nov 2020
@@ -333,5 +333,5 @@
   DO l = 1, llm
     DO ij = ijb + 1, ije
-      ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+      !MVals: veiller a ce qu'on n'ait pas de denominateur nul
       new_m = max(masse(ij, l, iq) + u_m(ij - 1, l) - u_m(ij, l), min_qMass)
       q(ij, l, iq) = (q(ij, l, iq) * masse(ij, l, iq) + &
@@ -349,6 +349,6 @@
 
   ! retablir les fils en rapport de melange par rapport a l'air:
-  ! ! On calcule q entre ijb+1 et ije -> on fait pareil pour ratio
-  ! ! puis on boucle en longitude
+  ! On calcule q entre ijb+1 et ije -> on fait pareil pour ratio
+  ! puis on boucle en longitude
   do ifils = 1, tracers(iq)%nqDescen
     iq2 = tracers(iq)%iqDescen(ifils)
@@ -495,7 +495,7 @@
     if (pole_sud)  ije = ij_end - iip1
 
-    ! ! on a besoin de q entre ij_begin-2*iip1 et ij_end+2*iip1
-    ! ! Si pole sud, entre ij_begin-2*iip1 et ij_end
-    ! ! Si pole Nord, entre ij_begin et ij_end+2*iip1
+    ! on a besoin de q entre ij_begin-2*iip1 et ij_end+2*iip1
+    ! Si pole sud, entre ij_begin-2*iip1 et ij_end
+    ! Si pole Nord, entre ij_begin et ij_end+2*iip1
     DO ij = ijb, ije
       dyqv(ij) = q(ij, l, iq) - q(ij + iip1, l, iq)
@@ -706,14 +706,14 @@
     !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     DO l = 1, llm
-      ! ! modif des bornes: CRisi 16 nov 2020
-      ! ! d'abord masse avec bornes corrigées
+      ! modif des bornes: CRisi 16 nov 2020
+      ! d'abord masse avec bornes corrigées
       DO ij = ijbm, ijem
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         masse(ij, l, iq2) = max(masse(ij, l, iq) * q(ij, l, iq), min_qMass)
       enddo
 
-      ! ! ensuite Ratio avec anciennes bornes
+      ! ensuite Ratio avec anciennes bornes
       DO ij = ijb, ije
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         if (q(ij, l, iq)>min_qParent) then ! modif 13 nov 2020
           Ratio(ij, l, iq2) = q(ij, l, iq2) / q(ij, l, iq)
@@ -859,7 +859,7 @@
   !$OMP THREADPRIVATE(first)
 
-  ! !REAL masseq(ijb_u:ije_u,llm,nqtot),Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
-  ! ! Ces varibles doivent être déclarées en pointer et en save dans
-  ! ! vlz_loc si on veut qu'elles soient vues par tous les threads.
+  !REAL masseq(ijb_u:ije_u,llm,nqtot),Ratio(ijb_u:ije_u,llm,nqtot) ! CRisi
+  ! Ces varibles doivent être déclarées en pointer et en save dans
+  ! vlz_loc si on veut qu'elles soient vues par tous les threads.
   INTEGER :: ifils, iq2 ! CRisi
 
@@ -870,5 +870,5 @@
   !    sens de W
 
-  ! !write(*,*) 'vlsplt 926: entree dans vlz_loc, iq=',iq
+  !write(*,*) 'vlsplt 926: entree dans vlz_loc, iq=',iq
 
   ijb = ijb_x
@@ -954,5 +954,5 @@
     ENDDO
     !$OMP END DO NOWAIT
-    ! !write(*,*) 'vlz 1001'
+    !write(*,*) 'vlz 1001'
 
   ELSE ! countcfl>=1
@@ -1013,6 +1013,6 @@
               lorig(ij, l) = lorig(ij, l) - 1
             ENDIF
-            ! ! CRisi 24nov2020: ajout d'un message d'erreur clair au lieu d'un plantage
-            ! ! pour seg fault
+            ! CRisi 24nov2020: ajout d'un message d'erreur clair au lieu d'un plantage
+            ! pour seg fault
             if (lorig(ij, l)==0) then
               CALL abort_gcm("vlz in vlsplt_loc", &
@@ -1064,5 +1064,5 @@
     DO l = 1, llm
       DO ij = ijb, ije
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         masse(ij, l, iq2) = max(masse(ij, l, iq) * q(ij, l, iq), min_qMass)
         if (q(ij, l, iq)>min_qParent) then
@@ -1071,5 +1071,5 @@
           Ratio(ij, l, iq2) = min_ratio
         endif
-        ! !wq(ij,l,iq2)=wq(ij,l,iq) ! correction bug le 15mai2015
+        !wq(ij,l,iq2)=wq(ij,l,iq) ! correction bug le 15mai2015
         w(ij, l, iq2) = wq(ij, l, iq)
       enddo
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltgen_loc.F90	(revision 5113)
@@ -26,5 +26,5 @@
   USE write_field_loc, ONLY: WriteField_u, WriteField_v
   USE VAMPIR
-  ! ! CRisi: on rajoute variables utiles d'infotrac
+  ! CRisi: on rajoute variables utiles d'infotrac
   USE infotrac, ONLY: nqtot, tracers, isoCheck
   USE vlspltgen_mod
@@ -181,5 +181,5 @@
   ENDDO
 
-  ! ! verif temporaire
+  ! verif temporaire
   ijb = ij_begin
   ije = ij_end
@@ -188,7 +188,7 @@
   !$OMP BARRIER
   DO iq = 1, nqtot
-    ! ! CRisi: on ne boucle que sur les pères= ceux qui sont transportés directement par l'air
-    IF(tracers(iq)%parent /= 'air') CYCLE
-    ! !write(*,*) 'vlspltgen 192: iq,iadv=',iq,tracers(iq)%iadv
+    ! CRisi: on ne boucle que sur les pères= ceux qui sont transportés directement par l'air
+    IF(tracers(iq)%parent /= 'air') CYCLE
+    !write(*,*) 'vlspltgen 192: iq,iadv=',iq,tracers(iq)%iadv
     SELECT CASE(tracers(iq)%iadv)
     CASE(0); CYCLE
@@ -250,5 +250,5 @@
   !$OMP BARRIER
 
-  ! ! verif temporaire
+  ! verif temporaire
   ijb = ij_begin - 2 * iip1
   ije = ij_end + 2 * iip1
@@ -259,5 +259,5 @@
   do iq = 1, nqtot
     IF(tracers(iq)%parent /= 'air') CYCLE
-    ! !write(*,*) 'vlspltgen 279: iq=',iq
+    !write(*,*) 'vlspltgen 279: iq=',iq
 
     SELECT CASE(tracers(iq)%iadv)
@@ -326,5 +326,5 @@
       CALL Register_Hallo_u(zq(:, :, iq), llm, 2, 2, 2, 2, MyRequest2)
       CALL Register_Hallo_u(zm(:, :, iq), llm, 1, 1, 1, 1, MyRequest2)
-      ! ! CRisi
+      ! CRisi
       do ifils = 1, tracers(iq)%nqDescen
         iq2 = tracers(iq)%iqDescen(ifils)
@@ -359,5 +359,5 @@
   do iq = 1, nqtot
     IF(tracers(iq)%parent /= 'air') CYCLE
-    ! !write(*,*) 'vlspltgen 409: iq=',iq
+    !write(*,*) 'vlspltgen 409: iq=',iq
 
     SELECT CASE(tracers(iq)%iadv)
@@ -370,8 +370,8 @@
 
   enddo
-  ! !write(*,*) 'vlspltgen_loc 476'
-
-  !$OMP BARRIER
-  ! !write(*,*) 'vlspltgen_loc 477'
+  !write(*,*) 'vlspltgen_loc 476'
+
+  !$OMP BARRIER
+  !write(*,*) 'vlspltgen_loc 477'
   !$OMP MASTER
   CALL VTb(VTHallo)
@@ -389,5 +389,5 @@
 
 
-  ! !write(*,*) 'vlspltgen_loc 494'
+  !write(*,*) 'vlspltgen_loc 494'
   CALL check_isotopes(zq, ij_begin, ij_end, 'vlspltgen_loc 461')
 
@@ -420,5 +420,5 @@
   enddo !do iq=1,nqtot
 
-  ! !write(*,*) 'vlspltgen 550: apres derniere serie de CALL vlx'
+  !write(*,*) 'vlspltgen 550: apres derniere serie de CALL vlx'
   CALL check_isotopes(zq, ij_begin, ij_end, 'vlspltgen_loc 521')
 
@@ -457,5 +457,5 @@
   !c$OMP BARRIER
 
-  ! !write(*,*) 'vlspltgen 597: sortie'
+  !write(*,*) 'vlspltgen 597: sortie'
 
 END SUBROUTINE vlspltgen_loc
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/vlspltqs_loc.f90	(revision 5113)
@@ -48,5 +48,5 @@
   INTEGER :: ijb,ije,ijb_x,ije_x
 
-  ! !write(*,*) 'vlspltqs 58: entree vlxqs_loc, iq,ijb_x=',
+  !write(*,*) 'vlspltqs 58: entree vlxqs_loc, iq,ijb_x=',
   ! &   iq,ijb_x
 
@@ -253,5 +253,5 @@
            ENDDO
            niju=iju
-           ! !PRINT*,'vlxqs 280: niju,nl',niju,nl(l)
+           !PRINT*,'vlxqs 280: niju,nl',niju,nl(l)
 
   !  traitement des mailles
@@ -309,5 +309,5 @@
   ! CRisi: appel recursif de l'advection sur les fils.
   ! Il faut faire ca avant d'avoir mis a jour q et masse
-  ! !write(*,*) 'vlspltqs 336: iq,ijb_x,nqChildren(iq)=',
+  !write(*,*) 'vlspltqs 336: iq,ijb_x,nqChildren(iq)=',
   ! &     iq,ijb_x,tracers(iq)%nqChildren
 
@@ -317,5 +317,5 @@
     DO l=1,llm
       DO ij=ijb,ije
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         masse(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass)
         if (q(ij,l,iq)>min_qParent) then ! modif 13 nov 2020
@@ -330,10 +330,10 @@
   do ifils=1,tracers(iq)%nqChildren
     iq2=tracers(iq)%iqDescen(ifils)
-    ! !write(*,*) 'vlxqs 349: on appelle vlx pour iq2=',iq2
+    !write(*,*) 'vlxqs 349: on appelle vlx pour iq2=',iq2
     CALL vlx_loc(Ratio,pente_max,masse,u_mq,ijb_x,ije_x,iq2)
   enddo
   ! end CRisi
 
-  ! !write(*,*) 'vlspltqs 360: iq,ijb_x=',iq,ijb_x
+  !write(*,*) 'vlspltqs 360: iq,ijb_x=',iq,ijb_x
 
   !   calcul des tendances
@@ -341,5 +341,5 @@
   DO l=1,llm
      DO ij=ijb+1,ije
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         new_m=max(masse(ij,l,iq)+u_m(ij-1,l)-u_m(ij,l),min_qMass)
         q(ij,l,iq)=(q(ij,l,iq)*masse(ij,l,iq)+ &
@@ -356,5 +356,5 @@
 !$OMP END DO NOWAIT
 
-  ! !write(*,*) 'vlspltqs 380: iq,ijb_x=',iq,ijb_x
+  !write(*,*) 'vlspltqs 380: iq,ijb_x=',iq,ijb_x
 
   ! retablir les fils en rapport de melange par rapport a l'air:
@@ -373,5 +373,5 @@
   enddo
 
-  ! !write(*,*) 'vlspltqs 399: iq,ijb_x=',iq,ijb_x
+  !write(*,*) 'vlspltqs 399: iq,ijb_x=',iq,ijb_x
 
   ! CALL SCOPY((jjm-1)*llm,q(iip1+iip1,1),iip1,q(iip2,1),iip1)
@@ -453,5 +453,5 @@
   l=3
   if ((ij>=ijb).and.(ij<=ije)) then
-    ! !write(*,*) 'vlyqs 480: ij,l,iq,ijb,q(ij,l,:)=',
+    !write(*,*) 'vlyqs 480: ij,l,iq,ijb,q(ij,l,:)=',
   ! &             ij,l,iq,ijb,q(ij,l,:)
   endif
@@ -713,22 +713,22 @@
   if (pole_sud)  ijem=ij_end
 
-  ! !write(lunout,*) 'vlspltqs 737: iq,ijb,ije=',iq,ijb,ije
-  ! !write(lunout,*) 'ij_begin,ij_end=',ij_begin,ij_end
-  ! !write(lunout,*) 'pole_nord,pole_sud=',pole_nord,pole_sud
+  !write(lunout,*) 'vlspltqs 737: iq,ijb,ije=',iq,ijb,ije
+  !write(lunout,*) 'ij_begin,ij_end=',ij_begin,ij_end
+  !write(lunout,*) 'pole_nord,pole_sud=',pole_nord,pole_sud
   do ifils=1,tracers(iq)%nqDescen
     iq2=tracers(iq)%iqDescen(ifils)
 !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
     DO l=1,llm
-      ! ! modif des bornes: CRisi 16 nov 2020
-      ! ! d'abord masse avec bornes corrigees
+      ! modif des bornes: CRisi 16 nov 2020
+      ! d'abord masse avec bornes corrigees
       DO ij=ijbm,ijem
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
         masse(ij,l,iq2)=max(masse(ij,l,iq)*q(ij,l,iq),min_qMass)
       enddo !DO ij=ijbm,ijem
 
-      ! ! ensuite Ratio avec anciennes bornes
+      ! ensuite Ratio avec anciennes bornes
       DO ij=ijb,ije
-        ! !MVals: veiller a ce qu'on n'ait pas de denominateur nul
-        ! !write(lunout,*) 'ij,l,q(ij,l,iq)=',ij,l,q(ij,l,iq)
+        !MVals: veiller a ce qu'on n'ait pas de denominateur nul
+        !write(lunout,*) 'ij,l,q(ij,l,iq)=',ij,l,q(ij,l,iq)
         if (q(ij,l,iq)>min_qParent) then ! modif 13 nov 2020
           Ratio(ij,l,iq2)=q(ij,l,iq2)/q(ij,l,iq)
@@ -742,5 +742,5 @@
   do ifils=1,tracers(iq)%nqChildren
     iq2=tracers(iq)%iqDescen(ifils)
-    ! !write(lunout,*) 'vly: appel recursiv vly iq2=',iq2
+    !write(lunout,*) 'vly: appel recursiv vly iq2=',iq2
     CALL vly_loc(Ratio,pente_max,masse,qbyv,iq2)
   enddo
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/wrgrads.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/wrgrads.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/wrgrads.f90	(revision 5113)
@@ -2,5 +2,5 @@
 
 SUBROUTINE wrgrads(if, nl, field, name, titlevar)
-  implicit none
+  IMPLICIT NONE
 
   !   Declarations
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/write_field_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/write_field_loc.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/write_field_loc.F90	(revision 5113)
@@ -1,4 +1,4 @@
 module write_field_loc
-implicit none
+IMPLICIT NONE
   
   interface WriteField_u
@@ -21,5 +21,5 @@
 
   SUBROUTINE write_field2D_u(name,Field)
-    implicit none
+    IMPLICIT NONE
       
     character(len=*)   :: name
@@ -37,5 +37,5 @@
     USE write_field
     USE mod_hallo
-    implicit none
+    IMPLICIT NONE
     include 'dimensions.h'
     include 'paramet.h'
@@ -86,5 +86,5 @@
 
   SUBROUTINE write_field2D_v(name,Field)
-    implicit none
+    IMPLICIT NONE
       
     character(len=*)   :: name
@@ -102,5 +102,5 @@
     USE write_field
     USE mod_hallo
-    implicit none
+    IMPLICIT NONE
     include 'dimensions.h'
     include 'paramet.h'
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/write_field_p.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/write_field_p.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/write_field_p.F90	(revision 5113)
@@ -1,4 +1,4 @@
 module write_field_p
-implicit none
+IMPLICIT NONE
   
   interface WriteField_p
@@ -11,5 +11,5 @@
     USE parallel_lmdz
     USE write_field
-    implicit none
+    IMPLICIT NONE
   
     integer, parameter :: MaxDim=1
@@ -32,5 +32,5 @@
     USE parallel_lmdz
     USE write_field
-    implicit none
+    IMPLICIT NONE
   
     integer, parameter :: MaxDim=2
@@ -53,5 +53,5 @@
     USE parallel_lmdz
     USE write_field
-    implicit none
+    IMPLICIT NONE
   
     integer, parameter :: MaxDim=3
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90	(revision 5113)
@@ -14,5 +14,5 @@
       USE mod_xios_dyn3dmem, ONLY: writefield_dyn_u, writefield_dyn_v
       
-      implicit none
+      IMPLICIT NONE
 
 !   Ecriture du fichier histoire au format xios
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.f90	(revision 5113)
@@ -14,5 +14,5 @@
   USE temps_mod, ONLY: itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.f90	(revision 5113)
@@ -14,5 +14,5 @@
   USE temps_mod, ONLY: itau_dyn
 
-  implicit none
+  IMPLICIT NONE
 
   !
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/calfis.f90	(revision 5113)
@@ -114,7 +114,7 @@
   REAL,INTENT(IN) :: pducov(iip1,jjp1,llm) ! dynamical tendency on ucov
   REAL,INTENT(IN) :: pdteta(iip1,jjp1,llm) ! dynamical tendency on teta
-  ! ! NB: pdteta is used only to compute pcvgt which is in fact not used...
+  ! NB: pdteta is used only to compute pcvgt which is in fact not used...
   REAL,INTENT(IN) :: pdq(iip1,jjp1,llm,nqtot) ! dynamical tendency on tracers
-  ! ! NB: pdq is only used to compute pcvgq which is in fact not used...
+  ! NB: pdq is only used to compute pcvgq which is in fact not used...
 
   REAL,INTENT(IN) :: pps(iip1,jjp1) ! surface pressure (Pa)
@@ -123,5 +123,5 @@
   REAL,INTENT(IN) :: flxw(iip1,jjp1,llm) ! Vertical mass flux on lower mesh interfaces (kg/s) (on llm because flxw(:,:,llm+1)=0)
 
-  ! ! tendencies (in */s) from the physics
+  ! tendencies (in */s) from the physics
   REAL,INTENT(OUT) :: pdvfi(iip1,jjm,llm) ! tendency on covariant meridional wind
   REAL,INTENT(OUT) :: pdufi(iip1,jjp1,llm) ! tendency on covariant zonal wind
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/grid_atob_m.f90	(revision 5113)
@@ -5,5 +5,5 @@
 !*******************************************************************************
 
-  USE assert_eq_m, ONLY: assert_eq
+  USE lmdz_assert_eq, ONLY: assert_eq
 
   PRIVATE
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/lmdz_calfis_loc.F90	(revision 5113)
@@ -135,5 +135,5 @@
     REAL, INTENT(IN) :: flxw(iip1, jjb_u:jje_u, llm) ! Vertical mass flux on lower mesh interfaces (kg/s) (on llm because flxw(:,:,llm+1)=0)
 
-    ! ! tendencies (in */s) from the physics
+    ! tendencies (in */s) from the physics
     REAL, INTENT(OUT) :: pdvfi(iip1, jjb_v:jje_v, llm) ! tendency on covariant meridional wind
     REAL, INTENT(OUT) :: pdufi(iip1, jjb_u:jje_u, llm) ! tendency on covariant zonal wind
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phydev/iniphysiq_mod.F90	(revision 5113)
@@ -31,5 +31,5 @@
   REAL,INTENT(IN) :: prad ! radius of the planet (m)
   REAL,INTENT(IN) :: pg ! gravitational acceleration (m/s2)
-  REAL,INTENT(IN) :: pr ! ! reduced gas constant R/mu
+  REAL,INTENT(IN) :: pr ! reduced gas constant R/mu
   REAL,INTENT(IN) :: pcpp ! specific heat Cp
   REAL,INTENT(IN) :: punjours ! length (in s) of a standard day
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90	(revision 5113)
@@ -35,5 +35,5 @@
 !-------------------------------------------------------------------------------
   USE ioipsl,         ONLY: flininfo, flinopen, flinget, flinclo, histclo
-  USE assert_eq_m,    ONLY: assert_eq
+  USE lmdz_assert_eq,    ONLY: assert_eq
   USE comconst_mod, ONLY: pi, cpp, kappa
   USE comvert_mod, ONLY: ap, bp, preff, pressure_exner
@@ -389,6 +389,5 @@
 !-------------------------------------------------------------------------------
   USE conf_dat_m, ONLY: conf_dat3d
-  USE pchsp_95_m, ONLY: pchsp_95
-  USE pchfe_95_m, ONLY: pchfe_95
+  USE lmdz_libmath_pch, ONLY: pchsp_95, pchfe_95
   IMPLICIT NONE
 !-------------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 5113)
@@ -38,5 +38,5 @@
 
   USE ioipsl,             ONLY: flininfo, flinopen, flinget, flinclo
-  USE assert_eq_m,        ONLY: assert_eq
+  USE lmdz_assert_eq,        ONLY: assert_eq
   USE dimphy,             ONLY: klon
   USE conf_dat_m,         ONLY: conf_dat2d
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 5113)
@@ -57,5 +57,5 @@
   REAL, INTENT (IN) :: prad ! radius of the planet (m)
   REAL, INTENT (IN) :: pg ! gravitational acceleration (m/s2)
-  REAL, INTENT (IN) :: pr ! ! reduced gas constant R/mu
+  REAL, INTENT (IN) :: pr ! reduced gas constant R/mu
   REAL, INTENT (IN) :: pcpp ! specific heat Cp
   REAL, INTENT (IN) :: punjours ! length (in s) of a standard day
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/limit_netcdf.f90	(revision 5113)
@@ -18,5 +18,5 @@
 
   USE ioipsl, ONLY: flininfo, flinopen, flinget, flinclo
-  USE assert_eq_m, ONLY: assert_eq
+  USE lmdz_assert_eq, ONLY: assert_eq
   USE cal_tools_m, ONLY: year_len, mid_month
   USE conf_dat_m, ONLY: conf_dat2d, conf_dat3d
@@ -327,7 +327,6 @@
               nf90_close, nf90_inq_dimid, nf90_inquire_dimension, nf90_get_var, &
               nf90_get_att
-      USE pchsp_95_m, ONLY: pchsp_95
-      USE pchfe_95_m, ONLY: pchfe_95
-      USE arth_m, ONLY: arth
+      USE lmdz_libmath_pch, ONLY: pchsp_95, pchfe_95
+      USE lmdz_arth, ONLY: arth
       USE indice_sol_mod
       USE lmdz_abort_physic, ONLY: abort_physic
Index: LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/dynphy_lonlat/phylmd/test_disvert_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module test_disvert_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_filtreg.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_filtreg.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/filtrez/lmdz_filtreg.F90	(revision 5113)
@@ -423,5 +423,5 @@
 
   SUBROUTINE JACOBI(A, N, NP, D, V, NROT)
-    implicit none
+    IMPLICIT NONE
     ! Arguments:
     integer, intent(in) :: N
@@ -557,5 +557,5 @@
 
   SUBROUTINE acc(vec, d, im)
-    implicit none
+    IMPLICIT NONE
     integer :: im
     real :: vec(im, im), d(im)
Index: LMDZ6/branches/Amaury_dev/libf/misc/arth_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/arth_m.F90	(revision 5112)
+++ 	(revision )
@@ -1,88 +1,0 @@
-MODULE arth_m
-
-  IMPLICIT NONE
-
-  INTEGER, PARAMETER, private:: NPAR_ARTH=16, NPAR2_ARTH=8
-
-  INTERFACE arth
-     ! Returns an arithmetic progression, given a first term "first", an
-     ! increment and a number of terms "n" (including "first").
-
-     MODULE PROCEDURE arth_r, arth_i
-     ! The difference between the procedures is the kind and type of
-     ! arguments first and increment and of function result.
-  END INTERFACE
-
-  private arth_r, arth_i
-
-CONTAINS
-
-  pure FUNCTION arth_r(first,increment,n)
-
-    REAL, INTENT(IN) :: first,increment
-    INTEGER, INTENT(IN) :: n
-    REAL arth_r(n)
-
-    ! Local:
-    INTEGER :: k,k2
-    REAL :: temp
-
-    !---------------------------------------
-
-    if (n > 0) arth_r(1)=first
-    if (n <= NPAR_ARTH) then
-       do k=2,n
-          arth_r(k)=arth_r(k-1)+increment
-       END DO
-    else
-       do k=2,NPAR2_ARTH
-          arth_r(k)=arth_r(k-1)+increment
-       END DO
-       temp=increment*NPAR2_ARTH
-       k=NPAR2_ARTH
-       do
-          if (k >= n) exit
-          k2=k+k
-          arth_r(k+1:min(k2,n)) = temp + arth_r(1:min(k,n-k))
-          temp=temp+temp
-          k=k2
-       END DO
-    end if
-
-  END FUNCTION arth_r
-
-  !*************************************
-
-  pure FUNCTION arth_i(first,increment,n)
-
-    INTEGER, INTENT(IN) :: first,increment,n
-    INTEGER arth_i(n)
-
-    ! Local:
-    INTEGER :: k,k2,temp
-
-    !---------------------------------------
-
-    if (n > 0) arth_i(1)=first
-    if (n <= NPAR_ARTH) then
-       do k=2,n
-          arth_i(k)=arth_i(k-1)+increment
-       END DO
-    else
-       do k=2,NPAR2_ARTH
-          arth_i(k)=arth_i(k-1)+increment
-       END DO
-       temp=increment*NPAR2_ARTH
-       k=NPAR2_ARTH
-       do
-          if (k >= n) exit
-          k2=k+k
-          arth_i(k+1:min(k2,n))=temp+arth_i(1:min(k,n-k))
-          temp=temp+temp
-          k=k2
-       END DO
-    end if
-
-  END FUNCTION arth_i
-
-END MODULE arth_m
Index: LMDZ6/branches/Amaury_dev/libf/misc/assert_eq_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/assert_eq_m.F90	(revision 5112)
+++ 	(revision )
@@ -1,70 +1,0 @@
-! $Id$
-MODULE assert_eq_m
-
-  implicit none
-
-  INTERFACE assert_eq
-     MODULE PROCEDURE assert_eq2,assert_eq3,assert_eq4,assert_eqn
-  END INTERFACE
-
-  private assert_eq2,assert_eq3,assert_eq4,assert_eqn
-
-CONTAINS
-
-  FUNCTION assert_eq2(n1,n2,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    INTEGER, INTENT(IN) :: n1,n2
-    INTEGER  assert_eq2
-    if (n1 == n2) then
-       assert_eq2=n1
-    else
-       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
-            string
-       print *, 'program terminated by assert_eq2'
-       stop 1
-    end if
-  END FUNCTION assert_eq2
-  !BL
-  FUNCTION assert_eq3(n1,n2,n3,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    INTEGER, INTENT(IN) :: n1,n2,n3
-    INTEGER  assert_eq3
-    if (n1 == n2 .and. n2 == n3) then
-       assert_eq3=n1
-    else
-       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
-            string
-       print *, 'program terminated by assert_eq3'
-       stop 1
-    end if
-  END FUNCTION assert_eq3
-  !BL
-  FUNCTION assert_eq4(n1,n2,n3,n4,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    INTEGER, INTENT(IN) :: n1,n2,n3,n4
-    INTEGER  assert_eq4
-    if (n1 == n2 .and. n2 == n3 .and. n3 == n4) then
-       assert_eq4=n1
-    else
-       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
-            string,n1,n2,n3,n4
-       print *, 'program terminated by assert_eq4'
-       stop 1
-    end if
-  END FUNCTION assert_eq4
-  !BL
-  FUNCTION assert_eqn(nn,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    INTEGER, DIMENSION(:), INTENT(IN) :: nn
-    INTEGER  assert_eqn
-    if (all(nn(2:) == nn(1))) then
-       assert_eqn=nn(1)
-    else
-       write (*,*) 'nrerror: an assert_eq failed with this tag: ', &
-            string
-       print *, 'program terminated by assert_eqn'
-       stop 1
-    end if
-  END FUNCTION assert_eqn
-
-END MODULE assert_eq_m
Index: LMDZ6/branches/Amaury_dev/libf/misc/assert_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/assert_m.F90	(revision 5112)
+++ 	(revision )
@@ -1,69 +1,0 @@
-! $Id$
-MODULE assert_m
-
-  implicit none
-
-  INTERFACE assert
-     MODULE PROCEDURE assert1,assert2,assert3,assert4,assert_v
-  END INTERFACE
-
-  private assert1,assert2,assert3,assert4,assert_v
-
-CONTAINS
-
-  SUBROUTINE assert1(n1,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    LOGICAL, INTENT(IN) :: n1
-    if (.not. n1) then
-       write (*,*) 'nrerror: an assertion failed with this tag:', &
-            string
-       print *, 'program terminated by assert1'
-       stop 1
-    end if
-  END SUBROUTINE assert1
-  !BL
-  SUBROUTINE assert2(n1,n2,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    LOGICAL, INTENT(IN) :: n1,n2
-    if (.not. (n1 .and. n2)) then
-       write (*,*) 'nrerror: an assertion failed with this tag:', &
-            string
-       print *, 'program terminated by assert2'
-       stop 1
-    end if
-  END SUBROUTINE assert2
-  !BL
-  SUBROUTINE assert3(n1,n2,n3,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    LOGICAL, INTENT(IN) :: n1,n2,n3
-    if (.not. (n1 .and. n2 .and. n3)) then
-       write (*,*) 'nrerror: an assertion failed with this tag:', &
-            string
-       print *, 'program terminated by assert3'
-       stop 1
-    end if
-  END SUBROUTINE assert3
-  !BL
-  SUBROUTINE assert4(n1,n2,n3,n4,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    LOGICAL, INTENT(IN) :: n1,n2,n3,n4
-    if (.not. (n1 .and. n2 .and. n3 .and. n4)) then
-       write (*,*) 'nrerror: an assertion failed with this tag:', &
-            string
-       print *, 'program terminated by assert4'
-       stop 1
-    end if
-  END SUBROUTINE assert4
-  !BL
-  SUBROUTINE assert_v(n,string)
-    CHARACTER(LEN=*), INTENT(IN) :: string
-    LOGICAL, DIMENSION(:), INTENT(IN) :: n
-    if (.not. all(n)) then
-       write (*,*) 'nrerror: an assertion failed with this tag:', &
-            string
-       print *, 'program terminated by assert_v'
-       stop 1
-    end if
-  END SUBROUTINE assert_v
-
-END MODULE assert_m
Index: LMDZ6/branches/Amaury_dev/libf/misc/cbrt.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/cbrt.f90	(revision 5112)
+++ 	(revision )
@@ -1,11 +1,0 @@
-FUNCTION cbrt(x)
-  ! ! Return the cubic root for positive or negative x
-  IMPLICIT NONE
-
-  REAL :: x,cbrt
-
-  cbrt=sign(1.,x)*(abs(x)**(1./3.))
-
-
-END FUNCTION cbrt
-
Index: LMDZ6/branches/Amaury_dev/libf/misc/chfev.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/chfev.f90	(revision 5112)
+++ 	(revision )
@@ -1,155 +1,0 @@
-!DECK CHFEV
-SUBROUTINE CHFEV(X1, X2, F1, F2, D1, D2, NE, XE, FE, NEXT, IERR)
-  !***BEGIN PROLOGUE  CHFEV
-  !***PURPOSE  Evaluate a cubic polynomial given in Hermite form at an
-         ! array of points.  While designed for use by PCHFE, it may
-         ! be useful directly as an evaluator for a piecewise cubic
-         ! Hermite function in applications, such as graphing, where
-         ! the interval is known in advance.
-  !***LIBRARY   SLATEC (PCHIP)
-  !***CATEGORY  E3
-  !***TYPE      SINGLE PRECISION (CHFEV-S, DCHFEV-D)
-  !***KEYWORDS  CUBIC HERMITE EVALUATION, CUBIC POLYNOMIAL EVALUATION,
-         !  PCHIP
-  !***AUTHOR  Fritsch, F. N., (LLNL)
-         !  Lawrence Livermore National Laboratory
-         !  P.O. Box 808  (L-316)
-         !  Livermore, CA  94550
-         !  FTS 532-4275, (510) 422-4275
-  !***DESCRIPTION
-  !
-  !      CHFEV:  Cubic Hermite Function EValuator
-  !
-  ! Evaluates the cubic polynomial determined by function values
-  ! F1,F2 and derivatives D1,D2 on interval (X1,X2) at the points
-  ! XE(J), J=1(1)NE.
-  !
-  ! ----------------------------------------------------------------------
-  !
-  !  Calling sequence:
-  !
-  !    INTEGER  NE, NEXT(2), IERR
-  !    REAL  X1, X2, F1, F2, D1, D2, XE(NE), FE(NE)
-  !
-  !    CALL  CHFEV (X1,X2, F1,F2, D1,D2, NE, XE, FE, NEXT, IERR)
-  !
-  !   Parameters:
-  !
-  ! X1,X2 -- (input) endpoints of interval of definition of cubic.
-  !       (Error return if  X1.EQ.X2 .)
-  !
-  ! F1,F2 -- (input) values of function at X1 and X2, respectively.
-  !
-  ! D1,D2 -- (input) values of derivative at X1 and X2, respectively.
-  !
-  ! NE -- (input) number of evaluation points.  (Error return if
-  !       NE.LT.1 .)
-  !
-  ! XE -- (input) real array of points at which the function is to be
-  !       evaluated.  If any of the XE are outside the interval
-  !       [X1,X2], a warning error is returned in NEXT.
-  !
-  ! FE -- (output) real array of values of the cubic function defined
-  !       by  X1,X2, F1,F2, D1,D2  at the points  XE.
-  !
-  ! NEXT -- (output) integer array indicating number of extrapolation
-  !       points:
-  !        NEXT(1) = number of evaluation points to left of interval.
-  !        NEXT(2) = number of evaluation points to right of interval.
-  !
-  ! IERR -- (output) error flag.
-  !       Normal return:
-  !          IERR = 0  (no errors).
-  !       "Recoverable" errors:
-  !          IERR = -1  if NE.LT.1 .
-  !          IERR = -2  if X1.EQ.X2 .
-  !            (The FE-array has not been changed in either case.)
-  !
-  !***REFERENCES  (NONE)
-  !***ROUTINES CALLED  XERMSG
-  !***REVISION HISTORY  (YYMMDD)
-  !   811019  DATE WRITTEN
-  !   820803  Minor cosmetic changes for release 1.
-  !   890411  Added SAVE statements (Vers. 3.2).
-  !   890531  Changed all specific intrinsics to generic.  (WRB)
-  !   890703  Corrected category record.  (WRB)
-  !   890703  REVISION DATE from Version 3.2
-  !   891214  Prologue converted to Version 4.0 format.  (BAB)
-  !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
-  !***END PROLOGUE  CHFEV
-  !  Programming notes:
-  !
-  ! To produce a double precision version, simply:
-  !    a. Change CHFEV to DCHFEV wherever it occurs,
-  !    b. Change the real declaration to double precision, and
-  !    c. Change the constant ZERO to double precision.
-  !
-  !  DECLARE ARGUMENTS.
-  !
-  INTEGER :: NE, NEXT(2), IERR
-  REAL :: X1, X2, F1, F2, D1, D2, XE(*), FE(*)
-  !
-  !  DECLARE LOCAL VARIABLES.
-  !
-  INTEGER :: I
-  REAL :: C2, C3, DEL1, DEL2, DELTA, H, X, XMI, XMA, ZERO
-  SAVE ZERO
-  DATA  ZERO /0./
-  !
-  !  VALIDITY-CHECK ARGUMENTS.
-  !
-  !***FIRST EXECUTABLE STATEMENT  CHFEV
-  IF (NE < 1)  GO TO 5001
-  H = X2 - X1
-  IF (H == ZERO)  GO TO 5002
-  !
-  !  INITIALIZE.
-  !
-  IERR = 0
-  NEXT(1) = 0
-  NEXT(2) = 0
-  XMI = MIN(ZERO, H)
-  XMA = MAX(ZERO, H)
-  !
-  !  COMPUTE CUBIC COEFFICIENTS (EXPANDED ABOUT X1).
-  !
-  DELTA = (F2 - F1)/H
-  DEL1 = (D1 - DELTA)/H
-  DEL2 = (D2 - DELTA)/H
-                                        ! (DELTA IS NO LONGER NEEDED.)
-  C2 = -(DEL1+DEL1 + DEL2)
-  C3 = (DEL1 + DEL2)/H
-                            ! (H, DEL1 AND DEL2 ARE NO LONGER NEEDED.)
-  !
-  !  EVALUATION LOOP.
-  !
-  DO I = 1, NE
-     X = XE(I) - X1
-     FE(I) = F1 + X*(D1 + X*(C2 + X*C3))
-       ! COUNT EXTRAPOLATION POINTS.
-     IF ( X<XMI )  NEXT(1) = NEXT(1) + 1
-     IF ( X>XMA )  NEXT(2) = NEXT(2) + 1
-     ! (NOTE REDUNDANCY--IF EITHER CONDITION IS TRUE, OTHER IS FALSE.)
-  END DO
-  !
-  !  NORMAL RETURN.
-  !
-  RETURN
-  !
-  !  ERROR RETURNS.
-  !
- 5001   CONTINUE
-  ! NE.LT.1 RETURN.
-  IERR = -1
-  CALL XERMSG ('SLATEC', 'CHFEV', &
-        'NUMBER OF EVALUATION POINTS LESS THAN ONE', IERR, 1)
-  RETURN
-  !
- 5002   CONTINUE
-  ! X1.EQ.X2 RETURN.
-  IERR = -2
-  CALL XERMSG ('SLATEC', 'CHFEV', 'INTERVAL ENDPOINTS EQUAL', IERR, &
-        1)
-  RETURN
-  !------------- LAST LINE OF CHFEV FOLLOWS ------------------------------
-END SUBROUTINE CHFEV
Index: LMDZ6/branches/Amaury_dev/libf/misc/formcoord.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/formcoord.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/formcoord.f90	(revision 5113)
@@ -3,5 +3,5 @@
 
 SUBROUTINE formcoord(unit,n,x,a,rev,text)
-  implicit none
+  IMPLICIT NONE
   integer :: n,unit,ndec
   logical :: rev
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_arth.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_arth.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_arth.f90	(revision 5113)
@@ -0,0 +1,87 @@
+MODULE lmdz_arth
+
+  IMPLICIT NONE; PRIVATE
+  PUBLIC arth
+
+  INTEGER, PARAMETER :: NPAR_ARTH = 16, NPAR2_ARTH = 8
+
+  INTERFACE arth
+    ! Returns an arithmetic progression, given a first term "first", an
+    ! increment and a number of terms "n" (including "first").
+
+    MODULE PROCEDURE arth_r, arth_i
+    ! The difference between the procedures is the kind and type of
+    ! arguments first and increment and of function result.
+  END INTERFACE
+
+CONTAINS
+
+  PURE FUNCTION arth_r(first, increment, n)
+
+    REAL, INTENT(IN) :: first, increment
+    INTEGER, INTENT(IN) :: n
+    REAL arth_r(n)
+
+    ! Local:
+    INTEGER :: k, k2
+    REAL :: temp
+
+    !---------------------------------------
+
+    IF (n > 0) arth_r(1) = first
+    IF (n <= NPAR_ARTH) THEN
+      DO k = 2, n
+        arth_r(k) = arth_r(k - 1) + increment
+      END DO
+    ELSE
+      DO k = 2, NPAR2_ARTH
+        arth_r(k) = arth_r(k - 1) + increment
+      END DO
+      temp = increment * NPAR2_ARTH
+      k = NPAR2_ARTH
+      DO
+        IF (k >= n) EXIT
+        k2 = k + k
+        arth_r(k + 1:min(k2, n)) = temp + arth_r(1:min(k, n - k))
+        temp = temp + temp
+        k = k2
+      END DO
+    END IF
+
+  END FUNCTION arth_r
+
+  !*************************************
+
+  PURE FUNCTION arth_i(first, increment, n)
+
+    INTEGER, INTENT(IN) :: first, increment, n
+    INTEGER arth_i(n)
+
+    ! Local:
+    INTEGER :: k, k2, temp
+
+    !---------------------------------------
+
+    IF (n > 0) arth_i(1) = first
+    IF (n <= NPAR_ARTH) THEN
+      DO k = 2, n
+        arth_i(k) = arth_i(k - 1) + increment
+      END DO
+    ELSE
+      DO k = 2, NPAR2_ARTH
+        arth_i(k) = arth_i(k - 1) + increment
+      END DO
+      temp = increment * NPAR2_ARTH
+      k = NPAR2_ARTH
+      DO
+        IF (k >= n) EXIT
+        k2 = k + k
+        arth_i(k + 1:min(k2, n)) = temp + arth_i(1:min(k, n - k))
+        temp = temp + temp
+        k = k2
+      END DO
+    END IF
+
+  END FUNCTION arth_i
+
+END MODULE lmdz_arth
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert.f90	(revision 5113)
@@ -0,0 +1,69 @@
+! $Id$
+MODULE lmdz_assert
+
+  IMPLICIT NONE
+
+  INTERFACE assert
+    MODULE PROCEDURE assert1, assert2, assert3, assert4, assert_v
+  END INTERFACE
+
+  PRIVATE assert1, assert2, assert3, assert4, assert_v
+
+CONTAINS
+
+  SUBROUTINE assert1(n1, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    LOGICAL, INTENT(IN) :: n1
+    if (.not. n1) then
+      write (*, *) 'nrerror: an assertion failed with this tag:', &
+              string
+      print *, 'program terminated by assert1'
+      stop 1
+    end if
+  END SUBROUTINE assert1
+  !BL
+  SUBROUTINE assert2(n1, n2, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    LOGICAL, INTENT(IN) :: n1, n2
+    if (.not. (n1 .and. n2)) then
+      write (*, *) 'nrerror: an assertion failed with this tag:', &
+              string
+      print *, 'program terminated by assert2'
+      stop 1
+    end if
+  END SUBROUTINE assert2
+  !BL
+  SUBROUTINE assert3(n1, n2, n3, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    LOGICAL, INTENT(IN) :: n1, n2, n3
+    if (.not. (n1 .and. n2 .and. n3)) then
+      write (*, *) 'nrerror: an assertion failed with this tag:', &
+              string
+      print *, 'program terminated by assert3'
+      stop 1
+    end if
+  END SUBROUTINE assert3
+  !BL
+  SUBROUTINE assert4(n1, n2, n3, n4, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    LOGICAL, INTENT(IN) :: n1, n2, n3, n4
+    if (.not. (n1 .and. n2 .and. n3 .and. n4)) then
+      write (*, *) 'nrerror: an assertion failed with this tag:', &
+              string
+      print *, 'program terminated by assert4'
+      stop 1
+    end if
+  END SUBROUTINE assert4
+  !BL
+  SUBROUTINE assert_v(n, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    LOGICAL, DIMENSION(:), INTENT(IN) :: n
+    if (.not. all(n)) then
+      write (*, *) 'nrerror: an assertion failed with this tag:', &
+              string
+      print *, 'program terminated by assert_v'
+      stop 1
+    end if
+  END SUBROUTINE assert_v
+
+END MODULE lmdz_assert
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert_eq.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert_eq.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_assert_eq.f90	(revision 5113)
@@ -0,0 +1,69 @@
+MODULE lmdz_assert_eq
+
+  IMPLICIT NONE
+
+  INTERFACE assert_eq
+    MODULE PROCEDURE assert_eq2, assert_eq3, assert_eq4, assert_eqn
+  END INTERFACE
+
+  PRIVATE assert_eq2, assert_eq3, assert_eq4, assert_eqn
+
+CONTAINS
+
+  FUNCTION assert_eq2(n1, n2, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    INTEGER, INTENT(IN) :: n1, n2
+    INTEGER  assert_eq2
+    IF (n1 == n2) THEN
+      assert_eq2 = n1
+    ELSE
+      WRITE (*, *) 'nrerror: an assert_eq failed with this tag: ', &
+              string
+      PRINT *, 'program terminated by assert_eq2'
+      STOP 1
+    END IF
+  END FUNCTION assert_eq2
+  !BL
+  FUNCTION assert_eq3(n1, n2, n3, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    INTEGER, INTENT(IN) :: n1, n2, n3
+    INTEGER  assert_eq3
+    IF (n1 == n2 .and. n2 == n3) THEN
+      assert_eq3 = n1
+    ELSE
+      WRITE (*, *) 'nrerror: an assert_eq failed with this tag: ', &
+              string
+      PRINT *, 'program terminated by assert_eq3'
+      STOP 1
+    END IF
+  END FUNCTION assert_eq3
+  !BL
+  FUNCTION assert_eq4(n1, n2, n3, n4, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    INTEGER, INTENT(IN) :: n1, n2, n3, n4
+    INTEGER  assert_eq4
+    IF (n1 == n2 .and. n2 == n3 .and. n3 == n4) THEN
+      assert_eq4 = n1
+    ELSE
+      WRITE (*, *) 'nrerror: an assert_eq failed with this tag: ', &
+              string, n1, n2, n3, n4
+      PRINT *, 'program terminated by assert_eq4'
+      STOP 1
+    END IF
+  END FUNCTION assert_eq4
+  !BL
+  FUNCTION assert_eqn(nn, string)
+    CHARACTER(LEN = *), INTENT(IN) :: string
+    INTEGER, DIMENSION(:), INTENT(IN) :: nn
+    INTEGER  assert_eqn
+    IF (all(nn(2:) == nn(1))) THEN
+      assert_eqn = nn(1)
+    ELSE
+      WRITE (*, *) 'nrerror: an assert_eq failed with this tag: ', &
+              string
+      PRINT *, 'program terminated by assert_eqn'
+      STOP 1
+    END IF
+  END FUNCTION assert_eqn
+
+END MODULE lmdz_assert_eq
Index: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath_pch.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath_pch.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath_pch.f90	(revision 5113)
@@ -0,0 +1,1150 @@
+! This module encapsulates misc. math functions
+
+MODULE lmdz_libmath_pch
+  IMPLICIT NONE; PRIVATE
+  PUBLIC pchfe_95, pchsp_95
+CONTAINS
+  REAL FUNCTION cbrt(x)
+    ! Return the cubic root for positive or negative x
+    REAL :: x
+
+    cbrt = sign(1., x) * (abs(x)**(1. / 3.))
+  END FUNCTION cbrt
+
+  SUBROUTINE CHFEV(X1, X2, F1, F2, D1, D2, NE, XE, FE, NEXT, IERR)
+    !***BEGIN PROLOGUE  CHFEV
+    !***PURPOSE  Evaluate a cubic polynomial given in Hermite form at an
+    ! array of points.  While designed for use by PCHFE, it may
+    ! be useful directly as an evaluator for a piecewise cubic
+    ! Hermite function in applications, such as graphing, where
+    ! the interval is known in advance.
+    !***LIBRARY   SLATEC (PCHIP)
+    !***CATEGORY  E3
+    !***TYPE      SINGLE PRECISION (CHFEV-S, DCHFEV-D)
+    !***KEYWORDS  CUBIC HERMITE EVALUATION, CUBIC POLYNOMIAL EVALUATION,
+    !  PCHIP
+    !***AUTHOR  Fritsch, F. N., (LLNL)
+    !  Lawrence Livermore National Laboratory
+    !  P.O. Box 808  (L-316)
+    !  Livermore, CA  94550
+    !  FTS 532-4275, (510) 422-4275
+    !***DESCRIPTION
+    !
+    !      CHFEV:  Cubic Hermite Function EValuator
+    !
+    ! Evaluates the cubic polynomial determined by function values
+    ! F1,F2 and derivatives D1,D2 on interval (X1,X2) at the points
+    ! XE(J), J=1(1)NE.
+    !
+    ! ----------------------------------------------------------------------
+    !
+    !  Calling sequence:
+    !
+    !    INTEGER  NE, NEXT(2), IERR
+    !    REAL  X1, X2, F1, F2, D1, D2, XE(NE), FE(NE)
+    !
+    !    CALL  CHFEV (X1,X2, F1,F2, D1,D2, NE, XE, FE, NEXT, IERR)
+    !
+    !   Parameters:
+    !
+    ! X1,X2 -- (input) endpoints of interval of definition of cubic.
+    !       (Error return if  X1.EQ.X2 .)
+    !
+    ! F1,F2 -- (input) values of function at X1 and X2, respectively.
+    !
+    ! D1,D2 -- (input) values of derivative at X1 and X2, respectively.
+    !
+    ! NE -- (input) number of evaluation points.  (Error return if
+    !       NE.LT.1 .)
+    !
+    ! XE -- (input) real array of points at which the function is to be
+    !       evaluated.  If any of the XE are outside the interval
+    !       [X1,X2], a warning error is returned in NEXT.
+    !
+    ! FE -- (output) real array of values of the cubic function defined
+    !       by  X1,X2, F1,F2, D1,D2  at the points  XE.
+    !
+    ! NEXT -- (output) integer array indicating number of extrapolation
+    !       points:
+    !        NEXT(1) = number of evaluation points to left of interval.
+    !        NEXT(2) = number of evaluation points to right of interval.
+    !
+    ! IERR -- (output) error flag.
+    !       Normal return:
+    !          IERR = 0  (no errors).
+    !       "Recoverable" errors:
+    !          IERR = -1  if NE.LT.1 .
+    !          IERR = -2  if X1.EQ.X2 .
+    !            (The FE-array has not been changed in either case.)
+    !
+    !***REFERENCES  (NONE)
+    !***ROUTINES CALLED  XERMSG
+    !***REVISION HISTORY  (YYMMDD)
+    !   811019  DATE WRITTEN
+    !   820803  Minor cosmetic changes for release 1.
+    !   890411  Added SAVE statements (Vers. 3.2).
+    !   890531  Changed all specific intrinsics to generic.  (WRB)
+    !   890703  Corrected category record.  (WRB)
+    !   890703  REVISION DATE from Version 3.2
+    !   891214  Prologue converted to Version 4.0 format.  (BAB)
+    !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
+    !***END PROLOGUE  CHFEV
+    !  Programming notes:
+    !
+    ! To produce a double precision version, simply:
+    !    a. Change CHFEV to DCHFEV wherever it occurs,
+    !    b. Change the real declaration to double precision, and
+    !    c. Change the constant ZERO to double precision.
+    !
+    !  DECLARE ARGUMENTS.
+    !
+    INTEGER :: NE, NEXT(2), IERR
+    REAL :: X1, X2, F1, F2, D1, D2, XE(*), FE(*)
+    !
+    !  DECLARE LOCAL VARIABLES.
+    !
+    INTEGER :: I
+    REAL :: C2, C3, DEL1, DEL2, DELTA, H, X, XMI, XMA, ZERO
+    SAVE ZERO
+    DATA  ZERO /0./
+    !
+    !  VALIDITY-CHECK ARGUMENTS.
+    !
+    !***FIRST EXECUTABLE STATEMENT  CHFEV
+    IF (NE < 1)  GO TO 5001
+    H = X2 - X1
+    IF (H == ZERO)  GO TO 5002
+    !
+    !  INITIALIZE.
+    !
+    IERR = 0
+    NEXT(1) = 0
+    NEXT(2) = 0
+    XMI = MIN(ZERO, H)
+    XMA = MAX(ZERO, H)
+    !
+    !  COMPUTE CUBIC COEFFICIENTS (EXPANDED ABOUT X1).
+    !
+    DELTA = (F2 - F1) / H
+    DEL1 = (D1 - DELTA) / H
+    DEL2 = (D2 - DELTA) / H
+    ! (DELTA IS NO LONGER NEEDED.)
+    C2 = -(DEL1 + DEL1 + DEL2)
+    C3 = (DEL1 + DEL2) / H
+    ! (H, DEL1 AND DEL2 ARE NO LONGER NEEDED.)
+    !
+    !  EVALUATION LOOP.
+    !
+    DO I = 1, NE
+      X = XE(I) - X1
+      FE(I) = F1 + X * (D1 + X * (C2 + X * C3))
+      ! COUNT EXTRAPOLATION POINTS.
+      IF (X<XMI)  NEXT(1) = NEXT(1) + 1
+      IF (X>XMA)  NEXT(2) = NEXT(2) + 1
+      ! (NOTE REDUNDANCY--IF EITHER CONDITION IS TRUE, OTHER IS FALSE.)
+    END DO
+    !
+    !  NORMAL RETURN.
+    !
+    RETURN
+    !
+    !  ERROR RETURNS.
+    !
+    5001   CONTINUE
+    ! NE.LT.1 RETURN.
+    IERR = -1
+    CALL XERMSG ('SLATEC', 'CHFEV', &
+            'NUMBER OF EVALUATION POINTS LESS THAN ONE', IERR, 1)
+    RETURN
+    !
+    5002   CONTINUE
+    ! X1.EQ.X2 RETURN.
+    IERR = -2
+    CALL XERMSG ('SLATEC', 'CHFEV', 'INTERVAL ENDPOINTS EQUAL', IERR, &
+            1)
+    RETURN
+    !------------- LAST LINE OF CHFEV FOLLOWS ------------------------------
+  END SUBROUTINE CHFEV
+
+  SUBROUTINE PCHFE(N, X, F, D, INCFD, SKIP, NE, XE, FE, IERR)
+    !***BEGIN PROLOGUE  PCHFE
+    !***PURPOSE  Evaluate a piecewise cubic Hermite function at an array of
+    ! points.  May be used by itself for Hermite interpolation,
+    ! or as an evaluator for PCHIM or PCHIC.
+    !***LIBRARY   SLATEC (PCHIP)
+    !***CATEGORY  E3
+    !***TYPE      SINGLE PRECISION (PCHFE-S, DPCHFE-D)
+    !***KEYWORDS  CUBIC HERMITE EVALUATION, HERMITE INTERPOLATION, PCHIP,
+    !  PIECEWISE CUBIC EVALUATION
+    !***AUTHOR  Fritsch, F. N., (LLNL)
+    !  Lawrence Livermore National Laboratory
+    !  P.O. Box 808  (L-316)
+    !  Livermore, CA  94550
+    !  FTS 532-4275, (510) 422-4275
+    !***DESCRIPTION
+    !
+    !      PCHFE:  Piecewise Cubic Hermite Function Evaluator
+    !
+    ! Evaluates the cubic Hermite function defined by  N, X, F, D  at
+    ! the points  XE(J), J=1(1)NE.
+    !
+    ! To provide compatibility with PCHIM and PCHIC, includes an
+    ! increment between successive values of the F- and D-arrays.
+    !
+    ! ----------------------------------------------------------------------
+    !
+    !  Calling sequence:
+    !
+    !    PARAMETER  (INCFD = ...)
+    !    INTEGER  N, NE, IERR
+    !    REAL  X(N), F(INCFD,N), D(INCFD,N), XE(NE), FE(NE)
+    !    LOGICAL  SKIP
+    !
+    !    CALL  PCHFE (N, X, F, D, INCFD, SKIP, NE, XE, FE, IERR)
+    !
+    !   Parameters:
+    !
+    ! N -- (input) number of data points.  (Error return if N.LT.2 .)
+    !
+    ! X -- (input) real array of independent variable values.  The
+    !       elements of X must be strictly increasing:
+    !            X(I-1) .LT. X(I),  I = 2(1)N.
+    !       (Error return if not.)
+    !
+    ! F -- (input) real array of function values.  F(1+(I-1)*INCFD) is
+    !       the value corresponding to X(I).
+    !
+    ! D -- (input) real array of derivative values.  D(1+(I-1)*INCFD) is
+    !       the value corresponding to X(I).
+    !
+    ! INCFD -- (input) increment between successive values in F and D.
+    !       (Error return if  INCFD.LT.1 .)
+    !
+    ! SKIP -- (input/output) logical variable which should be set to
+    !       .TRUE. if the user wishes to skip checks for validity of
+    !       preceding parameters, or to .FALSE. otherwise.
+    !       This will save time in case these checks have already
+    !       been performed (say, in PCHIM or PCHIC).
+    !       SKIP will be set to .TRUE. on normal return.
+    !
+    ! NE -- (input) number of evaluation points.  (Error return if
+    !       NE.LT.1 .)
+    !
+    ! XE -- (input) real array of points at which the function is to be
+    !       evaluated.
+    !
+    !      NOTES:
+    !       1. The evaluation will be most efficient if the elements
+    !          of XE are increasing relative to X;
+    !          that is,   XE(J) .GE. X(I)
+    !          implies    XE(K) .GE. X(I),  all K.GE.J .
+    !       2. If any of the XE are outside the interval [X(1),X(N)],
+    !          values are extrapolated from the nearest extreme cubic,
+    !          and a warning error is returned.
+    !
+    ! FE -- (output) real array of values of the cubic Hermite function
+    !       defined by  N, X, F, D  at the points  XE.
+    !
+    ! IERR -- (output) error flag.
+    !       Normal return:
+    !          IERR = 0  (no errors).
+    !       Warning error:
+    !          IERR.GT.0  means that extrapolation was performed at
+    !             IERR points.
+    !       "Recoverable" errors:
+    !          IERR = -1  if N.LT.2 .
+    !          IERR = -2  if INCFD.LT.1 .
+    !          IERR = -3  if the X-array is not strictly increasing.
+    !          IERR = -4  if NE.LT.1 .
+    !         (The FE-array has not been changed in any of these cases.)
+    !           NOTE:  The above errors are checked in the order listed,
+    !               and following arguments have **NOT** been validated.
+    !
+    !***REFERENCES  (NONE)
+    !***ROUTINES CALLED  CHFEV, XERMSG
+    !***REVISION HISTORY  (YYMMDD)
+    !   811020  DATE WRITTEN
+    !   820803  Minor cosmetic changes for release 1.
+    !   870707  Minor cosmetic changes to prologue.
+    !   890531  Changed all specific intrinsics to generic.  (WRB)
+    !   890831  Modified array declarations.  (WRB)
+    !   890831  REVISION DATE from Version 3.2
+    !   891214  Prologue converted to Version 4.0 format.  (BAB)
+    !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
+    !***END PROLOGUE  PCHFE
+    !  Programming notes:
+    !
+    ! 1. To produce a double precision version, simply:
+    !    a. Change PCHFE to DPCHFE, and CHFEV to DCHFEV, wherever they
+    !       occur,
+    !    b. Change the real declaration to double precision,
+    !
+    ! 2. Most of the coding between the CALL to CHFEV and the end of
+    !    the IR-loop could be eliminated if it were permissible to
+    !    assume that XE is ordered relative to X.
+    !
+    ! 3. CHFEV does not assume that X1 is less than X2.  thus, it would
+    !    be possible to write a version of PCHFE that assumes a strict-
+    !    ly decreasing X-array by simply running the IR-loop backwards
+    !    (and reversing the order of appropriate tests).
+    !
+    ! 4. The present code has a minor bug, which I have decided is not
+    !    worth the effort that would be required to fix it.
+    !    If XE contains points in [X(N-1),X(N)], followed by points .LT.
+    !    X(N-1), followed by points .GT.X(N), the extrapolation points
+    !    will be counted (at least) twice in the total returned in IERR.
+    !
+    !  DECLARE ARGUMENTS.
+    !
+    INTEGER :: N, INCFD, NE, IERR
+    REAL :: X(*), F(INCFD, *), D(INCFD, *), XE(*), FE(*)
+    LOGICAL :: SKIP
+    !
+    !  DECLARE LOCAL VARIABLES.
+    !
+    INTEGER :: I, IERC, IR, J, JFIRST, NEXT(2), NJ
+    !
+    !  VALIDITY-CHECK ARGUMENTS.
+    !
+    !***FIRST EXECUTABLE STATEMENT  PCHFE
+    IF (SKIP)  GO TO 5
+    !
+    IF (N<2)  GO TO 5001
+    IF (INCFD<1)  GO TO 5002
+    DO I = 2, N
+      IF (X(I)<=X(I - 1))  GO TO 5003
+    END DO
+    !
+    !  FUNCTION DEFINITION IS OK, GO ON.
+    !
+    5   CONTINUE
+    IF (NE<1)  GO TO 5004
+    IERR = 0
+    SKIP = .TRUE.
+    !
+    !  LOOP OVER INTERVALS.        (   INTERVAL INDEX IS  IL = IR-1  . )
+    !                              ( INTERVAL IS X(IL).LE.X.LT.X(IR) . )
+    JFIRST = 1
+    IR = 2
+    10   CONTINUE
+    !
+    ! SKIP OUT OF LOOP IF HAVE PROCESSED ALL EVALUATION POINTS.
+    !
+    IF (JFIRST > NE)  GO TO 5000
+    !
+    ! LOCATE ALL POINTS IN INTERVAL.
+    !
+    DO J = JFIRST, NE
+      IF (XE(J) >= X(IR))  GO TO 30
+    END DO
+    J = NE + 1
+    GO TO 40
+    !
+    ! HAVE LOCATED FIRST POINT BEYOND INTERVAL.
+    !
+    30   CONTINUE
+    IF (IR == N)  J = NE + 1
+    !
+    40   CONTINUE
+    NJ = J - JFIRST
+    !
+    ! SKIP EVALUATION IF NO POINTS IN INTERVAL.
+    !
+    IF (NJ == 0)  GO TO 50
+    !
+    ! EVALUATE CUBIC AT XE(I),  I = JFIRST (1) J-1 .
+    !
+    !   ----------------------------------------------------------------
+    CALL CHFEV (X(IR - 1), X(IR), F(1, IR - 1), F(1, IR), D(1, IR - 1), D(1, IR), &
+            NJ, XE(JFIRST), FE(JFIRST), NEXT, IERC)
+    ! ----------------------------------------------------------------
+    IF (IERC < 0)  GO TO 5005
+    !
+    IF (NEXT(2) == 0)  GO TO 42
+    ! IF (NEXT(2) .GT. 0)  THEN
+    !    IN THE CURRENT SET OF XE-POINTS, THERE ARE NEXT(2) TO THE
+    !    RIGHT OF X(IR).
+    !
+    IF (IR < N)  GO TO 41
+    ! IF (IR .EQ. N)  THEN
+    !    THESE ARE ACTUALLY EXTRAPOLATION POINTS.
+    IERR = IERR + NEXT(2)
+    GO TO 42
+    41    CONTINUE
+    ! ELSE
+    !    WE SHOULD NEVER HAVE GOTTEN HERE.
+    GO TO 5005
+    ! ENDIF
+    ! ENDIF
+    42   CONTINUE
+    !
+    IF (NEXT(1) == 0)  GO TO 49
+    ! IF (NEXT(1) .GT. 0)  THEN
+    !    IN THE CURRENT SET OF XE-POINTS, THERE ARE NEXT(1) TO THE
+    !    LEFT OF X(IR-1).
+    !
+    IF (IR > 2)  GO TO 43
+    ! IF (IR .EQ. 2)  THEN
+    !    THESE ARE ACTUALLY EXTRAPOLATION POINTS.
+    IERR = IERR + NEXT(1)
+    GO TO 49
+    43    CONTINUE
+    ! ELSE
+    !    XE IS NOT ORDERED RELATIVE TO X, SO MUST ADJUST
+    !    EVALUATION INTERVAL.
+    !
+    !          FIRST, LOCATE FIRST POINT TO LEFT OF X(IR-1).
+    DO I = JFIRST, J - 1
+      IF (XE(I) < X(IR - 1))  GO TO 45
+    END DO
+    ! NOTE-- CANNOT DROP THROUGH HERE UNLESS THERE IS AN ERROR
+    !        IN CHFEV.
+    GO TO 5005
+    !
+    45       CONTINUE
+    ! RESET J.  (THIS WILL BE THE NEW JFIRST.)
+    J = I
+    !
+    !          NOW FIND OUT HOW FAR TO BACK UP IN THE X-ARRAY.
+    DO I = 1, IR - 1
+      IF (XE(J) < X(I)) GO TO 47
+    END DO
+    ! NB-- CAN NEVER DROP THROUGH HERE, SINCE XE(J).LT.X(IR-1).
+    !
+    47       CONTINUE
+    ! AT THIS POINT, EITHER  XE(J) .LT. X(1)
+    !    OR      X(I-1) .LE. XE(J) .LT. X(I) .
+    ! RESET IR, RECOGNIZING THAT IT WILL BE INCREMENTED BEFORE
+    ! CYCLING.
+    IR = MAX(1, I - 1)
+    ! ENDIF
+    ! ENDIF
+    49   CONTINUE
+    !
+    JFIRST = J
+    !
+    ! END OF IR-LOOP.
+    !
+    50   CONTINUE
+    IR = IR + 1
+    IF (IR <= N)  GO TO 10
+    !
+    !  NORMAL RETURN.
+    !
+    5000   CONTINUE
+    RETURN
+    !
+    !  ERROR RETURNS.
+    !
+    5001   CONTINUE
+    ! N.LT.2 RETURN.
+    IERR = -1
+    CALL XERMSG ('SLATEC', 'PCHFE', &
+            'NUMBER OF DATA POINTS LESS THAN TWO', IERR, 1)
+    RETURN
+    !
+    5002   CONTINUE
+    ! INCFD.LT.1 RETURN.
+    IERR = -2
+    CALL XERMSG ('SLATEC', 'PCHFE', 'INCREMENT LESS THAN ONE', IERR, &
+            1)
+    RETURN
+    !
+    5003   CONTINUE
+    ! X-ARRAY NOT STRICTLY INCREASING.
+    IERR = -3
+    CALL XERMSG ('SLATEC', 'PCHFE', 'X-ARRAY NOT STRICTLY INCREASING' &
+            , IERR, 1)
+    RETURN
+    !
+    5004   CONTINUE
+    ! NE.LT.1 RETURN.
+    IERR = -4
+    CALL XERMSG ('SLATEC', 'PCHFE', &
+            'NUMBER OF EVALUATION POINTS LESS THAN ONE', IERR, 1)
+    RETURN
+    !
+    5005   CONTINUE
+    ! ERROR RETURN FROM CHFEV.
+    !   *** THIS CASE SHOULD NEVER OCCUR ***
+    IERR = -5
+    CALL XERMSG ('SLATEC', 'PCHFE', &
+            'ERROR RETURN FROM CHFEV -- FATAL', IERR, 2)
+    RETURN
+    !------------- LAST LINE OF PCHFE FOLLOWS ------------------------------
+  END SUBROUTINE PCHFE
+
+  SUBROUTINE PCHFE_95(X, F, D, SKIP, XE, FE, IERR)
+
+    ! PURPOSE  Evaluate a piecewise cubic Hermite function at an array of
+    !            points.  May be used by itself for Hermite interpolation,
+    !            or as an evaluator for PCHIM or PCHIC.
+    ! CATEGORY  E3
+    ! KEYWORDS  CUBIC HERMITE EVALUATION, HERMITE INTERPOLATION, PCHIP,
+    !             PIECEWISE CUBIC EVALUATION
+
+    !          PCHFE:  Piecewise Cubic Hermite Function Evaluator
+    ! Evaluates the cubic Hermite function defined by  X, F, D  at
+    ! the points  XE.
+
+    use lmdz_assert_eq, only: assert_eq
+
+    REAL, intent(in) :: X(:) ! real array of independent variable values
+    ! The elements of X must be strictly increasing.
+
+    REAL, intent(in) :: F(:) ! real array of function values
+    ! F(I) is the value corresponding to X(I).
+
+    REAL, intent(in) :: D(:) ! real array of derivative values
+    ! D(I) is the value corresponding to X(I).
+
+    LOGICAL, intent(inout) :: SKIP
+    ! request to skip checks for validity of "x"
+    ! If "skip" is false then "pchfe" will check that size(x) >= 2 and
+    ! "x" is in strictly ascending order.
+    ! Setting "skip" to true will save time in case these checks have
+    ! already been performed (say, in "PCHIM" or "PCHIC").
+    ! "SKIP" will be set to TRUE on normal return.
+
+    real, intent(in) :: XE(:) ! points at which the function is to be evaluated
+    ! NOTES:
+    ! 1. The evaluation will be most efficient if the elements of XE
+    ! are increasing relative to X.
+    ! That is,   XE(J) .GE. X(I)
+    ! implies    XE(K) .GE. X(I),  all K.GE.J
+    ! 2. If any of the XE are outside the interval [X(1),X(N)], values
+    ! are extrapolated from the nearest extreme cubic, and a warning
+    ! error is returned.
+
+    real, intent(out) :: FE(:) ! values of the cubic Hermite function
+    ! defined by X, F, D at the points XE
+
+    integer, intent(out) :: IERR ! error flag
+    ! Normal return:
+    ! IERR = 0  no error
+    ! Warning error:
+    ! IERR > 0  means that extrapolation was performed at IERR points
+    ! "Recoverable" errors:
+    !              IERR = -1  if N < 2
+    !              IERR = -3  if the X-array is not strictly increasing
+    !              IERR = -4  if NE < 1
+    ! NOTE: The above errors are checked in the order listed, and
+    ! following arguments have **NOT** been validated.
+
+    ! Variables local to the procedure:
+
+    INTEGER  N, NE
+
+    !---------------------------------------
+
+    n = assert_eq(size(x), size(f), size(d), "PCHFE_95 n")
+    ne = assert_eq(size(xe), size(fe), "PCHFE_95 ne")
+    CALL PCHFE(N, X, F, D, 1, SKIP, NE, XE, FE, IERR)
+
+  END SUBROUTINE  PCHFE_95
+
+  FUNCTION pchsp_95(x, f, ibeg, iend, vc_beg, vc_end)
+
+    ! PURPOSE: Set derivatives needed to determine the Hermite
+    ! representation of the cubic spline interpolant to given data,
+    ! with specified boundary conditions.
+
+    ! Part of the "pchip" package.
+
+    ! CATEGORY: E1A
+
+    ! KEYWORDS: cubic hermite interpolation, piecewise cubic
+    ! interpolation, spline interpolation
+
+    ! DESCRIPTION: "pchsp" stands for "Piecewise Cubic Hermite Spline"
+    ! Computes the Hermite representation of the cubic spline
+    ! interpolant to the data given in X and F satisfying the boundary
+    ! conditions specified by Ibeg, iend, vc_beg and VC_end.
+
+    ! The resulting piecewise cubic Hermite function may be evaluated
+    ! by "pchfe" or "pchfd".
+
+    ! NOTE: This is a modified version of C. de Boor's cubic spline
+    ! routine "cubspl".
+
+    ! REFERENCE: Carl de Boor, A Practical Guide to Splines, Springer,
+    ! 2001, pages 43-47
+
+    use lmdz_assert_eq, only: assert_eq
+
+    real, intent(in) :: x(:)
+    ! independent variable values
+    ! The elements of X must be strictly increasing:
+    !                X(I-1) < X(I),  I = 2...N.
+    !           (Error return if not.)
+    ! (error if size(x) < 2)
+
+    real, intent(in) :: f(:)
+    !     dependent variable values to be interpolated
+    !  F(I) is value corresponding to X(I).
+
+    INTEGER, intent(in) :: ibeg
+    !     desired boundary condition at beginning of data
+
+    !        IBEG = 0  to set pchsp_95(1) so that the third derivative is con-
+    !              tinuous at X(2).  This is the "not a knot" condition
+    !              provided by de Boor's cubic spline routine CUBSPL.
+    !              This is the default boundary condition.
+    !        IBEG = 1  if first derivative at X(1) is given in VC_BEG.
+    !        IBEG = 2  if second derivative at X(1) is given in VC_BEG.
+    !        IBEG = 3  to use the 3-point difference formula for pchsp_95(1).
+    !              (Reverts to the default boundary condition if size(x) < 3 .)
+    !        IBEG = 4  to use the 4-point difference formula for pchsp_95(1).
+    !              (Reverts to the default boundary condition if size(x) < 4 .)
+
+    !          NOTES:
+    !           1. An error return is taken if IBEG is out of range.
+    !           2. For the "natural" boundary condition, use IBEG=2 and
+    !              VC_BEG=0.
+
+    INTEGER, intent(in) :: iend
+    !           IC(2) = IEND, desired condition at end of data.
+    !  IEND may take on the same values as IBEG, but applied to
+    !  derivative at X(N). In case IEND = 1 or 2, The value is given in VC_END.
+
+    !          NOTES:
+    !           1. An error return is taken if IEND is out of range.
+    !           2. For the "natural" boundary condition, use IEND=2 and
+    !              VC_END=0.
+
+    REAL, intent(in), optional :: vc_beg
+    ! desired boundary value, as indicated above.
+    !           VC_BEG need be set only if IBEG = 1 or 2 .
+
+    REAL, intent(in), optional :: vc_end
+    ! desired boundary value, as indicated above.
+    !           VC_END need be set only if Iend = 1 or 2 .
+
+    real pchsp_95(size(x))
+    ! derivative values at the data points
+    !           These values will determine the cubic spline interpolant
+    !           with the requested boundary conditions.
+    !           The value corresponding to X(I) is stored in
+    !                PCHSP_95(I),  I=1...N.
+
+    ! LOCAL VARIABLES:
+    real wk(2, size(x)) ! real array of working storage
+    INTEGER n ! number of data points
+    integer ierr, ic(2)
+    real vc(2)
+
+    !-------------------------------------------------------------------
+
+    n = assert_eq(size(x), size(f), "pchsp_95 n")
+    if ((ibeg == 1 .or. ibeg == 2) .and. .not. present(vc_beg)) then
+      print *, "vc_beg required for IBEG = 1 or 2"
+      stop 1
+    end if
+    if ((iend == 1 .or. iend == 2) .and. .not. present(vc_end)) then
+      print *, "vc_end required for IEND = 1 or 2"
+      stop 1
+    end if
+    ic = (/ibeg, iend/)
+    if (present(vc_beg)) vc(1) = vc_beg
+    if (present(vc_end)) vc(2) = vc_end
+    CALL PCHSP(IC, VC, N, X, F, pchsp_95, 1, WK, size(WK), IERR)
+    if (ierr /= 0) stop 1
+
+  END FUNCTION pchsp_95
+
+  REAL FUNCTION PCHDF(K, X, S, IERR)
+    !***BEGIN PROLOGUE  PCHDF
+    !***SUBSIDIARY
+    !***PURPOSE  Computes divided differences for PCHCE and PCHSP
+    !***LIBRARY   SLATEC (PCHIP)
+    !***TYPE      SINGLE PRECISION (PCHDF-S, DPCHDF-D)
+    !***AUTHOR  Fritsch, F. N., (LLNL)
+    !***DESCRIPTION
+    !
+    !      PCHDF:   PCHIP Finite Difference Formula
+    !
+    ! Uses a divided difference formulation to compute a K-point approx-
+    ! imation to the derivative at X(K) based on the data in X and S.
+    !
+    ! Called by  PCHCE  and  PCHSP  to compute 3- and 4-point boundary
+    ! derivative approximations.
+    !
+    ! ----------------------------------------------------------------------
+    !
+    ! On input:
+    !    K      is the order of the desired derivative approximation.
+    !           K must be at least 3 (error return if not).
+    !    X      contains the K values of the independent variable.
+    !           X need not be ordered, but the values **MUST** be
+    !           distinct.  (Not checked here.)
+    !    S      contains the associated slope values:
+    !              S(I) = (F(I+1)-F(I))/(X(I+1)-X(I)), I=1(1)K-1.
+    !           (Note that S need only be of length K-1.)
+    !
+    ! On return:
+    !    S      will be destroyed.
+    !    IERR   will be set to -1 if K.LT.2 .
+    !    PCHDF  will be set to the desired derivative approximation if
+    !           IERR=0 or to zero if IERR=-1.
+    !
+    ! ----------------------------------------------------------------------
+    !
+    !***SEE ALSO  PCHCE, PCHSP
+    !***REFERENCES  Carl de Boor, A Practical Guide to Splines, Springer-
+    !             Verlag, New York, 1978, pp. 10-16.
+    !***ROUTINES CALLED  XERMSG
+    !***REVISION HISTORY  (YYMMDD)
+    !   820503  DATE WRITTEN
+    !   820805  Converted to SLATEC library version.
+    !   870813  Minor cosmetic changes.
+    !   890411  Added SAVE statements (Vers. 3.2).
+    !   890411  REVISION DATE from Version 3.2
+    !   891214  Prologue converted to Version 4.0 format.  (BAB)
+    !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
+    !   900328  Added TYPE section.  (WRB)
+    !   910408  Updated AUTHOR and DATE WRITTEN sections in prologue.  (WRB)
+    !   920429  Revised format and order of references.  (WRB,FNF)
+    !   930503  Improved purpose.  (FNF)
+    !***END PROLOGUE  PCHDF
+    !
+    !**End
+    !
+    !  DECLARE ARGUMENTS.
+    !
+    INTEGER :: K, IERR
+    REAL :: X(K), S(K)
+    !
+    !  DECLARE LOCAL VARIABLES.
+    !
+    INTEGER :: I, J
+    REAL :: VALUE, ZERO
+    SAVE ZERO
+    DATA  ZERO /0./
+    !
+    !  CHECK FOR LEGAL VALUE OF K.
+    !
+    !***FIRST EXECUTABLE STATEMENT  PCHDF
+    IF (K < 3)  GO TO 5001
+    !
+    !  COMPUTE COEFFICIENTS OF INTERPOLATING POLYNOMIAL.
+    !
+    DO J = 2, K - 1
+      DO I = 1, K - J
+        S(I) = (S(I + 1) - S(I)) / (X(I + J) - X(I))
+      END DO
+    END DO
+    !
+    !  EVALUATE DERIVATIVE AT X(K).
+    !
+    VALUE = S(1)
+    DO I = 2, K - 1
+      VALUE = S(I) + VALUE * (X(K) - X(I))
+    END DO
+    !
+    !  NORMAL RETURN.
+    !
+    IERR = 0
+    PCHDF = VALUE
+    RETURN
+    !
+    !  ERROR RETURN.
+    !
+    5001   CONTINUE
+    ! K.LT.3 RETURN.
+    IERR = -1
+    CALL XERMSG ('SLATEC', 'PCHDF', 'K LESS THAN THREE', IERR, 1)
+    PCHDF = ZERO
+    RETURN
+    !------------- LAST LINE OF PCHDF FOLLOWS ------------------------------
+  END FUNCTION PCHDF
+
+  SUBROUTINE PCHSP(IC, VC, N, X, F, D, INCFD, WK, NWK, IERR)
+    !***BEGIN PROLOGUE  PCHSP
+    !***PURPOSE  Set derivatives needed to determine the Hermite represen-
+    ! tation of the cubic spline interpolant to given data, with
+    ! specified boundary conditions.
+    !***LIBRARY   SLATEC (PCHIP)
+    !***CATEGORY  E1A
+    !***TYPE      SINGLE PRECISION (PCHSP-S, DPCHSP-D)
+    !***KEYWORDS  CUBIC HERMITE INTERPOLATION, PCHIP,
+    !  PIECEWISE CUBIC INTERPOLATION, SPLINE INTERPOLATION
+    !***AUTHOR  Fritsch, F. N., (LLNL)
+    !  Lawrence Livermore National Laboratory
+    !  P.O. Box 808  (L-316)
+    !  Livermore, CA  94550
+    !  FTS 532-4275, (510) 422-4275
+    !***DESCRIPTION
+    !
+    !      PCHSP:   Piecewise Cubic Hermite Spline
+    !
+    ! Computes the Hermite representation of the cubic spline inter-
+    ! polant to the data given in X and F satisfying the boundary
+    ! conditions specified by IC and VC.
+    !
+    ! To facilitate two-dimensional applications, includes an increment
+    ! between successive values of the F- and D-arrays.
+    !
+    ! The resulting piecewise cubic Hermite function may be evaluated
+    ! by PCHFE or PCHFD.
+    !
+    ! NOTE:  This is a modified version of C. de Boor's cubic spline
+    !        routine CUBSPL.
+    !
+    ! ----------------------------------------------------------------------
+    !
+    !  Calling sequence:
+    !
+    !    PARAMETER  (INCFD = ...)
+    !    INTEGER  IC(2), N, NWK, IERR
+    !    REAL  VC(2), X(N), F(INCFD,N), D(INCFD,N), WK(NWK)
+    !
+    !    CALL  PCHSP (IC, VC, N, X, F, D, INCFD, WK, NWK, IERR)
+    !
+    !   Parameters:
+    !
+    ! IC -- (input) integer array of length 2 specifying desired
+    !       boundary conditions:
+    !       IC(1) = IBEG, desired condition at beginning of data.
+    !       IC(2) = IEND, desired condition at end of data.
+    !
+    !       IBEG = 0  to set D(1) so that the third derivative is con-
+    !          tinuous at X(2).  This is the "not a knot" condition
+    !          provided by de Boor's cubic spline routine CUBSPL.
+    !          < This is the default boundary condition. >
+    !       IBEG = 1  if first derivative at X(1) is given in VC(1).
+    !       IBEG = 2  if second derivative at X(1) is given in VC(1).
+    !       IBEG = 3  to use the 3-point difference formula for D(1).
+    !                 (Reverts to the default b.c. if N.LT.3 .)
+    !       IBEG = 4  to use the 4-point difference formula for D(1).
+    !                 (Reverts to the default b.c. if N.LT.4 .)
+    !      NOTES:
+    !       1. An error return is taken if IBEG is out of range.
+    !       2. For the "natural" boundary condition, use IBEG=2 and
+    !          VC(1)=0.
+    !
+    !       IEND may take on the same values as IBEG, but applied to
+    !       derivative at X(N).  In case IEND = 1 or 2, the value is
+    !       given in VC(2).
+    !
+    !      NOTES:
+    !       1. An error return is taken if IEND is out of range.
+    !       2. For the "natural" boundary condition, use IEND=2 and
+    !          VC(2)=0.
+    !
+    ! VC -- (input) real array of length 2 specifying desired boundary
+    !       values, as indicated above.
+    !       VC(1) need be set only if IC(1) = 1 or 2 .
+    !       VC(2) need be set only if IC(2) = 1 or 2 .
+    !
+    ! N -- (input) number of data points.  (Error return if N.LT.2 .)
+    !
+    ! X -- (input) real array of independent variable values.  The
+    !       elements of X must be strictly increasing:
+    !            X(I-1) .LT. X(I),  I = 2(1)N.
+    !       (Error return if not.)
+    !
+    ! F -- (input) real array of dependent variable values to be inter-
+    !       polated.  F(1+(I-1)*INCFD) is value corresponding to X(I).
+    !
+    ! D -- (output) real array of derivative values at the data points.
+    !       These values will determine the cubic spline interpolant
+    !       with the requested boundary conditions.
+    !       The value corresponding to X(I) is stored in
+    !            D(1+(I-1)*INCFD),  I=1(1)N.
+    !       No other entries in D are changed.
+    !
+    ! INCFD -- (input) increment between successive values in F and D.
+    !       This argument is provided primarily for 2-D applications.
+    !       (Error return if  INCFD.LT.1 .)
+    !
+    ! WK -- (scratch) real array of working storage.
+    !
+    ! NWK -- (input) length of work array.
+    !       (Error return if NWK.LT.2*N .)
+    !
+    ! IERR -- (output) error flag.
+    !       Normal return:
+    !          IERR = 0  (no errors).
+    !       "Recoverable" errors:
+    !          IERR = -1  if N.LT.2 .
+    !          IERR = -2  if INCFD.LT.1 .
+    !          IERR = -3  if the X-array is not strictly increasing.
+    !          IERR = -4  if IBEG.LT.0 or IBEG.GT.4 .
+    !          IERR = -5  if IEND.LT.0 of IEND.GT.4 .
+    !          IERR = -6  if both of the above are true.
+    !          IERR = -7  if NWK is too small.
+    !           NOTE:  The above errors are checked in the order listed,
+    !               and following arguments have **NOT** been validated.
+    !         (The D-array has not been changed in any of these cases.)
+    !          IERR = -8  in case of trouble solving the linear system
+    !                     for the interior derivative values.
+    !         (The D-array may have been changed in this case.)
+    !         (             Do **NOT** use it!                )
+    !
+    !***REFERENCES  Carl de Boor, A Practical Guide to Splines, Springer-
+    !             Verlag, New York, 1978, pp. 53-59.
+    !***ROUTINES CALLED  PCHDF, XERMSG
+    !***REVISION HISTORY  (YYMMDD)
+    !   820503  DATE WRITTEN
+    !   820804  Converted to SLATEC library version.
+    !   870707  Minor cosmetic changes to prologue.
+    !   890411  Added SAVE statements (Vers. 3.2).
+    !   890703  Corrected category record.  (WRB)
+    !   890831  Modified array declarations.  (WRB)
+    !   890831  REVISION DATE from Version 3.2
+    !   891214  Prologue converted to Version 4.0 format.  (BAB)
+    !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
+    !   920429  Revised format and order of references.  (WRB,FNF)
+    !***END PROLOGUE  PCHSP
+    !  Programming notes:
+    !
+    ! To produce a double precision version, simply:
+    !    a. Change PCHSP to DPCHSP wherever it occurs,
+    !    b. Change the real declarations to double precision, and
+    !    c. Change the constants ZERO, HALF, ... to double precision.
+    !
+    !  DECLARE ARGUMENTS.
+    !
+    INTEGER :: IC(2), N, INCFD, NWK, IERR
+    REAL :: VC(2), X(*), F(INCFD, *), D(INCFD, *), WK(2, *)
+    !
+    !  DECLARE LOCAL VARIABLES.
+    !
+    INTEGER :: IBEG, IEND, INDEX, J, NM1
+    REAL :: G, HALF, ONE, STEMP(3), THREE, TWO, XTEMP(4), ZERO
+    SAVE ZERO, HALF, ONE, TWO, THREE
+    REAL :: PCHDF
+    !
+    DATA  ZERO /0./, HALF /0.5/, ONE /1./, TWO /2./, THREE /3./
+    !
+    !  VALIDITY-CHECK ARGUMENTS.
+    !
+    !***FIRST EXECUTABLE STATEMENT  PCHSP
+    IF (N<2)  GO TO 5001
+    IF (INCFD<1)  GO TO 5002
+    DO J = 2, N
+      IF (X(J)<=X(J - 1))  GO TO 5003
+    END DO
+    !
+    IBEG = IC(1)
+    IEND = IC(2)
+    IERR = 0
+    IF ((IBEG<0).OR.(IBEG>4))  IERR = IERR - 1
+    IF ((IEND<0).OR.(IEND>4))  IERR = IERR - 2
+    IF (IERR<0)  GO TO 5004
+    !
+    !  FUNCTION DEFINITION IS OK -- GO ON.
+    !
+    IF (NWK < 2 * N)  GO TO 5007
+    !
+    !  COMPUTE FIRST DIFFERENCES OF X SEQUENCE AND STORE IN WK(1,.). ALSO,
+    !  COMPUTE FIRST DIVIDED DIFFERENCE OF DATA AND STORE IN WK(2,.).
+    DO J = 2, N
+      WK(1, J) = X(J) - X(J - 1)
+      WK(2, J) = (F(1, J) - F(1, J - 1)) / WK(1, J)
+    END DO
+    !
+    !  SET TO DEFAULT BOUNDARY CONDITIONS IF N IS TOO SMALL.
+    !
+    IF (IBEG>N)  IBEG = 0
+    IF (IEND>N)  IEND = 0
+    !
+    !  SET UP FOR BOUNDARY CONDITIONS.
+    !
+    IF ((IBEG==1).OR.(IBEG==2))  THEN
+      D(1, 1) = VC(1)
+    ELSE IF (IBEG > 2)  THEN
+      ! PICK UP FIRST IBEG POINTS, IN REVERSE ORDER.
+      DO J = 1, IBEG
+        INDEX = IBEG - J + 1
+        ! INDEX RUNS FROM IBEG DOWN TO 1.
+        XTEMP(J) = X(INDEX)
+        IF (J < IBEG)  STEMP(J) = WK(2, INDEX)
+      END DO
+      ! --------------------------------
+      D(1, 1) = PCHDF (IBEG, XTEMP, STEMP, IERR)
+      ! --------------------------------
+      IF (IERR /= 0)  GO TO 5009
+      IBEG = 1
+    ENDIF
+    !
+    IF ((IEND==1).OR.(IEND==2))  THEN
+      D(1, N) = VC(2)
+    ELSE IF (IEND > 2)  THEN
+      ! PICK UP LAST IEND POINTS.
+      DO J = 1, IEND
+        INDEX = N - IEND + J
+        ! INDEX RUNS FROM N+1-IEND UP TO N.
+        XTEMP(J) = X(INDEX)
+        IF (J < IEND)  STEMP(J) = WK(2, INDEX + 1)
+      END DO
+      ! --------------------------------
+      D(1, N) = PCHDF (IEND, XTEMP, STEMP, IERR)
+      ! --------------------------------
+      IF (IERR /= 0)  GO TO 5009
+      IEND = 1
+    ENDIF
+    !
+    ! --------------------( BEGIN CODING FROM CUBSPL )--------------------
+    !
+    !  **** A TRIDIAGONAL LINEAR SYSTEM FOR THE UNKNOWN SLOPES S(J) OF
+    !  F  AT X(J), J=1,...,N, IS GENERATED AND THEN SOLVED BY GAUSS ELIM-
+    !  INATION, WITH S(J) ENDING UP IN D(1,J), ALL J.
+    ! WK(1,.) AND WK(2,.) ARE USED FOR TEMPORARY STORAGE.
+    !
+    !  CONSTRUCT FIRST EQUATION FROM FIRST BOUNDARY CONDITION, OF THE FORM
+    !         WK(2,1)*S(1) + WK(1,1)*S(2) = D(1,1)
+    !
+    IF (IBEG == 0)  THEN
+      IF (N == 2)  THEN
+        ! NO CONDITION AT LEFT END AND N = 2.
+        WK(2, 1) = ONE
+        WK(1, 1) = ONE
+        D(1, 1) = TWO * WK(2, 2)
+      ELSE
+        ! NOT-A-KNOT CONDITION AT LEFT END AND N .GT. 2.
+        WK(2, 1) = WK(1, 3)
+        WK(1, 1) = WK(1, 2) + WK(1, 3)
+        D(1, 1) = ((WK(1, 2) + TWO * WK(1, 1)) * WK(2, 2) * WK(1, 3) &
+                + WK(1, 2)**2 * WK(2, 3)) / WK(1, 1)
+      ENDIF
+    ELSE IF (IBEG == 1)  THEN
+      ! SLOPE PRESCRIBED AT LEFT END.
+      WK(2, 1) = ONE
+      WK(1, 1) = ZERO
+    ELSE
+      ! SECOND DERIVATIVE PRESCRIBED AT LEFT END.
+      WK(2, 1) = TWO
+      WK(1, 1) = ONE
+      D(1, 1) = THREE * WK(2, 2) - HALF * WK(1, 2) * D(1, 1)
+    ENDIF
+    !
+    !  IF THERE ARE INTERIOR KNOTS, GENERATE THE CORRESPONDING EQUATIONS AND
+    !  CARRY OUT THE FORWARD PASS OF GAUSS ELIMINATION, AFTER WHICH THE J-TH
+    !  EQUATION READS    WK(2,J)*S(J) + WK(1,J)*S(J+1) = D(1,J).
+    !
+    NM1 = N - 1
+    IF (NM1 > 1)  THEN
+      DO J = 2, NM1
+        IF (WK(2, J - 1) == ZERO)  GO TO 5008
+        G = -WK(1, J + 1) / WK(2, J - 1)
+        D(1, J) = G * D(1, J - 1) &
+                + THREE * (WK(1, J) * WK(2, J + 1) + WK(1, J + 1) * WK(2, J))
+        WK(2, J) = G * WK(1, J - 1) + TWO * (WK(1, J) + WK(1, J + 1))
+      END DO
+    ENDIF
+    !
+    !  CONSTRUCT LAST EQUATION FROM SECOND BOUNDARY CONDITION, OF THE FORM
+    !       (-G*WK(2,N-1))*S(N-1) + WK(2,N)*S(N) = D(1,N)
+    !
+    ! IF SLOPE IS PRESCRIBED AT RIGHT END, ONE CAN GO DIRECTLY TO BACK-
+    ! SUBSTITUTION, SINCE ARRAYS HAPPEN TO BE SET UP JUST RIGHT FOR IT
+    ! AT THIS POINT.
+    IF (IEND == 1)  GO TO 30
+    !
+    IF (IEND == 0)  THEN
+      IF (N==2 .AND. IBEG==0)  THEN
+        ! NOT-A-KNOT AT RIGHT ENDPOINT AND AT LEFT ENDPOINT AND N = 2.
+        D(1, 2) = WK(2, 2)
+        GO TO 30
+      ELSE IF ((N==2) .OR. (N==3 .AND. IBEG==0))  THEN
+        ! EITHER (N=3 AND NOT-A-KNOT ALSO AT LEFT) OR (N=2 AND *NOT*
+        ! NOT-A-KNOT AT LEFT END POINT).
+        D(1, N) = TWO * WK(2, N)
+        WK(2, N) = ONE
+        IF (WK(2, N - 1) == ZERO)  GO TO 5008
+        G = -ONE / WK(2, N - 1)
+      ELSE
+        ! NOT-A-KNOT AND N .GE. 3, AND EITHER N.GT.3 OR  ALSO NOT-A-
+        ! KNOT AT LEFT END POINT.
+        G = WK(1, N - 1) + WK(1, N)
+        ! DO NOT NEED TO CHECK FOLLOWING DENOMINATORS (X-DIFFERENCES).
+        D(1, N) = ((WK(1, N) + TWO * G) * WK(2, N) * WK(1, N - 1) &
+                + WK(1, N)**2 * (F(1, N - 1) - F(1, N - 2)) / WK(1, N - 1)) / G
+        IF (WK(2, N - 1) == ZERO)  GO TO 5008
+        G = -G / WK(2, N - 1)
+        WK(2, N) = WK(1, N - 1)
+      ENDIF
+    ELSE
+      ! SECOND DERIVATIVE PRESCRIBED AT RIGHT ENDPOINT.
+      D(1, N) = THREE * WK(2, N) + HALF * WK(1, N) * D(1, N)
+      WK(2, N) = TWO
+      IF (WK(2, N - 1) == ZERO)  GO TO 5008
+      G = -ONE / WK(2, N - 1)
+    ENDIF
+    !
+    !  COMPLETE FORWARD PASS OF GAUSS ELIMINATION.
+    !
+    WK(2, N) = G * WK(1, N - 1) + WK(2, N)
+    IF (WK(2, N) == ZERO)   GO TO 5008
+    D(1, N) = (G * D(1, N - 1) + D(1, N)) / WK(2, N)
+    !
+    !  CARRY OUT BACK SUBSTITUTION
+    !
+    30   CONTINUE
+    DO J = NM1, 1, -1
+      IF (WK(2, J) == ZERO)  GO TO 5008
+      D(1, J) = (D(1, J) - WK(1, J) * D(1, J + 1)) / WK(2, J)
+    END DO
+    ! --------------------(  END  CODING FROM CUBSPL )--------------------
+    !
+    !  NORMAL RETURN.
+    !
+    RETURN
+    !
+    !  ERROR RETURNS.
+    !
+    5001   CONTINUE
+    ! N.LT.2 RETURN.
+    IERR = -1
+    CALL XERMSG ('SLATEC', 'PCHSP', &
+            'NUMBER OF DATA POINTS LESS THAN TWO', IERR, 1)
+    RETURN
+    !
+    5002   CONTINUE
+    ! INCFD.LT.1 RETURN.
+    IERR = -2
+    CALL XERMSG ('SLATEC', 'PCHSP', 'INCREMENT LESS THAN ONE', IERR, &
+            1)
+    RETURN
+    !
+    5003   CONTINUE
+    ! X-ARRAY NOT STRICTLY INCREASING.
+    IERR = -3
+    CALL XERMSG ('SLATEC', 'PCHSP', 'X-ARRAY NOT STRICTLY INCREASING' &
+            , IERR, 1)
+    RETURN
+    !
+    5004   CONTINUE
+    ! IC OUT OF RANGE RETURN.
+    IERR = IERR - 3
+    CALL XERMSG ('SLATEC', 'PCHSP', 'IC OUT OF RANGE', IERR, 1)
+    RETURN
+    !
+    5007   CONTINUE
+    ! NWK TOO SMALL RETURN.
+    IERR = -7
+    CALL XERMSG ('SLATEC', 'PCHSP', 'WORK ARRAY TOO SMALL', IERR, 1)
+    RETURN
+    !
+    5008   CONTINUE
+    ! SINGULAR SYSTEM.
+    !   *** THEORETICALLY, THIS CAN ONLY OCCUR IF SUCCESSIVE X-VALUES   ***
+    !   *** ARE EQUAL, WHICH SHOULD ALREADY HAVE BEEN CAUGHT (IERR=-3). ***
+    IERR = -8
+    CALL XERMSG ('SLATEC', 'PCHSP', 'SINGULAR LINEAR SYSTEM', IERR, &
+            1)
+    RETURN
+    !
+    5009   CONTINUE
+    ! ERROR RETURN FROM PCHDF.
+    !   *** THIS CASE SHOULD NEVER OCCUR ***
+    IERR = -9
+    CALL XERMSG ('SLATEC', 'PCHSP', 'ERROR RETURN FROM PCHDF', IERR, &
+            1)
+    RETURN
+    !------------- LAST LINE OF PCHSP FOLLOWS ------------------------------
+  END SUBROUTINE PCHSP
+
+
+END MODULE lmdz_libmath_pch
Index: LMDZ6/branches/Amaury_dev/libf/misc/new_unit_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/new_unit_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/new_unit_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module new_unit_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/misc/nrtype.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/nrtype.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/nrtype.F90	(revision 5113)
@@ -1,5 +1,5 @@
 MODULE nrtype
 
-  implicit none
+  IMPLICIT NONE
 
   integer, parameter:: k8 = selected_real_kind(13)
Index: LMDZ6/branches/Amaury_dev/libf/misc/pchdf.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/pchdf.f90	(revision 5112)
+++ 	(revision )
@@ -1,106 +1,0 @@
-!DECK PCHDF
-REAL FUNCTION PCHDF(K, X, S, IERR)
-  !***BEGIN PROLOGUE  PCHDF
-  !***SUBSIDIARY
-  !***PURPOSE  Computes divided differences for PCHCE and PCHSP
-  !***LIBRARY   SLATEC (PCHIP)
-  !***TYPE      SINGLE PRECISION (PCHDF-S, DPCHDF-D)
-  !***AUTHOR  Fritsch, F. N., (LLNL)
-  !***DESCRIPTION
-  !
-  !      PCHDF:   PCHIP Finite Difference Formula
-  !
-  ! Uses a divided difference formulation to compute a K-point approx-
-  ! imation to the derivative at X(K) based on the data in X and S.
-  !
-  ! Called by  PCHCE  and  PCHSP  to compute 3- and 4-point boundary
-  ! derivative approximations.
-  !
-  ! ----------------------------------------------------------------------
-  !
-  ! On input:
-  !    K      is the order of the desired derivative approximation.
-  !           K must be at least 3 (error return if not).
-  !    X      contains the K values of the independent variable.
-  !           X need not be ordered, but the values **MUST** be
-  !           distinct.  (Not checked here.)
-  !    S      contains the associated slope values:
-  !              S(I) = (F(I+1)-F(I))/(X(I+1)-X(I)), I=1(1)K-1.
-  !           (Note that S need only be of length K-1.)
-  !
-  ! On return:
-  !    S      will be destroyed.
-  !    IERR   will be set to -1 if K.LT.2 .
-  !    PCHDF  will be set to the desired derivative approximation if
-  !           IERR=0 or to zero if IERR=-1.
-  !
-  ! ----------------------------------------------------------------------
-  !
-  !***SEE ALSO  PCHCE, PCHSP
-  !***REFERENCES  Carl de Boor, A Practical Guide to Splines, Springer-
-  !             Verlag, New York, 1978, pp. 10-16.
-  !***ROUTINES CALLED  XERMSG
-  !***REVISION HISTORY  (YYMMDD)
-  !   820503  DATE WRITTEN
-  !   820805  Converted to SLATEC library version.
-  !   870813  Minor cosmetic changes.
-  !   890411  Added SAVE statements (Vers. 3.2).
-  !   890411  REVISION DATE from Version 3.2
-  !   891214  Prologue converted to Version 4.0 format.  (BAB)
-  !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
-  !   900328  Added TYPE section.  (WRB)
-  !   910408  Updated AUTHOR and DATE WRITTEN sections in prologue.  (WRB)
-  !   920429  Revised format and order of references.  (WRB,FNF)
-  !   930503  Improved purpose.  (FNF)
-  !***END PROLOGUE  PCHDF
-  !
-  !**End
-  !
-  !  DECLARE ARGUMENTS.
-  !
-  INTEGER :: K, IERR
-  REAL :: X(K), S(K)
-  !
-  !  DECLARE LOCAL VARIABLES.
-  !
-  INTEGER :: I, J
-  REAL :: VALUE, ZERO
-  SAVE ZERO
-  DATA  ZERO /0./
-  !
-  !  CHECK FOR LEGAL VALUE OF K.
-  !
-  !***FIRST EXECUTABLE STATEMENT  PCHDF
-  IF (K < 3)  GO TO 5001
-  !
-  !  COMPUTE COEFFICIENTS OF INTERPOLATING POLYNOMIAL.
-  !
-  DO J = 2, K-1
-     DO I = 1, K-J
-        S(I) = (S(I+1)-S(I))/(X(I+J)-X(I))
-  END DO
-  END DO
-  !
-  !  EVALUATE DERIVATIVE AT X(K).
-  !
-  VALUE = S(1)
-  DO I = 2, K-1
-     VALUE = S(I) + VALUE*(X(K)-X(I))
-  END DO
-  !
-  !  NORMAL RETURN.
-  !
-  IERR = 0
-  PCHDF = VALUE
-  RETURN
-  !
-  !  ERROR RETURN.
-  !
- 5001   CONTINUE
-  ! K.LT.3 RETURN.
-  IERR = -1
-  CALL XERMSG ('SLATEC', 'PCHDF', 'K LESS THAN THREE', IERR, 1)
-  PCHDF = ZERO
-  RETURN
-  !------------- LAST LINE OF PCHDF FOLLOWS ------------------------------
-END FUNCTION PCHDF
Index: LMDZ6/branches/Amaury_dev/libf/misc/pchfe.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/pchfe.f90	(revision 5112)
+++ 	(revision )
@@ -1,308 +1,0 @@
-!DECK PCHFE
-SUBROUTINE PCHFE(N, X, F, D, INCFD, SKIP, NE, XE, FE, IERR)
-  !***BEGIN PROLOGUE  PCHFE
-  !***PURPOSE  Evaluate a piecewise cubic Hermite function at an array of
-         ! points.  May be used by itself for Hermite interpolation,
-         ! or as an evaluator for PCHIM or PCHIC.
-  !***LIBRARY   SLATEC (PCHIP)
-  !***CATEGORY  E3
-  !***TYPE      SINGLE PRECISION (PCHFE-S, DPCHFE-D)
-  !***KEYWORDS  CUBIC HERMITE EVALUATION, HERMITE INTERPOLATION, PCHIP,
-         !  PIECEWISE CUBIC EVALUATION
-  !***AUTHOR  Fritsch, F. N., (LLNL)
-         !  Lawrence Livermore National Laboratory
-         !  P.O. Box 808  (L-316)
-         !  Livermore, CA  94550
-         !  FTS 532-4275, (510) 422-4275
-  !***DESCRIPTION
-  !
-  !      PCHFE:  Piecewise Cubic Hermite Function Evaluator
-  !
-  ! Evaluates the cubic Hermite function defined by  N, X, F, D  at
-  ! the points  XE(J), J=1(1)NE.
-  !
-  ! To provide compatibility with PCHIM and PCHIC, includes an
-  ! increment between successive values of the F- and D-arrays.
-  !
-  ! ----------------------------------------------------------------------
-  !
-  !  Calling sequence:
-  !
-  !    PARAMETER  (INCFD = ...)
-  !    INTEGER  N, NE, IERR
-  !    REAL  X(N), F(INCFD,N), D(INCFD,N), XE(NE), FE(NE)
-  !    LOGICAL  SKIP
-  !
-  !    CALL  PCHFE (N, X, F, D, INCFD, SKIP, NE, XE, FE, IERR)
-  !
-  !   Parameters:
-  !
-  ! N -- (input) number of data points.  (Error return if N.LT.2 .)
-  !
-  ! X -- (input) real array of independent variable values.  The
-  !       elements of X must be strictly increasing:
-  !            X(I-1) .LT. X(I),  I = 2(1)N.
-  !       (Error return if not.)
-  !
-  ! F -- (input) real array of function values.  F(1+(I-1)*INCFD) is
-  !       the value corresponding to X(I).
-  !
-  ! D -- (input) real array of derivative values.  D(1+(I-1)*INCFD) is
-  !       the value corresponding to X(I).
-  !
-  ! INCFD -- (input) increment between successive values in F and D.
-  !       (Error return if  INCFD.LT.1 .)
-  !
-  ! SKIP -- (input/output) logical variable which should be set to
-  !       .TRUE. if the user wishes to skip checks for validity of
-  !       preceding parameters, or to .FALSE. otherwise.
-  !       This will save time in case these checks have already
-  !       been performed (say, in PCHIM or PCHIC).
-  !       SKIP will be set to .TRUE. on normal return.
-  !
-  ! NE -- (input) number of evaluation points.  (Error return if
-  !       NE.LT.1 .)
-  !
-  ! XE -- (input) real array of points at which the function is to be
-  !       evaluated.
-  !
-  !      NOTES:
-  !       1. The evaluation will be most efficient if the elements
-  !          of XE are increasing relative to X;
-  !          that is,   XE(J) .GE. X(I)
-  !          implies    XE(K) .GE. X(I),  all K.GE.J .
-  !       2. If any of the XE are outside the interval [X(1),X(N)],
-  !          values are extrapolated from the nearest extreme cubic,
-  !          and a warning error is returned.
-  !
-  ! FE -- (output) real array of values of the cubic Hermite function
-  !       defined by  N, X, F, D  at the points  XE.
-  !
-  ! IERR -- (output) error flag.
-  !       Normal return:
-  !          IERR = 0  (no errors).
-  !       Warning error:
-  !          IERR.GT.0  means that extrapolation was performed at
-  !             IERR points.
-  !       "Recoverable" errors:
-  !          IERR = -1  if N.LT.2 .
-  !          IERR = -2  if INCFD.LT.1 .
-  !          IERR = -3  if the X-array is not strictly increasing.
-  !          IERR = -4  if NE.LT.1 .
-  !         (The FE-array has not been changed in any of these cases.)
-  !           NOTE:  The above errors are checked in the order listed,
-  !               and following arguments have **NOT** been validated.
-  !
-  !***REFERENCES  (NONE)
-  !***ROUTINES CALLED  CHFEV, XERMSG
-  !***REVISION HISTORY  (YYMMDD)
-  !   811020  DATE WRITTEN
-  !   820803  Minor cosmetic changes for release 1.
-  !   870707  Minor cosmetic changes to prologue.
-  !   890531  Changed all specific intrinsics to generic.  (WRB)
-  !   890831  Modified array declarations.  (WRB)
-  !   890831  REVISION DATE from Version 3.2
-  !   891214  Prologue converted to Version 4.0 format.  (BAB)
-  !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
-  !***END PROLOGUE  PCHFE
-  !  Programming notes:
-  !
-  ! 1. To produce a double precision version, simply:
-  !    a. Change PCHFE to DPCHFE, and CHFEV to DCHFEV, wherever they
-  !       occur,
-  !    b. Change the real declaration to double precision,
-  !
-  ! 2. Most of the coding between the CALL to CHFEV and the end of
-  !    the IR-loop could be eliminated if it were permissible to
-  !    assume that XE is ordered relative to X.
-  !
-  ! 3. CHFEV does not assume that X1 is less than X2.  thus, it would
-  !    be possible to write a version of PCHFE that assumes a strict-
-  !    ly decreasing X-array by simply running the IR-loop backwards
-  !    (and reversing the order of appropriate tests).
-  !
-  ! 4. The present code has a minor bug, which I have decided is not
-  !    worth the effort that would be required to fix it.
-  !    If XE contains points in [X(N-1),X(N)], followed by points .LT.
-  !    X(N-1), followed by points .GT.X(N), the extrapolation points
-  !    will be counted (at least) twice in the total returned in IERR.
-  !
-  !  DECLARE ARGUMENTS.
-  !
-  INTEGER :: N, INCFD, NE, IERR
-  REAL :: X(*), F(INCFD,*), D(INCFD,*), XE(*), FE(*)
-  LOGICAL :: SKIP
-  !
-  !  DECLARE LOCAL VARIABLES.
-  !
-  INTEGER :: I, IERC, IR, J, JFIRST, NEXT(2), NJ
-  !
-  !  VALIDITY-CHECK ARGUMENTS.
-  !
-  !***FIRST EXECUTABLE STATEMENT  PCHFE
-  IF (SKIP)  GO TO 5
-  !
-  IF ( N<2 )  GO TO 5001
-  IF ( INCFD<1 )  GO TO 5002
-  DO I = 2, N
-     IF ( X(I)<=X(I-1) )  GO TO 5003
-  END DO
-  !
-  !  FUNCTION DEFINITION IS OK, GO ON.
-  !
-    5   CONTINUE
-  IF ( NE<1 )  GO TO 5004
-  IERR = 0
-  SKIP = .TRUE.
-  !
-  !  LOOP OVER INTERVALS.        (   INTERVAL INDEX IS  IL = IR-1  . )
-  !                              ( INTERVAL IS X(IL).LE.X.LT.X(IR) . )
-  JFIRST = 1
-  IR = 2
-   10   CONTINUE
-  !
-  ! SKIP OUT OF LOOP IF HAVE PROCESSED ALL EVALUATION POINTS.
-  !
-     IF (JFIRST > NE)  GO TO 5000
-  !
-  ! LOCATE ALL POINTS IN INTERVAL.
-  !
-     DO J = JFIRST, NE
-        IF (XE(J) >= X(IR))  GO TO 30
-  END DO
-     J = NE + 1
-     GO TO 40
-  !
-  ! HAVE LOCATED FIRST POINT BEYOND INTERVAL.
-  !
-   30   CONTINUE
-     IF (IR == N)  J = NE + 1
-  !
-   40   CONTINUE
-     NJ = J - JFIRST
-  !
-  ! SKIP EVALUATION IF NO POINTS IN INTERVAL.
-  !
-     IF (NJ == 0)  GO TO 50
-  !
-  ! EVALUATE CUBIC AT XE(I),  I = JFIRST (1) J-1 .
-  !
-  !   ----------------------------------------------------------------
-    CALL CHFEV (X(IR-1),X(IR), F(1,IR-1),F(1,IR), D(1,IR-1),D(1,IR), &
-          NJ, XE(JFIRST), FE(JFIRST), NEXT, IERC)
-    ! ----------------------------------------------------------------
-     IF (IERC < 0)  GO TO 5005
-  !
-     IF (NEXT(2) == 0)  GO TO 42
-     ! IF (NEXT(2) .GT. 0)  THEN
-     !    IN THE CURRENT SET OF XE-POINTS, THERE ARE NEXT(2) TO THE
-     !    RIGHT OF X(IR).
-  !
-        IF (IR < N)  GO TO 41
-        ! IF (IR .EQ. N)  THEN
-        !    THESE ARE ACTUALLY EXTRAPOLATION POINTS.
-           IERR = IERR + NEXT(2)
-           GO TO 42
-   41    CONTINUE
-        ! ELSE
-        !    WE SHOULD NEVER HAVE GOTTEN HERE.
-           GO TO 5005
-        ! ENDIF
-     ! ENDIF
-   42   CONTINUE
-  !
-     IF (NEXT(1) == 0)  GO TO 49
-     ! IF (NEXT(1) .GT. 0)  THEN
-     !    IN THE CURRENT SET OF XE-POINTS, THERE ARE NEXT(1) TO THE
-     !    LEFT OF X(IR-1).
-  !
-        IF (IR > 2)  GO TO 43
-        ! IF (IR .EQ. 2)  THEN
-        !    THESE ARE ACTUALLY EXTRAPOLATION POINTS.
-           IERR = IERR + NEXT(1)
-           GO TO 49
-   43    CONTINUE
-        ! ELSE
-        !    XE IS NOT ORDERED RELATIVE TO X, SO MUST ADJUST
-        !    EVALUATION INTERVAL.
-  !
-  !          FIRST, LOCATE FIRST POINT TO LEFT OF X(IR-1).
-           DO I = JFIRST, J-1
-              IF (XE(I) < X(IR-1))  GO TO 45
-  END DO
-           ! NOTE-- CANNOT DROP THROUGH HERE UNLESS THERE IS AN ERROR
-           !        IN CHFEV.
-           GO TO 5005
-  !
-   45       CONTINUE
-           ! RESET J.  (THIS WILL BE THE NEW JFIRST.)
-           J = I
-  !
-  !          NOW FIND OUT HOW FAR TO BACK UP IN THE X-ARRAY.
-           DO I = 1, IR-1
-              IF (XE(J) < X(I)) GO TO 47
-  END DO
-           ! NB-- CAN NEVER DROP THROUGH HERE, SINCE XE(J).LT.X(IR-1).
-  !
-   47       CONTINUE
-           ! AT THIS POINT, EITHER  XE(J) .LT. X(1)
-           !    OR      X(I-1) .LE. XE(J) .LT. X(I) .
-           ! RESET IR, RECOGNIZING THAT IT WILL BE INCREMENTED BEFORE
-           ! CYCLING.
-           IR = MAX(1, I-1)
-        ! ENDIF
-     ! ENDIF
-   49   CONTINUE
-  !
-     JFIRST = J
-  !
-  ! END OF IR-LOOP.
-  !
-   50   CONTINUE
-  IR = IR + 1
-  IF (IR <= N)  GO TO 10
-  !
-  !  NORMAL RETURN.
-  !
- 5000   CONTINUE
-  RETURN
-  !
-  !  ERROR RETURNS.
-  !
- 5001   CONTINUE
-  ! N.LT.2 RETURN.
-  IERR = -1
-  CALL XERMSG ('SLATEC', 'PCHFE', &
-        'NUMBER OF DATA POINTS LESS THAN TWO', IERR, 1)
-  RETURN
-  !
- 5002   CONTINUE
-  ! INCFD.LT.1 RETURN.
-  IERR = -2
-  CALL XERMSG ('SLATEC', 'PCHFE', 'INCREMENT LESS THAN ONE', IERR, &
-        1)
-  RETURN
-  !
- 5003   CONTINUE
-  ! X-ARRAY NOT STRICTLY INCREASING.
-  IERR = -3
-  CALL XERMSG ('SLATEC', 'PCHFE', 'X-ARRAY NOT STRICTLY INCREASING' &
-        , IERR, 1)
-  RETURN
-  !
- 5004   CONTINUE
-  ! NE.LT.1 RETURN.
-  IERR = -4
-  CALL XERMSG ('SLATEC', 'PCHFE', &
-        'NUMBER OF EVALUATION POINTS LESS THAN ONE', IERR, 1)
-  RETURN
-  !
- 5005   CONTINUE
-  ! ERROR RETURN FROM CHFEV.
-  !   *** THIS CASE SHOULD NEVER OCCUR ***
-  IERR = -5
-  CALL XERMSG ('SLATEC', 'PCHFE', &
-        'ERROR RETURN FROM CHFEV -- FATAL', IERR, 2)
-  RETURN
-  !------------- LAST LINE OF PCHFE FOLLOWS ------------------------------
-END SUBROUTINE PCHFE
Index: LMDZ6/branches/Amaury_dev/libf/misc/pchfe_95_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/pchfe_95_m.F90	(revision 5112)
+++ 	(revision )
@@ -1,76 +1,0 @@
-module PCHFE_95_m
-
-  implicit none
-
-contains
-
-  SUBROUTINE PCHFE_95(X, F, D, SKIP, XE, FE, IERR)
-
-    ! PURPOSE  Evaluate a piecewise cubic Hermite function at an array of
-    !            points.  May be used by itself for Hermite interpolation,
-    !            or as an evaluator for PCHIM or PCHIC.
-    ! CATEGORY  E3
-    ! KEYWORDS  CUBIC HERMITE EVALUATION, HERMITE INTERPOLATION, PCHIP,
-    !             PIECEWISE CUBIC EVALUATION
-
-    !          PCHFE:  Piecewise Cubic Hermite Function Evaluator
-    ! Evaluates the cubic Hermite function defined by  X, F, D  at
-    ! the points  XE.
-
-    use assert_eq_m, only: assert_eq
-
-    REAL, intent(in):: X(:) ! real array of independent variable values
-    ! The elements of X must be strictly increasing.
-
-    REAL, intent(in):: F(:) ! real array of function values
-    ! F(I) is the value corresponding to X(I).
-
-    REAL, intent(in):: D(:) ! real array of derivative values
-    ! D(I) is the value corresponding to X(I).
-
-    LOGICAL, intent(inout):: SKIP 
-    ! request to skip checks for validity of "x"
-    ! If "skip" is false then "pchfe" will check that size(x) >= 2 and
-    ! "x" is in strictly ascending order.
-    ! Setting "skip" to true will save time in case these checks have
-    ! already been performed (say, in "PCHIM" or "PCHIC").
-    ! "SKIP" will be set to TRUE on normal return.
-
-    real, intent(in):: XE(:) ! points at which the function is to be evaluated
-    ! NOTES:
-    ! 1. The evaluation will be most efficient if the elements of XE
-    ! are increasing relative to X.
-    ! That is,   XE(J) .GE. X(I)
-    ! implies    XE(K) .GE. X(I),  all K.GE.J
-    ! 2. If any of the XE are outside the interval [X(1),X(N)], values
-    ! are extrapolated from the nearest extreme cubic, and a warning
-    ! error is returned.
-
-    real, intent(out):: FE(:) ! values of the cubic Hermite function
-    ! defined by X, F, D at the points XE
-
-    integer, intent(out):: IERR ! error flag
-    ! Normal return:
-    ! IERR = 0  no error
-    ! Warning error:
-    ! IERR > 0  means that extrapolation was performed at IERR points
-    ! "Recoverable" errors:
-    !              IERR = -1  if N < 2
-    !              IERR = -3  if the X-array is not strictly increasing
-    !              IERR = -4  if NE < 1
-    ! NOTE: The above errors are checked in the order listed, and
-    ! following arguments have **NOT** been validated.
-
-    ! Variables local to the procedure:
-
-    INTEGER  N, NE
-
-    !---------------------------------------
-
-    n = assert_eq(size(x), size(f), size(d), "PCHFE_95 n")
-    ne = assert_eq(size(xe), size(fe), "PCHFE_95 ne")
-    CALL PCHFE(N, X, F, D, 1, SKIP, NE, XE, FE, IERR)
-
-  END SUBROUTINE  PCHFE_95
-
-end module PCHFE_95_m
Index: LMDZ6/branches/Amaury_dev/libf/misc/pchsp.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/pchsp.f90	(revision 5112)
+++ 	(revision )
@@ -1,388 +1,0 @@
-!DECK PCHSP
-SUBROUTINE PCHSP(IC, VC, N, X, F, D, INCFD, WK, NWK, IERR)
-  !***BEGIN PROLOGUE  PCHSP
-  !***PURPOSE  Set derivatives needed to determine the Hermite represen-
-         ! tation of the cubic spline interpolant to given data, with
-         ! specified boundary conditions.
-  !***LIBRARY   SLATEC (PCHIP)
-  !***CATEGORY  E1A
-  !***TYPE      SINGLE PRECISION (PCHSP-S, DPCHSP-D)
-  !***KEYWORDS  CUBIC HERMITE INTERPOLATION, PCHIP,
-         !  PIECEWISE CUBIC INTERPOLATION, SPLINE INTERPOLATION
-  !***AUTHOR  Fritsch, F. N., (LLNL)
-         !  Lawrence Livermore National Laboratory
-         !  P.O. Box 808  (L-316)
-         !  Livermore, CA  94550
-         !  FTS 532-4275, (510) 422-4275
-  !***DESCRIPTION
-  !
-  !      PCHSP:   Piecewise Cubic Hermite Spline
-  !
-  ! Computes the Hermite representation of the cubic spline inter-
-  ! polant to the data given in X and F satisfying the boundary
-  ! conditions specified by IC and VC.
-  !
-  ! To facilitate two-dimensional applications, includes an increment
-  ! between successive values of the F- and D-arrays.
-  !
-  ! The resulting piecewise cubic Hermite function may be evaluated
-  ! by PCHFE or PCHFD.
-  !
-  ! NOTE:  This is a modified version of C. de Boor's cubic spline
-  !        routine CUBSPL.
-  !
-  ! ----------------------------------------------------------------------
-  !
-  !  Calling sequence:
-  !
-  !    PARAMETER  (INCFD = ...)
-  !    INTEGER  IC(2), N, NWK, IERR
-  !    REAL  VC(2), X(N), F(INCFD,N), D(INCFD,N), WK(NWK)
-  !
-  !    CALL  PCHSP (IC, VC, N, X, F, D, INCFD, WK, NWK, IERR)
-  !
-  !   Parameters:
-  !
-  ! IC -- (input) integer array of length 2 specifying desired
-  !       boundary conditions:
-  !       IC(1) = IBEG, desired condition at beginning of data.
-  !       IC(2) = IEND, desired condition at end of data.
-  !
-  !       IBEG = 0  to set D(1) so that the third derivative is con-
-  !          tinuous at X(2).  This is the "not a knot" condition
-  !          provided by de Boor's cubic spline routine CUBSPL.
-  !          < This is the default boundary condition. >
-  !       IBEG = 1  if first derivative at X(1) is given in VC(1).
-  !       IBEG = 2  if second derivative at X(1) is given in VC(1).
-  !       IBEG = 3  to use the 3-point difference formula for D(1).
-  !                 (Reverts to the default b.c. if N.LT.3 .)
-  !       IBEG = 4  to use the 4-point difference formula for D(1).
-  !                 (Reverts to the default b.c. if N.LT.4 .)
-  !      NOTES:
-  !       1. An error return is taken if IBEG is out of range.
-  !       2. For the "natural" boundary condition, use IBEG=2 and
-  !          VC(1)=0.
-  !
-  !       IEND may take on the same values as IBEG, but applied to
-  !       derivative at X(N).  In case IEND = 1 or 2, the value is
-  !       given in VC(2).
-  !
-  !      NOTES:
-  !       1. An error return is taken if IEND is out of range.
-  !       2. For the "natural" boundary condition, use IEND=2 and
-  !          VC(2)=0.
-  !
-  ! VC -- (input) real array of length 2 specifying desired boundary
-  !       values, as indicated above.
-  !       VC(1) need be set only if IC(1) = 1 or 2 .
-  !       VC(2) need be set only if IC(2) = 1 or 2 .
-  !
-  ! N -- (input) number of data points.  (Error return if N.LT.2 .)
-  !
-  ! X -- (input) real array of independent variable values.  The
-  !       elements of X must be strictly increasing:
-  !            X(I-1) .LT. X(I),  I = 2(1)N.
-  !       (Error return if not.)
-  !
-  ! F -- (input) real array of dependent variable values to be inter-
-  !       polated.  F(1+(I-1)*INCFD) is value corresponding to X(I).
-  !
-  ! D -- (output) real array of derivative values at the data points.
-  !       These values will determine the cubic spline interpolant
-  !       with the requested boundary conditions.
-  !       The value corresponding to X(I) is stored in
-  !            D(1+(I-1)*INCFD),  I=1(1)N.
-  !       No other entries in D are changed.
-  !
-  ! INCFD -- (input) increment between successive values in F and D.
-  !       This argument is provided primarily for 2-D applications.
-  !       (Error return if  INCFD.LT.1 .)
-  !
-  ! WK -- (scratch) real array of working storage.
-  !
-  ! NWK -- (input) length of work array.
-  !       (Error return if NWK.LT.2*N .)
-  !
-  ! IERR -- (output) error flag.
-  !       Normal return:
-  !          IERR = 0  (no errors).
-  !       "Recoverable" errors:
-  !          IERR = -1  if N.LT.2 .
-  !          IERR = -2  if INCFD.LT.1 .
-  !          IERR = -3  if the X-array is not strictly increasing.
-  !          IERR = -4  if IBEG.LT.0 or IBEG.GT.4 .
-  !          IERR = -5  if IEND.LT.0 of IEND.GT.4 .
-  !          IERR = -6  if both of the above are true.
-  !          IERR = -7  if NWK is too small.
-  !           NOTE:  The above errors are checked in the order listed,
-  !               and following arguments have **NOT** been validated.
-  !         (The D-array has not been changed in any of these cases.)
-  !          IERR = -8  in case of trouble solving the linear system
-  !                     for the interior derivative values.
-  !         (The D-array may have been changed in this case.)
-  !         (             Do **NOT** use it!                )
-  !
-  !***REFERENCES  Carl de Boor, A Practical Guide to Splines, Springer-
-  !             Verlag, New York, 1978, pp. 53-59.
-  !***ROUTINES CALLED  PCHDF, XERMSG
-  !***REVISION HISTORY  (YYMMDD)
-  !   820503  DATE WRITTEN
-  !   820804  Converted to SLATEC library version.
-  !   870707  Minor cosmetic changes to prologue.
-  !   890411  Added SAVE statements (Vers. 3.2).
-  !   890703  Corrected category record.  (WRB)
-  !   890831  Modified array declarations.  (WRB)
-  !   890831  REVISION DATE from Version 3.2
-  !   891214  Prologue converted to Version 4.0 format.  (BAB)
-  !   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
-  !   920429  Revised format and order of references.  (WRB,FNF)
-  !***END PROLOGUE  PCHSP
-  !  Programming notes:
-  !
-  ! To produce a double precision version, simply:
-  !    a. Change PCHSP to DPCHSP wherever it occurs,
-  !    b. Change the real declarations to double precision, and
-  !    c. Change the constants ZERO, HALF, ... to double precision.
-  !
-  !  DECLARE ARGUMENTS.
-  !
-  INTEGER :: IC(2), N, INCFD, NWK, IERR
-  REAL :: VC(2), X(*), F(INCFD,*), D(INCFD,*), WK(2,*)
-  !
-  !  DECLARE LOCAL VARIABLES.
-  !
-  INTEGER :: IBEG, IEND, INDEX, J, NM1
-  REAL :: G, HALF, ONE, STEMP(3), THREE, TWO, XTEMP(4), ZERO
-  SAVE ZERO, HALF, ONE, TWO, THREE
-  REAL :: PCHDF
-  !
-  DATA  ZERO /0./,  HALF /0.5/,  ONE /1./,  TWO /2./,  THREE /3./
-  !
-  !  VALIDITY-CHECK ARGUMENTS.
-  !
-  !***FIRST EXECUTABLE STATEMENT  PCHSP
-  IF ( N<2 )  GO TO 5001
-  IF ( INCFD<1 )  GO TO 5002
-  DO J = 2, N
-     IF ( X(J)<=X(J-1) )  GO TO 5003
-  END DO
-  !
-  IBEG = IC(1)
-  IEND = IC(2)
-  IERR = 0
-  IF ( (IBEG<0).OR.(IBEG>4) )  IERR = IERR - 1
-  IF ( (IEND<0).OR.(IEND>4) )  IERR = IERR - 2
-  IF ( IERR<0 )  GO TO 5004
-  !
-  !  FUNCTION DEFINITION IS OK -- GO ON.
-  !
-  IF ( NWK < 2*N )  GO TO 5007
-  !
-  !  COMPUTE FIRST DIFFERENCES OF X SEQUENCE AND STORE IN WK(1,.). ALSO,
-  !  COMPUTE FIRST DIVIDED DIFFERENCE OF DATA AND STORE IN WK(2,.).
-  DO J=2,N
-     WK(1,J) = X(J) - X(J-1)
-     WK(2,J) = (F(1,J) - F(1,J-1))/WK(1,J)
-  END DO
-  !
-  !  SET TO DEFAULT BOUNDARY CONDITIONS IF N IS TOO SMALL.
-  !
-  IF ( IBEG>N )  IBEG = 0
-  IF ( IEND>N )  IEND = 0
-  !
-  !  SET UP FOR BOUNDARY CONDITIONS.
-  !
-  IF ( (IBEG==1).OR.(IBEG==2) )  THEN
-     D(1,1) = VC(1)
-  ELSE IF (IBEG > 2)  THEN
-     ! PICK UP FIRST IBEG POINTS, IN REVERSE ORDER.
-     DO J = 1, IBEG
-        INDEX = IBEG-J+1
-        ! INDEX RUNS FROM IBEG DOWN TO 1.
-        XTEMP(J) = X(INDEX)
-        IF (J < IBEG)  STEMP(J) = WK(2,INDEX)
-  END DO
-              ! --------------------------------
-     D(1,1) = PCHDF (IBEG, XTEMP, STEMP, IERR)
-              ! --------------------------------
-     IF (IERR /= 0)  GO TO 5009
-     IBEG = 1
-  ENDIF
-  !
-  IF ( (IEND==1).OR.(IEND==2) )  THEN
-     D(1,N) = VC(2)
-  ELSE IF (IEND > 2)  THEN
-     ! PICK UP LAST IEND POINTS.
-     DO J = 1, IEND
-        INDEX = N-IEND+J
-        ! INDEX RUNS FROM N+1-IEND UP TO N.
-        XTEMP(J) = X(INDEX)
-        IF (J < IEND)  STEMP(J) = WK(2,INDEX+1)
-  END DO
-              ! --------------------------------
-     D(1,N) = PCHDF (IEND, XTEMP, STEMP, IERR)
-              ! --------------------------------
-     IF (IERR /= 0)  GO TO 5009
-     IEND = 1
-  ENDIF
-  !
-  ! --------------------( BEGIN CODING FROM CUBSPL )--------------------
-  !
-  !  **** A TRIDIAGONAL LINEAR SYSTEM FOR THE UNKNOWN SLOPES S(J) OF
-  !  F  AT X(J), J=1,...,N, IS GENERATED AND THEN SOLVED BY GAUSS ELIM-
-  !  INATION, WITH S(J) ENDING UP IN D(1,J), ALL J.
-  ! WK(1,.) AND WK(2,.) ARE USED FOR TEMPORARY STORAGE.
-  !
-  !  CONSTRUCT FIRST EQUATION FROM FIRST BOUNDARY CONDITION, OF THE FORM
-  !         WK(2,1)*S(1) + WK(1,1)*S(2) = D(1,1)
-  !
-  IF (IBEG == 0)  THEN
-     IF (N == 2)  THEN
-        ! NO CONDITION AT LEFT END AND N = 2.
-        WK(2,1) = ONE
-        WK(1,1) = ONE
-        D(1,1) = TWO*WK(2,2)
-     ELSE
-        ! NOT-A-KNOT CONDITION AT LEFT END AND N .GT. 2.
-        WK(2,1) = WK(1,3)
-        WK(1,1) = WK(1,2) + WK(1,3)
-        D(1,1) =((WK(1,2) + TWO*WK(1,1))*WK(2,2)*WK(1,3) &
-              + WK(1,2)**2*WK(2,3)) / WK(1,1)
-     ENDIF
-  ELSE IF (IBEG == 1)  THEN
-     ! SLOPE PRESCRIBED AT LEFT END.
-     WK(2,1) = ONE
-     WK(1,1) = ZERO
-  ELSE
-     ! SECOND DERIVATIVE PRESCRIBED AT LEFT END.
-     WK(2,1) = TWO
-     WK(1,1) = ONE
-     D(1,1) = THREE*WK(2,2) - HALF*WK(1,2)*D(1,1)
-  ENDIF
-  !
-  !  IF THERE ARE INTERIOR KNOTS, GENERATE THE CORRESPONDING EQUATIONS AND
-  !  CARRY OUT THE FORWARD PASS OF GAUSS ELIMINATION, AFTER WHICH THE J-TH
-  !  EQUATION READS    WK(2,J)*S(J) + WK(1,J)*S(J+1) = D(1,J).
-  !
-  NM1 = N-1
-  IF (NM1 > 1)  THEN
-     DO J=2,NM1
-        IF (WK(2,J-1) == ZERO)  GO TO 5008
-        G = -WK(1,J+1)/WK(2,J-1)
-        D(1,J) = G*D(1,J-1) &
-              + THREE*(WK(1,J)*WK(2,J+1) + WK(1,J+1)*WK(2,J))
-        WK(2,J) = G*WK(1,J-1) + TWO*(WK(1,J) + WK(1,J+1))
-  END DO
-  ENDIF
-  !
-  !  CONSTRUCT LAST EQUATION FROM SECOND BOUNDARY CONDITION, OF THE FORM
-  !       (-G*WK(2,N-1))*S(N-1) + WK(2,N)*S(N) = D(1,N)
-  !
-  ! IF SLOPE IS PRESCRIBED AT RIGHT END, ONE CAN GO DIRECTLY TO BACK-
-  ! SUBSTITUTION, SINCE ARRAYS HAPPEN TO BE SET UP JUST RIGHT FOR IT
-  ! AT THIS POINT.
-  IF (IEND == 1)  GO TO 30
-  !
-  IF (IEND == 0)  THEN
-     IF (N==2 .AND. IBEG==0)  THEN
-        ! NOT-A-KNOT AT RIGHT ENDPOINT AND AT LEFT ENDPOINT AND N = 2.
-        D(1,2) = WK(2,2)
-        GO TO 30
-     ELSE IF ((N==2) .OR. (N==3 .AND. IBEG==0))  THEN
-        ! EITHER (N=3 AND NOT-A-KNOT ALSO AT LEFT) OR (N=2 AND *NOT*
-        ! NOT-A-KNOT AT LEFT END POINT).
-        D(1,N) = TWO*WK(2,N)
-        WK(2,N) = ONE
-        IF (WK(2,N-1) == ZERO)  GO TO 5008
-        G = -ONE/WK(2,N-1)
-     ELSE
-        ! NOT-A-KNOT AND N .GE. 3, AND EITHER N.GT.3 OR  ALSO NOT-A-
-        ! KNOT AT LEFT END POINT.
-        G = WK(1,N-1) + WK(1,N)
-        ! DO NOT NEED TO CHECK FOLLOWING DENOMINATORS (X-DIFFERENCES).
-        D(1,N) = ((WK(1,N)+TWO*G)*WK(2,N)*WK(1,N-1) &
-              + WK(1,N)**2*(F(1,N-1)-F(1,N-2))/WK(1,N-1))/G
-        IF (WK(2,N-1) == ZERO)  GO TO 5008
-        G = -G/WK(2,N-1)
-        WK(2,N) = WK(1,N-1)
-     ENDIF
-  ELSE
-     ! SECOND DERIVATIVE PRESCRIBED AT RIGHT ENDPOINT.
-     D(1,N) = THREE*WK(2,N) + HALF*WK(1,N)*D(1,N)
-     WK(2,N) = TWO
-     IF (WK(2,N-1) == ZERO)  GO TO 5008
-     G = -ONE/WK(2,N-1)
-  ENDIF
-  !
-  !  COMPLETE FORWARD PASS OF GAUSS ELIMINATION.
-  !
-  WK(2,N) = G*WK(1,N-1) + WK(2,N)
-  IF (WK(2,N) == ZERO)   GO TO 5008
-  D(1,N) = (G*D(1,N-1) + D(1,N))/WK(2,N)
-  !
-  !  CARRY OUT BACK SUBSTITUTION
-  !
-   30   CONTINUE
-  DO J=NM1,1,-1
-     IF (WK(2,J) == ZERO)  GO TO 5008
-     D(1,J) = (D(1,J) - WK(1,J)*D(1,J+1))/WK(2,J)
-  END DO
-  ! --------------------(  END  CODING FROM CUBSPL )--------------------
-  !
-  !  NORMAL RETURN.
-  !
-  RETURN
-  !
-  !  ERROR RETURNS.
-  !
- 5001   CONTINUE
-  ! N.LT.2 RETURN.
-  IERR = -1
-  CALL XERMSG ('SLATEC', 'PCHSP', &
-        'NUMBER OF DATA POINTS LESS THAN TWO', IERR, 1)
-  RETURN
-  !
- 5002   CONTINUE
-  ! INCFD.LT.1 RETURN.
-  IERR = -2
-  CALL XERMSG ('SLATEC', 'PCHSP', 'INCREMENT LESS THAN ONE', IERR, &
-        1)
-  RETURN
-  !
- 5003   CONTINUE
-  ! X-ARRAY NOT STRICTLY INCREASING.
-  IERR = -3
-  CALL XERMSG ('SLATEC', 'PCHSP', 'X-ARRAY NOT STRICTLY INCREASING' &
-        , IERR, 1)
-  RETURN
-  !
- 5004   CONTINUE
-  ! IC OUT OF RANGE RETURN.
-  IERR = IERR - 3
-  CALL XERMSG ('SLATEC', 'PCHSP', 'IC OUT OF RANGE', IERR, 1)
-  RETURN
-  !
- 5007   CONTINUE
-  ! NWK TOO SMALL RETURN.
-  IERR = -7
-  CALL XERMSG ('SLATEC', 'PCHSP', 'WORK ARRAY TOO SMALL', IERR, 1)
-  RETURN
-  !
- 5008   CONTINUE
-  ! SINGULAR SYSTEM.
-  !   *** THEORETICALLY, THIS CAN ONLY OCCUR IF SUCCESSIVE X-VALUES   ***
-  !   *** ARE EQUAL, WHICH SHOULD ALREADY HAVE BEEN CAUGHT (IERR=-3). ***
-  IERR = -8
-  CALL XERMSG ('SLATEC', 'PCHSP', 'SINGULAR LINEAR SYSTEM', IERR, &
-        1)
-  RETURN
-  !
- 5009   CONTINUE
-  ! ERROR RETURN FROM PCHDF.
-  !   *** THIS CASE SHOULD NEVER OCCUR ***
-  IERR = -9
-  CALL XERMSG ('SLATEC', 'PCHSP', 'ERROR RETURN FROM PCHDF', IERR, &
-        1)
-  RETURN
-  !------------- LAST LINE OF PCHSP FOLLOWS ------------------------------
-END SUBROUTINE PCHSP
Index: LMDZ6/branches/Amaury_dev/libf/misc/pchsp_95_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/pchsp_95_m.F90	(revision 5112)
+++ 	(revision )
@@ -1,116 +1,0 @@
-module pchsp_95_m
-
-  implicit none
-
-contains
-
-  function pchsp_95(x, f, ibeg, iend, vc_beg, vc_end)
-
-    ! PURPOSE: Set derivatives needed to determine the Hermite
-    ! representation of the cubic spline interpolant to given data,
-    ! with specified boundary conditions.
-
-    ! Part of the "pchip" package.
-
-    ! CATEGORY: E1A
-
-    ! KEYWORDS: cubic hermite interpolation, piecewise cubic
-    ! interpolation, spline interpolation
-
-    ! DESCRIPTION: "pchsp" stands for "Piecewise Cubic Hermite Spline"
-    ! Computes the Hermite representation of the cubic spline
-    ! interpolant to the data given in X and F satisfying the boundary
-    ! conditions specified by Ibeg, iend, vc_beg and VC_end.
-
-    ! The resulting piecewise cubic Hermite function may be evaluated
-    ! by "pchfe" or "pchfd".
-
-    ! NOTE: This is a modified version of C. de Boor's cubic spline
-    ! routine "cubspl".
-
-    ! REFERENCE: Carl de Boor, A Practical Guide to Splines, Springer,
-    ! 2001, pages 43-47
-
-    use assert_eq_m, only: assert_eq
-
-    real, intent(in):: x(:)
-    ! independent variable values
-    ! The elements of X must be strictly increasing:
-    !                X(I-1) < X(I),  I = 2...N.
-    !           (Error return if not.)
-    ! (error if size(x) < 2)
-
-    real, intent(in):: f(:)
-    !     dependent variable values to be interpolated
-    !  F(I) is value corresponding to X(I).
-
-    INTEGER, intent(in):: ibeg
-    !     desired boundary condition at beginning of data
-
-    !        IBEG = 0  to set pchsp_95(1) so that the third derivative is con-
-    !              tinuous at X(2).  This is the "not a knot" condition
-    !              provided by de Boor's cubic spline routine CUBSPL.
-    !              This is the default boundary condition.
-    !        IBEG = 1  if first derivative at X(1) is given in VC_BEG.
-    !        IBEG = 2  if second derivative at X(1) is given in VC_BEG.
-    !        IBEG = 3  to use the 3-point difference formula for pchsp_95(1).
-    !              (Reverts to the default boundary condition if size(x) < 3 .)
-    !        IBEG = 4  to use the 4-point difference formula for pchsp_95(1).
-    !              (Reverts to the default boundary condition if size(x) < 4 .)
-
-    !          NOTES:
-    !           1. An error return is taken if IBEG is out of range.
-    !           2. For the "natural" boundary condition, use IBEG=2 and
-    !              VC_BEG=0.
-
-    INTEGER, intent(in):: iend
-    !           IC(2) = IEND, desired condition at end of data.
-    !  IEND may take on the same values as IBEG, but applied to
-    !  derivative at X(N). In case IEND = 1 or 2, The value is given in VC_END.
-
-    !          NOTES:
-    !           1. An error return is taken if IEND is out of range.
-    !           2. For the "natural" boundary condition, use IEND=2 and
-    !              VC_END=0.
-
-    REAL, intent(in), optional:: vc_beg
-    ! desired boundary value, as indicated above.
-    !           VC_BEG need be set only if IBEG = 1 or 2 .
-
-    REAL, intent(in), optional:: vc_end
-    ! desired boundary value, as indicated above.
-    !           VC_END need be set only if Iend = 1 or 2 .
-
-    real pchsp_95(size(x))
-    ! derivative values at the data points
-    !           These values will determine the cubic spline interpolant
-    !           with the requested boundary conditions.
-    !           The value corresponding to X(I) is stored in
-    !                PCHSP_95(I),  I=1...N.
-
-    ! LOCAL VARIABLES:
-    real wk(2, size(x)) ! real array of working storage
-    INTEGER n ! number of data points
-    integer ierr, ic(2)
-    real vc(2)
-
-    !-------------------------------------------------------------------
-
-    n = assert_eq(size(x), size(f), "pchsp_95 n")
-    if ((ibeg == 1 .or. ibeg == 2) .and. .not. present(vc_beg)) then
-       print *, "vc_beg required for IBEG = 1 or 2"
-       stop 1
-    end if
-    if ((iend == 1 .or. iend == 2) .and. .not. present(vc_end)) then
-       print *, "vc_end required for IEND = 1 or 2"
-       stop 1
-    end if
-    ic = (/ibeg, iend/)
-    if (present(vc_beg)) vc(1) = vc_beg
-    if (present(vc_end)) vc(2) = vc_end
-    CALL PCHSP(IC, VC, N, X, F, pchsp_95, 1, WK, size(WK), IERR)
-    if (ierr /= 0) stop 1
-
-  END function pchsp_95
-
-end module pchsp_95_m
Index: LMDZ6/branches/Amaury_dev/libf/misc/regr1_step_av_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/regr1_step_av_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/regr1_step_av_m.F90	(revision 5113)
@@ -4,5 +4,5 @@
   ! Author: Lionel GUEZ
 
-  implicit none
+  IMPLICIT NONE
 
   interface regr1_step_av
@@ -21,5 +21,5 @@
   end interface
 
-  private
+  PRIVATE
   public regr1_step_av
 
@@ -30,6 +30,6 @@
     ! "vs" has rank 1.
 
-    use assert_eq_m, only: assert_eq
-    use assert_m, only: assert
+    use lmdz_assert_eq, only: assert_eq
+    use lmdz_assert, only: assert
     use interpolation, only: locate
 
@@ -89,6 +89,6 @@
     ! "vs" has rank 2.
 
-    use assert_eq_m, only: assert_eq
-    use assert_m, only: assert
+    use lmdz_assert_eq, only: assert_eq
+    use lmdz_assert, only: assert
     use interpolation, only: locate
 
@@ -149,6 +149,6 @@
     ! "vs" has rank 3.
 
-    use assert_eq_m, only: assert_eq
-    use assert_m, only: assert
+    use lmdz_assert_eq, only: assert_eq
+    use lmdz_assert, only: assert
     use interpolation, only: locate
 
@@ -210,6 +210,6 @@
     ! "vs" has rank 4.
 
-    use assert_eq_m, only: assert_eq
-    use assert_m, only: assert
+    use lmdz_assert_eq, only: assert_eq
+    use lmdz_assert, only: assert
     use interpolation, only: locate
 
Index: LMDZ6/branches/Amaury_dev/libf/misc/regr_conserv_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/regr_conserv_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/regr_conserv_m.F90	(revision 5113)
@@ -1,6 +1,6 @@
 MODULE regr_conserv_m
 
-  USE assert_eq_m,   ONLY: assert_eq
-  USE assert_m,      ONLY: assert
+  USE lmdz_assert_eq,   ONLY: assert_eq
+  USE lmdz_assert,      ONLY: assert
   USE interpolation, ONLY: locate
 
Index: LMDZ6/branches/Amaury_dev/libf/misc/regr_lint_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/regr_lint_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/regr_lint_m.F90	(revision 5113)
@@ -1,6 +1,6 @@
 MODULE regr_lint_m
 
-  USE assert_eq_m,   ONLY: assert_eq
-  USE assert_m,      ONLY: assert
+  USE lmdz_assert_eq,   ONLY: assert_eq
+  USE lmdz_assert,      ONLY: assert
   USE interpolation, ONLY: hunt
 
Index: LMDZ6/branches/Amaury_dev/libf/misc/vampir.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/vampir.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/vampir.F90	(revision 5113)
@@ -16,5 +16,5 @@
 
   SUBROUTINE InitVampir
-    implicit none
+    IMPLICIT NONE
 
 #ifdef USE_VT
@@ -50,5 +50,5 @@
 
   SUBROUTINE VTb(number)
-    implicit none
+    IMPLICIT NONE
     INTEGER :: number
 #ifdef USE_VT    
@@ -67,5 +67,5 @@
 
   SUBROUTINE VTe(number)
-    implicit none
+    IMPLICIT NONE
     INTEGER :: Number
 #ifdef USE_VT    
Index: LMDZ6/branches/Amaury_dev/libf/misc/write_field.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/misc/write_field.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/misc/write_field.F90	(revision 5113)
@@ -22,5 +22,5 @@
 
   function GetFieldIndex(name)
-    implicit none
+    IMPLICIT NONE
     integer :: GetFieldindex
     character(len = *) :: name
@@ -41,5 +41,5 @@
 
   subroutine WriteField3d(name, Field)
-    implicit none
+    IMPLICIT NONE
     character(len = *) :: name
     real, dimension(:, :, :) :: Field
@@ -52,5 +52,5 @@
 
   subroutine WriteField2d(name, Field)
-    implicit none
+    IMPLICIT NONE
     character(len = *) :: name
     real, dimension(:, :) :: Field
@@ -63,5 +63,5 @@
 
   subroutine WriteField1d(name, Field)
-    implicit none
+    IMPLICIT NONE
     character(len = *) :: name
     real, dimension(:) :: Field
@@ -74,5 +74,5 @@
 
   subroutine WriteField_gen(name, Field, dimx, dimy, dimz)
-    implicit none
+    IMPLICIT NONE
     character(len = *) :: name
     integer :: dimx, dimy, dimz
@@ -108,5 +108,5 @@
 
   subroutine CreateNewField(name, dimx, dimy, dimz)
-    implicit none
+    IMPLICIT NONE
     character(len = *) :: name
     integer :: dimx, dimy, dimz
@@ -129,5 +129,5 @@
 
   subroutine write_field1D(name, Field)
-    implicit none
+    IMPLICIT NONE
 
     integer, parameter :: MaxDim = 1
@@ -170,5 +170,5 @@
 
   subroutine write_field2D(name, Field)
-    implicit none
+    IMPLICIT NONE
 
     integer, parameter :: MaxDim = 2
@@ -229,5 +229,5 @@
 
   subroutine write_field3D(name, Field)
-    implicit none
+    IMPLICIT NONE
 
     integer, parameter :: MaxDim = 3
Index: LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_grid_phy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_grid_phy.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_grid_phy.F90	(revision 5113)
@@ -291,5 +291,5 @@
 
 !---------------------------------------------------------------- 
-!  Generic (private) fonctions
+!  Generic (PRIVATE) fonctions
 !---------------------------------------------------------------- 
   
Index: LMDZ6/branches/Amaury_dev/libf/phydev/iophy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phydev/iophy.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phydev/iophy.F90	(revision 5113)
@@ -3,6 +3,6 @@
 module iophy
 
-  ! abd  REAL,private,allocatable,dimension(:),save :: io_lat
-  ! abd  REAL,private,allocatable,dimension(:),save :: io_lon
+  ! abd  REAL,PRIVATE,allocatable,dimension(:),save :: io_lat
+  ! abd  REAL,PRIVATE,allocatable,dimension(:),save :: io_lon
   REAL, allocatable, dimension(:), save :: io_lat
   REAL, allocatable, dimension(:), save :: io_lon
@@ -35,5 +35,5 @@
     USE ioipsl, only: flio_dom_set
     use wxios, only: wxios_domain_param, using_xios
-    implicit none
+    IMPLICIT NONE
     real, dimension(klon), intent(in) :: rlon
     real, dimension(klon), intent(in) :: rlat
@@ -143,5 +143,5 @@
     USE lmdz_print_control, ONLY: prt_level, lunout
     USE lmdz_grid_phy, ONLY: nbp_lon
-    implicit none
+    IMPLICIT NONE
 
     character*(*), intent(IN) :: name
@@ -205,5 +205,5 @@
     USE lmdz_grid_phy, ONLY: nbp_lon
     USE lmdz_abort_physic, ONLY: abort_physic
-    implicit none
+    IMPLICIT NONE
 
     integer, intent(in) :: nid
@@ -265,5 +265,5 @@
     USE lmdz_grid_phy, ONLY: nbp_lon
     USE lmdz_abort_physic, ONLY: abort_physic
-    implicit none
+    IMPLICIT NONE
 
     integer, intent(in) :: nid
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bl_for_dms.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bl_for_dms.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/bl_for_dms.f90	(revision 5113)
@@ -39,5 +39,5 @@
   PARAMETER (vk = 0.35)
   REAL :: beta  ! coefficient d'evaporation reelle (/evapotranspiration)
-  ! ! entre 0 et 1, mais 1 au-dessus de la mer
+  ! entre 0 et 1, mais 1 au-dessus de la mer
   PARAMETER (beta = 1.)
   INTEGER :: i, k
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/condsurfc_new.f90	(revision 5113)
@@ -72,6 +72,6 @@
       CALL exit(1)
     ENDIF
-    ! !print *,'lmt_bcff = ',lmt_bcff
-    ! !stop
+    !print *,'lmt_bcff = ',lmt_bcff
+    !stop
 
     ! BC emissions from non fossil fuel combustion
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/dustemission_mod.F90	(revision 5113)
@@ -1374,5 +1374,5 @@
 
 SUBROUTINE def_copyncl(kfin)
-      implicit none
+      IMPLICIT NONE
 
  integer i,n,kfin,ideb,ifin,istep,kfin2
@@ -1427,5 +1427,5 @@
 !c---------------------------------------------------------------
 
-      implicit none
+      IMPLICIT NONE
       integer i1,i2,nclass,iout,ismin,ismax,k2,ihalf,idiff
       real siz(nclass),ds
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/inscav_spl.f90	(revision 5113)
@@ -123,5 +123,5 @@
         beta = MIN(MAX(0.0, -beta), 1.0)
       ELSE                          !--reevaporation non totale pour aerosols
-        ! !print *,'FRAC USED IN INSCAV_SPL'
+        !print *,'FRAC USED IN INSCAV_SPL'
         beta = MIN(MAX(0.0, -beta) * frac, 1.0)
       ENDIF
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/read_newemissions.f90	(revision 5113)
@@ -120,5 +120,5 @@
   !  REAL dayemintime ! time in hours of the other emissions input files resolution
   REAL :: jH_init ! shift in the hour (count as days) respecto to
-  ! ! realhour = (pdtphys*i)/3600/24 -days_elapsed
+  ! realhour = (pdtphys*i)/3600/24 -days_elapsed
   REAL :: jH_emi, jH_vent, jH_day
   SAVE jH_init, jH_vent, jH_day
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Dust/sediment_mod.f90	(revision 5113)
@@ -153,6 +153,6 @@
         v_dep_ss(i, k) = v_sed
         sed_flux(i, k) = tr_seri(i, k, id_coss) * v_sed !g/cm3*m/sec
-        ! !sed_ss3D(i,k)= -sed_flux(i,k)/zdz(i,k)      !g/cm3*sec !!!!!!!
-        ! ! conc_sed_ss3D(i,k)=sed_flux(i,k)*1.e6      !g/m3*sec !!!!!!!
+        !sed_ss3D(i,k)= -sed_flux(i,k)/zdz(i,k)      !g/cm3*sec !!!!!!!
+        ! conc_sed_ss3D(i,k)=sed_flux(i,k)*1.e6      !g/m3*sec !!!!!!!
         !
       ENDDO          !klon
@@ -221,5 +221,5 @@
         v_dep_dust(i, k) = v_sed
         sed_flux(i, k) = tr_seri(i, k, id_codu) * v_sed !g/cm3.m/sec
-        ! !sed_dust3D(i,k)= -sed_flux(i,k)/zdz(i,k)      !g/cm3*sec !!!!!!!
+        !sed_dust3D(i,k)= -sed_flux(i,k)/zdz(i,k)      !g/cm3*sec !!!!!!!
         !
       ENDDO          !klon
@@ -288,5 +288,5 @@
         v_dep_dustsco(i, k) = v_sed
         sed_flux(i, k) = tr_seri(i, k, id_scdu) * v_sed !g/cm3.m/sec
-        ! !sed_dustsco3D(i,k)= -sed_flux(i,k)/zdz(i,k)      !g/cm3*sec !!!!!!!
+        !sed_dustsco3D(i,k)= -sed_flux(i,k)/zdz(i,k)      !g/cm3*sec !!!!!!!
         !
       ENDDO          !klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/bulk_flux_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/bulk_flux_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/bulk_flux_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module bulk_flux_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/config_ocean_skin_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module config_ocean_skin_m
 
-  implicit none
+  IMPLICIT NONE
 
   logical, protected:: jcool ! cool skin calculation
@@ -31,5 +31,5 @@
 #ifdef IN_LMDZ
     use lmdz_ioipsl_getin_p, only: getin_p
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
 #endif
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/const.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/const.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/const.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module const
 
-  implicit none
+  IMPLICIT NONE
 
   real, parameter :: beta = 0.756 / 1023.343
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/esat_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/esat_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/esat_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module esat_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/fv_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/fv_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/fv_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module fv_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/mom_flux_rain_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/mom_flux_rain_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/mom_flux_rain_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module mom_flux_rain_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/phiw_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/phiw_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/phiw_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module Phiw_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/sens_heat_rain_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/sens_heat_rain_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/sens_heat_rain_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module sens_heat_rain_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/therm_expans_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/therm_expans_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/Ocean_skin/therm_expans_m.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module therm_expans_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/StratAer/sulfate_aer_mod.F90	(revision 5113)
@@ -773,5 +773,5 @@
 !     and Noppel et al. (1990)
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: T
       real, parameter ::      &
@@ -792,5 +792,5 @@
 !     equilibrium H2SO4 number density over pure H2SO4 (molec/cm3)
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: T
       real :: presat
@@ -811,5 +811,5 @@
 !     equilibrium H2O pressure over pure liquid water (Pa)
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: T
 
@@ -841,5 +841,5 @@
 !---->Vehkamaeki et al. (2002)
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: T, so4mfrac
       real, parameter :: &
@@ -891,5 +891,5 @@
 !---->Vehkamaeki et al. (2002)
 
-      implicit none
+      IMPLICIT NONE
       real,intent(in) :: T, so4frac
       real :: a,b,so4mfrac,so4m2,so4m3,so4m4,so4m5,so4sig
@@ -941,5 +941,5 @@
 !                     = h2so4 mass fraction*100.
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: pph2o, T 
       
@@ -1004,5 +1004,5 @@
 !     equilibrium h2so4 number density over H2SO4/H2O solution (molec/cm3)
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: T, xa       ! T(K)  xa(H2SO4 mass fraction)
       
@@ -1026,5 +1026,5 @@
 !     partial molar volume of h2so4 in h2so4/h2o solution (cm3/mole)
 
-      implicit none
+      IMPLICIT NONE
       real, intent(in) :: T, ws
       real, dimension(22),parameter :: x=(/  &
@@ -1049,5 +1049,5 @@
 !     molar volume of pure h2o (cm3/mole)
 
-       implicit none
+       IMPLICIT NONE
        real, intent(in) :: T 
        real, parameter :: x1=2.393284E-02,x2=-4.359335E-05,x3=7.961181E-08
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/acama_gwd_rando_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/acama_gwd_rando_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/acama_gwd_rando_m.F90	(revision 5113)
@@ -4,5 +4,5 @@
 module ACAMA_GWD_rando_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
@@ -22,5 +22,5 @@
 !  ONLINE:
     use dimphy, only: klon, klev
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     USE lmdz_ioipsl_getin_p, ONLY: getin_p
     USE lmdz_vertical_layers, ONLY: presnivs
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calbeta_clim.F90	(revision 5113)
@@ -15,5 +15,5 @@
   USE lmdz_print_control, ONLY: prt_level
 
-  implicit none
+  IMPLICIT NONE
   integer klon,nt,j,it
   real logbeta(klon),pi
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/calltherm.F90	(revision 5113)
@@ -42,5 +42,5 @@
 #endif
 
-      implicit none
+      IMPLICIT NONE
       include "clesphys.h"
       include "thermcell_old.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coare30_flux_cnrm_mod.F90	(revision 5113)
@@ -6,6 +6,6 @@
 
 module coare30_flux_cnrm_mod
-  implicit none
-  private
+  IMPLICIT NONE
+  PRIVATE
   public 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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/coare_cp_mod.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module coare_cp_mod
-  implicit none
-  private
+  IMPLICIT NONE
+  PRIVATE
   public psit_30, psiuo, coare_cp
 
@@ -7,5 +7,5 @@
 
   real function psit_30(zet)
-    implicit none
+    IMPLICIT NONE
     real, intent(in) :: zet
 
@@ -27,5 +27,5 @@
 
   real function psiuo(zet)
-    implicit none
+    IMPLICIT NONE
     real, intent(in) :: zet
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/conccm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/conccm.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/conccm.F90	(revision 5113)
@@ -259,5 +259,5 @@
   REAL shprme ! intermediate specific humidity pert.
   REAL qsattp ! saturation mixing ratio for
-  ! !  thermally perturbed PBL parcels
+  !  thermally perturbed PBL parcels
   REAL dz ! local layer depth
   REAL b1 ! bouyancy measure in detrainment lvl
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/convect3.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/convect3.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/convect3.F90	(revision 5113)
@@ -234,5 +234,5 @@
 
   nopt = 0
-  ! !      NOPT=1 ! sbl
+  !      NOPT=1 ! sbl
 
   ! ***            PERFORM DRY ADIABATIC ADJUSTMENT            ***
@@ -303,6 +303,6 @@
       fv2(i) = (v(i)-v1(i))/delt ! sbl
 
-      ! !            T1(I)=T(I)      ! commente sbl
-      ! !            R1(I)=RR(I)     ! commente sbl
+      !            T1(I)=T(I)      ! commente sbl
+      !            R1(I)=RR(I)     ! commente sbl
     END DO
   END IF
@@ -1313,5 +1313,5 @@
   ! *** Diagnose the in-cloud mixing ratio   ***              ! cld
   ! ***           of condensed water         ***              ! cld
-  ! ! cld
+  ! cld
   DO i = 1, nd ! cld
     maa(i) = 0.0 ! cld
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/create_limit_unstruct_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/create_limit_unstruct_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/create_limit_unstruct_mod.F90	(revision 5113)
@@ -179,7 +179,6 @@
   
   SUBROUTINE time_interpolation(ndays,field_in,calendar,field_out)
-  USE pchsp_95_m, only: pchsp_95
-  USE pchfe_95_m, only: pchfe_95
-  USE arth_m, only: arth
+  USE lmdz_libmath_pch, only: pchsp_95, pchfe_95
+  USE lmdz_arth, only: arth
   USE dimphy, ONLY: klon
   USE ioipsl,             ONLY: ioget_year_len
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv30_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv30_routines.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv30_routines.F90	(revision 5113)
@@ -331,5 +331,5 @@
   icbmax = 2
   DO i = 1, len
-    ! !        icbmax=max(icbmax,icb(i))
+    !        icbmax=max(icbmax,icb(i))
     IF (iflag(i)<7) icbmax = max(icbmax, icb(i)) ! sb Jun7th02
   END DO
@@ -420,5 +420,5 @@
 
   ! Re-compute icbsmax (icbsmax2):        !convect3
-  ! !convect3
+  !convect3
   icbsmax2 = 2 !convect3
   DO i = 1, len !convect3
@@ -1277,18 +1277,18 @@
   END DO
 
-  ! !      if(inb.lt.(nl-1))then
-  ! !         do 85 i=inb+1,nl-1
-  ! !            sig(i)=beta*sig(i)+2.*alpha*buoy(inb)*
-  ! !     1              abs(buoy(inb))
-  ! !            sig(i)=amax1(sig(i),0.0)
-  ! !            w0(i)=beta*w0(i)
-  ! !   85    continue
-  ! !      end if
-
-  ! !      do 87 i=1,icb
-  ! !         sig(i)=beta*sig(i)-2.*alpha*buoy(icb)*buoy(icb)
-  ! !         sig(i)=amax1(sig(i),0.0)
-  ! !         w0(i)=beta*w0(i)
-  ! !   87 continue
+  !      if(inb.lt.(nl-1))then
+  !         do 85 i=inb+1,nl-1
+  !            sig(i)=beta*sig(i)+2.*alpha*buoy(inb)*
+  !     1              abs(buoy(inb))
+  !            sig(i)=amax1(sig(i),0.0)
+  !            w0(i)=beta*w0(i)
+  !   85    continue
+  !      end if
+
+  !      do 87 i=1,icb
+  !         sig(i)=beta*sig(i)-2.*alpha*buoy(icb)*buoy(icb)
+  !         sig(i)=amax1(sig(i),0.0)
+  !         w0(i)=beta*w0(i)
+  !   87 continue
 
   ! -------------------------------------------------------------
@@ -1373,31 +1373,31 @@
 
 
-  ! !      cape=0.0
-  ! !      do 98 i=icb+1,inb
-  ! !         deltap = min(pbase,ph(i-1))-min(pbase,ph(i))
-  ! !         cape=cape+rrd*buoy(i-1)*deltap/p(i-1)
-  ! !         dcape=rrd*buoy(i-1)*deltap/p(i-1)
-  ! !         dlnp=deltap/p(i-1)
-  ! !         cape=amax1(0.0,cape)
-  ! !         sigold=sig(i)
-
-  ! !         dtmin=100.0
-  ! !         do 97 j=icb,i-1
-  ! !            dtmin=amin1(dtmin,buoy(j))
-  ! !   97    continue
-
-  ! !         sig(i)=beta*sig(i)+alpha*dtmin*abs(dtmin)
-  ! !         sig(i)=amax1(sig(i),0.0)
-  ! !         sig(i)=amin1(sig(i),0.01)
-  ! !         fac=amin1(((dtcrit-dtmin)/dtcrit),1.0)
-  ! !         w=(1.-beta)*fac*sqrt(cape)+beta*w0(i)
-  ! !         amu=0.5*(sig(i)+sigold)*w
-  ! !         m(i)=amu*0.007*p(i)*(ph(i)-ph(i+1))/tv(i)
-  ! !         w0(i)=w
-  ! !   98 continue
-  ! !      w0(icb)=0.5*w0(icb+1)
-  ! !      m(icb)=0.5*m(icb+1)*(ph(icb)-ph(icb+1))/(ph(icb+1)-ph(icb+2))
-  ! !      sig(icb)=sig(icb+1)
-  ! !      sig(icb-1)=sig(icb)
+  !      cape=0.0
+  !      do 98 i=icb+1,inb
+  !         deltap = min(pbase,ph(i-1))-min(pbase,ph(i))
+  !         cape=cape+rrd*buoy(i-1)*deltap/p(i-1)
+  !         dcape=rrd*buoy(i-1)*deltap/p(i-1)
+  !         dlnp=deltap/p(i-1)
+  !         cape=amax1(0.0,cape)
+  !         sigold=sig(i)
+
+  !         dtmin=100.0
+  !         do 97 j=icb,i-1
+  !            dtmin=amin1(dtmin,buoy(j))
+  !   97    continue
+
+  !         sig(i)=beta*sig(i)+alpha*dtmin*abs(dtmin)
+  !         sig(i)=amax1(sig(i),0.0)
+  !         sig(i)=amin1(sig(i),0.01)
+  !         fac=amin1(((dtcrit-dtmin)/dtcrit),1.0)
+  !         w=(1.-beta)*fac*sqrt(cape)+beta*w0(i)
+  !         amu=0.5*(sig(i)+sigold)*w
+  !         m(i)=amu*0.007*p(i)*(ph(i)-ph(i+1))/tv(i)
+  !         w0(i)=w
+  !   98 continue
+  !      w0(icb)=0.5*w0(icb+1)
+  !      m(icb)=0.5*m(icb+1)*(ph(icb)-ph(icb+1))/(ph(icb+1)-ph(icb+2))
+  !      sig(icb)=sig(icb+1)
+  !      sig(icb-1)=sig(icb)
 
 END SUBROUTINE cv30_closure
@@ -1872,5 +1872,5 @@
   ! enddo
   ! enddo
-  ! ! RomP >>>
+  ! RomP >>>
   DO i = 1, nd
     DO il = 1, ncum
@@ -1879,5 +1879,5 @@
     END DO
   END DO
-  ! ! RomP <<<
+  ! RomP <<<
 
   ! ***  check whether ep(inb)=0, if so, skip precipitating    ***
@@ -2289,8 +2289,8 @@
   ! ***  NE PAS UTILISER POUR L'INSTANT ***
 
-  ! !      do il=1,ncum
-  ! !        wd(il)=betad*abs(mp(il,icb(il)))*0.01*rrd*t(il,icb(il))
-  ! !     :                                  /(sigd*p(il,icb(il)))
-  ! !      enddo
+  !      do il=1,ncum
+  !        wd(il)=betad*abs(mp(il,icb(il)))*0.01*rrd*t(il,icb(il))
+  !     :                                  /(sigd*p(il,icb(il)))
+  !      enddo
 
 
@@ -2943,5 +2943,5 @@
   ! *** diagnose the in-cloud mixing ratio   ***            ! cld
   ! ***           of condensed water         ***            ! cld
-  ! ! cld
+  ! cld
 
   DO i = 1, nd ! cld
@@ -3004,5 +3004,5 @@
 END SUBROUTINE cv30_yield
 
-! !RomP >>>
+!RomP >>>
 SUBROUTINE cv30_tracer(nloc, len, ncum, nd, na, ment, sij, da, phi, phi2, &
         d1a, dam, ep, vprecip, elij, clw, epmlmmm, eplamm, icb, inb)
@@ -3062,7 +3062,7 @@
       DO i = 1, ncum
         IF (k>=icb(i) .AND. k<=inb(i) .AND. j<=inb(i)) THEN
-          ! !jyg             epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j)
+          !jyg             epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j)
           epm(i, j, k) = 1. - (1. - ep(i, j)) * clw(i, j) / max(elij(i, k, j), 1.E-16)
-          ! !
+          !
           epm(i, j, k) = max(epm(i, j, k), 0.0)
         END IF
@@ -3248,5 +3248,5 @@
         , epmax_diag)
   USE lmdz_abort_physic, ONLY: abort_physic
-  implicit none
+  IMPLICIT NONE
 
   ! On fait varier epmax en fn de la cape
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv3_routines.F90	(revision 5113)
@@ -5131,5 +5131,5 @@
                  , pbase, p, ph, tv, buoy, sig, w0,iflag &
                  , epmax_diag)
-        implicit none
+        IMPLICIT NONE
 
         ! On fait varier epmax en fn de la cape
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/cv_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/cv_routines.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/cv_routines.F90	(revision 5113)
@@ -1632,5 +1632,5 @@
   ! *** diagnose the in-cloud mixing ratio   ***            ! cld
   ! ***           of condensed water         ***            ! cld
-  ! ! cld
+  ! cld
   DO ij = 1, ncum ! cld
     DO i = 1, nd ! cld
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_1dutils.f90	(revision 5113)
@@ -1246,5 +1246,5 @@
     !   avec w=omega * dt
     !---------------------------------------------------------------
-    implicit none
+    IMPLICIT NONE
     ! arguments
     integer llm
@@ -1282,5 +1282,5 @@
     !   sans WTG rajouter une advection horizontale
     !----------------------------------------------------------------------
-    implicit none
+    IMPLICIT NONE
     include "YOMCST.h"
     !        argument
@@ -1354,5 +1354,5 @@
     !   sans WTG rajouter une advection horizontale
     !----------------------------------------------------------------------
-    implicit none
+    IMPLICIT NONE
     include "YOMCST.h"
     !        argument
@@ -1429,5 +1429,5 @@
     USE dimphy
 
-    implicit none
+    IMPLICIT NONE
 
     ! ========================================================
@@ -1477,5 +1477,5 @@
     USE dimphy
 
-    implicit none
+    IMPLICIT NONE
 
     ! ========================================================
@@ -1510,5 +1510,5 @@
     USE dimphy
 
-    implicit none
+    IMPLICIT NONE
 
     ! ========================================================
@@ -1599,5 +1599,5 @@
     USE dimphy
 
-    implicit none
+    IMPLICIT NONE
 
     ! ========================================================
@@ -1664,5 +1664,5 @@
           &, dth_mod_cas, hth_mod_cas, vth_mod_cas, mxcalc)
 
-    implicit none
+    IMPLICIT NONE
 
     include "YOMCST.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/lmdz_old_1dconv.f90	(revision 5113)
@@ -8,5 +8,5 @@
           &       Ts, imp_fcg, ts_fcg, Tp_fcg, Turb_fcg)
 
-    implicit none
+    IMPLICIT NONE
 
     !ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
@@ -458,5 +458,5 @@
           &, d_t_adv, d_q_adv)
     use dimphy
-    implicit none
+    IMPLICIT NONE
 
     INCLUDE "dimensions.h"
@@ -490,5 +490,5 @@
 
   SUBROUTINE copie(klevgcm, playgcm, psolgcm, file_forctl)
-    implicit none
+    IMPLICIT NONE
 
     !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
@@ -703,5 +703,5 @@
 
   SUBROUTINE corresbis(psol)
-    implicit none
+    IMPLICIT NONE
 
     !cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_amma_read.F90	(revision 5113)
@@ -57,5 +57,5 @@
 
 SUBROUTINE read_1D_cases
-      implicit none
+      IMPLICIT NONE
 
       INTEGER nid,rid,ierr
@@ -176,5 +176,5 @@
 
 !program reading forcings of the AMMA case study
-      implicit none
+      IMPLICIT NONE
 
       integer ntime,nlevel
@@ -348,5 +348,5 @@
            ,vitw_amma,ht_amma,hq_amma,lat_amma,sens_amma               &
            ,vitw_prof,ht_prof,hq_prof,lat_prof,sens_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read.F90	(revision 5113)
@@ -819,5 +819,5 @@
 
 
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read2.F90	(revision 5113)
@@ -80,5 +80,5 @@
 
   SUBROUTINE read_1D_cas
-    implicit none
+    IMPLICIT NONE
 
     INTEGER nid,rid,ierr
@@ -189,5 +189,5 @@
   !**********************************************************************************************
   SUBROUTINE read2_1D_cas
-    implicit none
+    IMPLICIT NONE
 
     INTEGER nid,rid,ierr
@@ -314,5 +314,5 @@
   !**********************************************************************************************
   SUBROUTINE old_read_SCM_cas
-    implicit none
+    IMPLICIT NONE
 
     INCLUDE "date_cas.h"
@@ -535,5 +535,5 @@
 
   !program reading forcing of the case study
-  implicit none
+  IMPLICIT NONE
 
   integer ntime,nlevel
@@ -650,5 +650,5 @@
 
   !program reading forcing of the case study
-  implicit none
+  IMPLICIT NONE
 
   integer ntime,nlevel
@@ -819,5 +819,5 @@
 
   !program reading forcing of the case study
-  implicit none
+  IMPLICIT NONE
 
   integer ntime,nlevel,k,t
@@ -1038,5 +1038,5 @@
 
 
-  implicit none
+  IMPLICIT NONE
 
   !---------------------------------------------------------------------------------------
@@ -1247,5 +1247,5 @@
 
 
-  implicit none
+  IMPLICIT NONE
 
   !---------------------------------------------------------------------------------------
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/mod_1D_cases_read_std.F90	(revision 5113)
@@ -89,5 +89,5 @@
   !**********************************************************************************************
   SUBROUTINE read_SCM_cas
-    implicit none
+    IMPLICIT NONE
 
     INCLUDE "date_cas.h"
@@ -329,5 +329,5 @@
 
     !program reading forcing of the case study
-    implicit none
+    IMPLICIT NONE
     INCLUDE "compar1d.h"
 
@@ -658,5 +658,5 @@
 
 
-    implicit none
+    IMPLICIT NONE
 
     !---------------------------------------------------------------------------------------
@@ -930,5 +930,5 @@
        ,dth_mod_cas,hth_mod_cas,vth_mod_cas,mxcalc)
 
-    implicit none
+    IMPLICIT NONE
 
     INCLUDE "YOMCST.h"
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/old_1DUTILS_read_interp.h	(revision 5113)
@@ -3,5 +3,5 @@
      &             ,ts_toga,plev_toga,t_toga,q_toga,u_toga,v_toga,w_toga        &
      &             ,ht_toga,vt_toga,hq_toga,vq_toga)
-      implicit none
+      IMPLICIT NONE
 
 !-------------------------------------------------------------------------
@@ -65,5 +65,5 @@
 !-------------------------------------------------------------------------
       SUBROUTINE read_sandu(fich_sandu,nlev_sandu,nt_sandu,ts_sandu)
-      implicit none
+      IMPLICIT NONE
 
 !-------------------------------------------------------------------------
@@ -102,5 +102,5 @@
       SUBROUTINE read_astex(fich_astex,nlev_astex,nt_astex,div_astex,      &
      & ts_astex,ug_astex,vg_astex,ufa_astex,vfa_astex)
-      implicit none
+      IMPLICIT NONE
 
 !-------------------------------------------------------------------------
@@ -150,5 +150,5 @@
 
 
-      implicit none
+      IMPLICIT NONE
 
       integer ntime,nlevel
@@ -495,5 +495,5 @@
             nf90_inq_dimid,nf90_inquire_dimension
 
-         implicit none
+         IMPLICIT NONE
          integer nid,ttm,llm
          real*8 time(ttm)
@@ -543,5 +543,5 @@
      &         ,omega_mod,o3mmr_mod,mxcalc)
 
-       implicit none
+       IMPLICIT NONE
 
       INCLUDE "dimensions.h"
@@ -657,5 +657,5 @@
      &         ,tke_mod,o3mmr_mod,mxcalc)
 
-       implicit none
+       IMPLICIT NONE
 
       INCLUDE "dimensions.h"
@@ -776,5 +776,5 @@
      &             ,ts_rico,t_rico,q_rico,u_rico,v_rico,w_rico             &
      &             ,dth_dyn,dqh_dyn)
-      implicit none
+      IMPLICIT NONE
 
 !-------------------------------------------------------------------------
@@ -939,5 +939,5 @@
      &             ,year_ini_sandu,day_ini_sandu,nt_sandu,dt_sandu         &
      &             ,nlev_sandu,ts_sandu,ts_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
@@ -1014,5 +1014,5 @@
       SUBROUTINE read_armcu(fich_armcu,nlev_armcu,nt_armcu,                &
      & sens,flat,adv_theta,rad_theta,adv_qt)
-      implicit none
+      IMPLICIT NONE
 
 !-------------------------------------------------------------------------
@@ -1055,5 +1055,5 @@
      &         ,ht_mod,vt_mod,hq_mod,vq_mod,mxcalc)
  
-       implicit none
+       IMPLICIT NONE
  
       INCLUDE "dimensions.h"
@@ -1177,5 +1177,5 @@
      &         ,dt_mod_cas,ht_mod_cas,vt_mod_cas,dtrad_mod_cas,dq_mod_cas,hq_mod_cas,vq_mod_cas,mxcalc)
  
-       implicit none
+       IMPLICIT NONE
  
        INCLUDE "dimensions.h"
@@ -1336,5 +1336,5 @@
      &         ,ht_mod,hq_mod,hu_mod,hv_mod,w_mod,omega_mod,mxcalc)
  
-       implicit none
+       IMPLICIT NONE
  
        INCLUDE "dimensions.h"
@@ -1458,5 +1458,5 @@
      &             ,ufa_astex,vfa_astex,div_prof,ts_prof,ug_prof,vg_prof   &
      &             ,ufa_prof,vfa_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
@@ -1550,5 +1550,5 @@
      &             ,ts_prof,plev_prof,t_prof,q_prof,u_prof,v_prof,w_prof   &
      &             ,ht_prof,vt_prof,hq_prof,vq_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
@@ -1692,5 +1692,5 @@
      &             ,ustar_prof,psurf_prof,ug_prof,vg_prof                 &
      &             ,ht_prof,hq_prof,hu_prof,hv_prof,w_prof,omega_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
@@ -1805,5 +1805,5 @@
      &             ,ug_gabls4,vg_gabls4,ht_gabls4,hq_gabls4,tg_gabls4                          &
      &             ,ug_prof,vg_prof,ht_prof,hq_prof,tg_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
@@ -1892,5 +1892,5 @@
      &             ,nlev_armcu,fs_armcu,fl_armcu,at_armcu,rt_armcu         &
      &             ,aqt_armcu,fs_prof,fl_prof,at_prof,rt_prof,aqt_prof)
-        implicit none
+        IMPLICIT NONE
 
 !---------------------------------------------------------------------------------------
@@ -1972,5 +1972,5 @@
      &           wfls,dqtdxls,dqtdyls,dqtdtls,                             &
      &           thlpcar,tracer,nt1,nt2)
-      implicit none
+      IMPLICIT NONE
 
         integer nlev_max,kmax,kmax2,ntrac
@@ -2045,5 +2045,5 @@
      &       thlprof,qprof,uprof,vprof,wprof,omega,o3mmr)
 !======================================================================
-      implicit none
+      IMPLICIT NONE
 
         integer nlev_max,kmax
@@ -2077,5 +2077,5 @@
      &    thlprof,qvprof,qlprof,qtprof,uprof,vprof,wprof,tkeprof,o3mmr)
 !======================================================================
-      implicit none
+      IMPLICIT NONE
 
         integer nlev_max,kmax
@@ -2111,5 +2111,5 @@
      &       vprof,thetaprof,tprof,qvprof,rvprof,aprof,bprof)
 !======================================================================
-      implicit none
+      IMPLICIT NONE
 
         integer nlev_max,kmax
@@ -2172,5 +2172,5 @@
       use netcdf, ONLY: nf90_open,nf90_nowrite,nf90_noerr,nf90_strerror,nf90_inq_varid,nf90_get_var,&
             nf90_inq_dimid,nf90_inquire_dimension
-      implicit none
+      IMPLICIT NONE
 
       integer ntime,nlevel
@@ -2383,5 +2383,5 @@
             nf90_inq_dimid,nf90_inquire_dimension
 
-      implicit none
+      IMPLICIT NONE
 
       INCLUDE "YOMCST.h"
@@ -2717,5 +2717,5 @@
             nf90_inq_dimid,nf90_inquire_dimension
 
-      implicit none
+      IMPLICIT NONE
 
       integer ntime,nlevel,nsol
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/dyn1d/replay1d.F90	(revision 5113)
@@ -10,5 +10,5 @@
 
 
-      implicit none
+      IMPLICIT NONE
       INCLUDE "dimensions.h"
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/flott_gwd_rando_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/flott_gwd_rando_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/flott_gwd_rando_m.F90	(revision 5113)
@@ -3,5 +3,5 @@
 module FLOTT_GWD_rando_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
@@ -19,5 +19,5 @@
     !ONLINE:
     use dimphy, only: klon, klev
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     USE lmdz_ioipsl_getin_p, ONLY: getin_p
     USE lmdz_vertical_layers, ONLY: presnivs
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/fonte_neige_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/fonte_neige_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/fonte_neige_mod.F90	(revision 5113)
@@ -16,5 +16,5 @@
 ! run_off_ter and run_off_lic are the runoff at the compressed grid knon for 
 ! land and land-ice respectively
-! Note: run_off_lic is used in mod_landice and therfore not private
+! Note: run_off_lic is used in mod_landice and therfore not PRIVATE
   REAL, ALLOCATABLE, DIMENSION(:), PRIVATE    :: run_off_ter
   !$OMP THREADPRIVATE(run_off_ter)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/global_mean.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/global_mean.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/global_mean.F90	(revision 5113)
@@ -10,5 +10,5 @@
   use lmdz_phys_mpi_data, only: is_mpi_root
   USE ioipsl
-  implicit none
+  IMPLICIT NONE
 
   real,dimension(klon),intent(in) :: field
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/grid_index.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/grid_index.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/grid_index.F90	(revision 5113)
@@ -7,5 +7,5 @@
 USE dimphy, ONLY: klon
 USE lmdz_geometry, ONLY: latitude_deg, longitude_deg
-implicit none
+IMPLICIT NONE
 real, intent(in) :: lon_deg,lat_deg
 integer :: grid_index
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/grid_noro_m.F90	(revision 5113)
@@ -7,5 +7,5 @@
 
   USE lmdz_print_control, ONLY: lunout
-  USE assert_eq_m,       ONLY: assert_eq
+  USE lmdz_assert_eq,       ONLY: assert_eq
   PRIVATE
   PUBLIC :: grid_noro, grid_noro0, read_noro
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ini_undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ini_undefSTD.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ini_undefSTD.F90	(revision 5113)
@@ -23,7 +23,7 @@
 
   ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
-  ! ! de la physique
+  ! de la physique
   ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
-  ! ! de la physique
+  ! de la physique
   ! nout=3 !var. mensuelle "NMC" moyennee toutes les 6heures
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/inlandsis.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/inlandsis.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/inlandsis.f90	(revision 5113)
@@ -336,16 +336,16 @@
 
   data      Z0mBS0 /   0.5e-6/            ! MINimum Snow Roughness Length
-                                          ! ! for Momentum if Blowing Snow
-                                          ! ! Gallee et al. 2001 BLM 99 (19)
+                                          ! for Momentum if Blowing Snow
+                                          ! Gallee et al. 2001 BLM 99 (19)
   data      Z0m_S0/    0.00005/           ! MINimum Snow Roughness Length
-                                          ! ! MegaDunes    included
+                                          ! MegaDunes    included
   data      Z0m_S1/    0.030  /           ! MAXimum Snow Roughness Length
-                                          ! !        (Sastrugis)
+                                          !        (Sastrugis)
   ! #GL data      Z0_GIM/    0.0013/            ! Ice Min Z0 = 0.0013 m (Broeke)
-                                          ! ! Old Ice Z0 = 0.0500 m (Bruce)
-                                          ! !              0.0500 m (Smeets)
-                                          ! !              0.1200 m (Broeke)
+                                          ! Old Ice Z0 = 0.0500 m (Bruce)
+                                          !              0.0500 m (Smeets)
+                                          !              0.1200 m (Broeke)
   data      Z0_ICE/    0.0010/            ! Sea-Ice Z0 = 0.0010 m (Andreas)
-                                          ! !    (Ice Station Weddel -- ISW)
+                                          !    (Ice Station Weddel -- ISW)
   ! for aerolian erosion
   data      SblPom/ 1.27/   ! Lower Boundary Height Parameter
@@ -436,6 +436,6 @@
 
     rCd10n =  1. / 26.5 ! Vt / u*t = 26.5
-                 ! ! Budd et al. 1965, Antarct. Res. Series Fig.13
-                 ! ! ratio developped during assumed neutral conditions
+                 ! Budd et al. 1965, Antarct. Res. Series Fig.13
+                 ! ratio developped during assumed neutral conditions
 
 
@@ -554,7 +554,7 @@
         ! sss__G      =  0.27417     * gravit
 
-  ! !  ______________               _____
-  ! !  Newton-Raphson (! Iteration, BEGIN)
-  ! !  ~~~~~~~~~~~~~~               ~~~~~
+  !  ______________               _____
+  !  Newton-Raphson (! Iteration, BEGIN)
+  !  ~~~~~~~~~~~~~~               ~~~~~
         ! DO iit=1,nit
         ! sss__K      =  gravit      * r_Turb * A_Turb *za__SV(ikl)
@@ -580,16 +580,16 @@
    !      us__SV(ikl)= max(us__SV(ikl),epsi  )
    !      rCDmSV(ikl)=     us__SV(ikl)/VVa_OK
-  ! ! #AE     sss__F     =     vonkar     /rCDmSV(ikl)
+  ! #AE     sss__F     =     vonkar     /rCDmSV(ikl)
    !      ENDDO
 
-  ! !  ______________               ___
-  ! !  Newton-Raphson (! Iteration, END  )
-  ! !  ~~~~~~~~~~~~~~               ~~~
+  !  ______________               ___
+  !  Newton-Raphson (! Iteration, END  )
+  !  ~~~~~~~~~~~~~~               ~~~
 
    !      us_127      =  exp(    SblPom *log(us__SV(ikl)))
    !      us_227      =  us_127         *    us__SV(ikl)
 
-  ! !  Momentum            Turbulent Scale  u*: 0-Limit in case of no Blow. Snow
-  ! !  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  !  Momentum            Turbulent Scale  u*: 0-Limit in case of no Blow. Snow
+  !  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    !      dusuth      =  us__SV(ikl) - usthSV(ikl)       ! u* - uth*
    !      signus      =  max(sign(unun,dusuth),zero)     ! 1 <=> u* - uth* > 0
@@ -664,5 +664,5 @@
         if (is_ok_density_kotlyakov) then
             tt_tmp = TaT_SV(ikl)-TfSnow
-            ! !vv_tmp = VV10SV(ikl)
+            !vv_tmp = VV10SV(ikl)
             vv_tmp=VV__SV(ikl) ! Etienne: use wind speed at first model level instead of 10m wind
   ! + ...         [ A compromise between
@@ -1004,6 +1004,6 @@
 
         e_pRad = 2.5   *  coszSV(ikl)       ! exponential argument,
-                                            ! ! V/nIR radiation partitioning,
-                                            ! ! DR97, 2, eqn (2.53) & (2.54)
+                                            ! V/nIR radiation partitioning,
+                                            ! DR97, 2, eqn (2.53) & (2.54)
         e1pRad = 1.-exp(-e_pRad)            ! exponential, V/nIR Rad. Part.
         exdRad= 1.
@@ -1186,5 +1186,5 @@
 
       TBr_sv(ikl) =sqrt(sqrt(IRu_SV(ikl)/StefBo))      ! Brightness
-                                                       ! ! Temperature
+                                                       ! Temperature
       uts_SV(ikl) =     (HSv_sv(ikl) +HSs_sv(ikl)) & ! u*T*
             /(rhT_SV(ikl) *cp)          !
@@ -1318,5 +1318,5 @@
   ! +  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       A_Fact      =  1.0000        ! Andreas et al., 2004, p.4
-                                   ! ! ams.confex.com/ams/pdfpapers/68601.pdf
+                                   ! ams.confex.com/ams/pdfpapers/68601.pdf
 
   ! Parameterization of z0 dependance on Temperature (C. Amory, 2017)
@@ -1341,5 +1341,5 @@
         Z0_obs = exp(coefa*TaT_SV(ikl) + coefb)
       else if (TaT_SV(ikl)>=ta2 .and. TaT_SV(ikl)<ta3) then
-        ! ! if st > 0, melting induce smooth surface
+        ! if st > 0, melting induce smooth surface
         Z0_obs = exp(coefc*TaT_SV(ikl) + coefd)
       else
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_bsn.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_bsn.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_bsn.f90	(revision 5113)
@@ -50,5 +50,5 @@
   ! +  =======
 
-  ! !DO isn = nsno,2,-1
+  !DO isn = nsno,2,-1
   DO ikl = 1,knonv
 
@@ -70,14 +70,14 @@
           /max(epsi,ro__SV(ikl,isn))
 
-    ! ! Densification of the uppermost snow layer if erosion:
+    ! Densification of the uppermost snow layer if erosion:
     if((dzweqo-dzweqn)>0                    .and. &
           dzsnSV(ikl,isn)>0                    .and. &
           ro__SV(ikl,max(1,isnoSV(ikl)))<roBdSV) then
 
-    ! !characteristic time scale for drifting snow compaction set to 24h
-    ! !linear densification rate [kg/m3/s] over 24h
+    !characteristic time scale for drifting snow compaction set to 24h
+    !linear densification rate [kg/m3/s] over 24h
     densif         = (450. - frsno) / (3600*24)
 
-    ! !Attenuation of compaction rate from 450 to 500 kg/m3
+    !Attenuation of compaction rate from 450 to 500 kg/m3
     Fac         = 1-((ro__SV(ikl,max(1,isnoSV(ikl))) &
           -roBdSV)/(500.-roBdSV))
@@ -103,5 +103,5 @@
 
   END DO
-  ! !END DO
+  !END DO
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_qsn.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_qsn.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_qsn.f90	(revision 5113)
@@ -73,7 +73,7 @@
   ! #vm real     EqSn01(knonv)                 ! Snow Energy, after Phase Change
   ! #vm real     EqSn02(knonv)                 ! Snow Energy, after Phase Change
-                                         ! !              .AND. Last Melting
+                                         !              .AND. Last Melting
   ! #e1 real     EqSn_1(knonv)                 ! Snow Energy, after Phase Change
-                                         ! !              .AND. Mass Redistr.
+                                         !              .AND. Mass Redistr.
   ! Snow/Ice (Mass) Budget
   ! ~~~~~~~~~~~~~~~~~~~~~~
@@ -160,5 +160,5 @@
   data      dz_Min/2.5e-3/                ! Minim. Snow Layer Thickness
   data      SGDmax/0.003/                 ! Maxim. Snow Grain Diameter  [m]
-                                          ! ! (Rowe et al. 1995, JGR p.16268)
+                                          ! (Rowe et al. 1995, JGR p.16268)
 
   ! +--Energy Budget (IN)
@@ -206,6 +206,6 @@
     noSnow(ikl)   = 0                   ! Nb of Layers Updater
     ispiSV(ikl)   = 0                   ! Pore Hole Close OFF Index
-                                        ! ! (assumed to be the Top of
-                                        ! !  the surimposed Ice Layer)
+                                        ! (assumed to be the Top of
+                                        !  the surimposed Ice Layer)
     zn5_SV(ikl)   = 0.
     rusnSV0(ikl)  = 0.
@@ -493,5 +493,5 @@
 
       if(isnoSV(ikl)<=1 .OR. opt_runoff_ac) rusnew = 0.
-      ! !if(ivgtSV(ikl)>=1) rusnew = 0.
+      !if(ivgtSV(ikl)>=1) rusnew = 0.
 
   ! #EU                        rusnew = 0.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_sno_albedo.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_sno_albedo.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_sno_albedo.f90	(revision 5113)
@@ -253,6 +253,6 @@
 
       dalbeW =(0.64 - csegal  )*0.0625  ! Warren 1982, RevGeo, fig.12b
-                                        ! ! 0.0625 = 5% * 1/0.8,   p.81
-                                        ! ! 0.64   = cos(50)
+                                        ! 0.0625 = 5% * 1/0.8,   p.81
+                                        ! 0.64   = cos(50)
       dalbed =     dalbeW      *       min(1,isnoSV(ikl))
   !-------------------------------------------------------------------------
@@ -276,5 +276,5 @@
       albSn6(4:6)=albSn2
 
-      ! !snow albedo corection if wetsnow
+      !snow albedo corection if wetsnow
   ! #GL     albSn1 =  albSn1*max(0.9,(1.-1.5*eta_SV(ikl,isn)))
   ! #GL     albSn2 =  albSn2*max(0.9,(1.-1.5*eta_SV(ikl,isn)))
@@ -410,5 +410,5 @@
   ! +--Integrated Snow/Ice/Soil Albedo: Clouds Correction! Greuell & all., 1994
   ! +  --------------------------------------------------! Glob.&t Planet.Change
-                                                   ! ! (9):91-114
+                                                   ! (9):91-114
         alb1sv(ikl) = alb1sv(ikl) + 0.05 *(cld_SV(ikl)-0.5)*SIcenH &
               + dalbed      *    (1.-cld_SV(ikl))
@@ -460,7 +460,7 @@
     !AO_CK 20/02/2020
 
-    ! ! No check if coupling update since MAR and NEMO albedo are too different
+    ! No check if coupling update since MAR and NEMO albedo are too different
     ! and since MAR albedo is computed on properties that are not in NEMO
-    ! ! prescription for each time step with NEMO values
+    ! prescription for each time step with NEMO values
 
   ! #AO      if (LSmask(ikl) .eq. 0 .and. coupling_ao .eq. .TRUE.) then
@@ -511,5 +511,5 @@
       DO ikl=1,knonv
         sEX_sv(ikl,isn) = 1.0
-       ! !sEX_sv(ikl,isn) = 0.95 ! if MAR is too warm in summer
+       !sEX_sv(ikl,isn) = 0.95 ! if MAR is too warm in summer
       END DO
     END DO
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_ts2.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_ts2.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_ts2.f90	(revision 5113)
@@ -265,5 +265,5 @@
     IRs__D(ig) = dIRsdT(ig)* TsisSV(ig, isl) * 0.75                  !:
   END DO
-  ! !hj
+  !hj
   !!-----------------------------------------------------------------------
   !! 3)
@@ -370,5 +370,5 @@
       zx_qs = r2es * FOEEW(Tsf_SV(ig), zdelta) / ps__SV(ig)
       zx_qs = MIN(0.5, zx_qs)
-      ! !write(*,*)'zcor',retv*zx_qs
+      !write(*,*)'zcor',retv*zx_qs
       zcor = 1. / (1. - retv * zx_qs)
       zx_qs = zx_qs * zcor
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_tso.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_tso.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_tso.f90	(revision 5113)
@@ -372,5 +372,5 @@
   ! +  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-    ! !EV!isl=  min(isnoSV(1)+1,nsno)
+    !EV!isl=  min(isnoSV(1)+1,nsno)
 
     DO ikl=1,knonv
@@ -426,7 +426,7 @@
       !  sp = (pst_SV(ikl) + ptopSV) * 10.
 
-      ! !sp=ps__SV(ikl)
-      ! ! Etienne: in the formula herebelow sp should be in hPa, not
-      ! ! in Pa so I divide by 100.
+      !sp=ps__SV(ikl)
+      ! Etienne: in the formula herebelow sp should be in hPa, not
+      ! in Pa so I divide by 100.
       sp=ps__SV(ikl)/100.
       psat_ice = 6.1070 * exp(6150. *(1./273.16 - &
@@ -476,5 +476,5 @@
   !                                                              ! by Atm.Conten
   ! #??.        *max(0,sign(1.,qsatsg(ikl)-QaT_SV(ikl))))        ! NO Limitation
-                                                           ! ! of Downw.Flux
+                                                           ! of Downw.Flux
         END DO                                             !
       DO itEuBk=1,2                                        !
@@ -522,5 +522,5 @@
       ist__w=     1-ist__s                                 ! 1 if    H2O
       d__eta     =  eta_SV(ikl,isl)-etaNEW(ikl)            !
-      ! ! latent heat flux computation
+      ! latent heat flux computation
       HL___D(ikl)=( ist__s *ro_Wat *dz_dSV(0) & ! Soil Contrib.
             *(etaNEW(ikl)    -etaBAK(ikl)) / dt__SV & !
@@ -623,6 +623,6 @@
   ! #EU      TsisSV(ikl,isl)  = max(TaT_SV(ikl)-15.,TsisSV(ikl,isl))
 
-      ! !XF 18/11/2018 to avoid ST reaching 70°C!!
-      ! !It is an error compensation but does not work over tundra
+      !XF 18/11/2018 to avoid ST reaching 70°C!!
+      !It is an error compensation but does not work over tundra
 
       endif
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_zsn.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_zsn.f90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/sisvat_zsn.f90	(revision 5113)
@@ -140,5 +140,5 @@
   DO ikl=1,knonv
   DO   isn=1,isnoSV(ikl)-3 ! no agregation of 3 first snowlayers
-                           ! ! XF 04/07/2019
+                           ! XF 04/07/2019
 
       isno_n    =             isnoSV(ikl)-isn+1     ! Snow Normal.Profile
@@ -526,5 +526,5 @@
   DO ikl=1,knonv
     DO isn=1,isnoSV(ikl)-3 ! no agregation of 3 first snowlayers
-                           ! ! XF 04/07/2019
+                           ! XF 04/07/2019
 
       isno_n    =             isnoSV(ikl)-isn+1     ! Snow Normal.Profile
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/surf_inlandsis_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/surf_inlandsis_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/inlandsis/surf_inlandsis_mod.F90	(revision 5113)
@@ -783,5 +783,5 @@
         min_period = 1800. ! en secondes
         dalph_soil = 2.    ! rapport entre les epaisseurs de 2 couches succ.
-        ! !$OMP MASTER
+        !$OMP MASTER
         !     IF (is_mpi_root) THEN
         !        OPEN(99,file='soil.def',status='old',form='formatted',iostat=ierr)
@@ -795,5 +795,5 @@
         !        END IF
         !     ENDIF
-        ! !$OMP END MASTER
+        !$OMP END MASTER
         !     CALL bcast(min_period)
         !     CALL bcast(dalph_soil)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iophy.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iophy.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iophy.F90	(revision 5113)
@@ -4,6 +4,6 @@
 MODULE iophy
 
-! abd  REAL,private,allocatable,DIMENSION(:),save :: io_lat
-! abd  REAL,private,allocatable,DIMENSION(:),save :: io_lon
+! abd  REAL,PRIVATE,allocatable,DIMENSION(:),save :: io_lat
+! abd  REAL,PRIVATE,allocatable,DIMENSION(:),save :: io_lon
   REAL,ALLOCATABLE,DIMENSION(:),SAVE :: io_lat
   REAL,ALLOCATABLE,DIMENSION(:),SAVE :: io_lon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/iotd_ecrit.F90	(revision 5113)
@@ -24,5 +24,5 @@
       USE netcdf, ONLY: nf90_put_var,nf90_inq_varid,nf90_enddef,nf90_redef,nf90_sync,nf90_noerr,&
               nf90_float,nf90_def_var
-      implicit none
+      IMPLICIT NONE
 
 ! Commons
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/isccp_cloud_types.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/isccp_cloud_types.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/isccp_cloud_types.F90	(revision 5113)
@@ -38,42 +38,42 @@
 
   INTEGER seed(npoints) !  seed value for random number generator
-  ! !  ( see Numerical Recipes Chapter 7)
-  ! !  It is recommended that the seed is set
-  ! !  to a different value for each model
-  ! !  gridbox it is called on, as it is
-  ! !  possible that the choice of the samec
-  ! !  seed value every time may introduce some
-  ! !  statistical bias in the results, particularly
-  ! !  for low values of NCOL.
+  !  ( see Numerical Recipes Chapter 7)
+  !  It is recommended that the seed is set
+  !  to a different value for each model
+  !  gridbox it is called on, as it is
+  !  possible that the choice of the samec
+  !  seed value every time may introduce some
+  !  statistical bias in the results, particularly
+  !  for low values of NCOL.
 
   REAL pfull(npoints, nlev) !  pressure of full model levels (Pascals)
-  ! !  pfull(npoints,1)    is    top level of model
-  ! !  pfull(npoints,nlev) is bottom level of model
+  !  pfull(npoints,1)    is    top level of model
+  !  pfull(npoints,nlev) is bottom level of model
 
   REAL phalf(npoints, nlev+1) !  pressure of half model levels (Pascals)
-  ! !  phalf(npoints,1)    is    top       of model
-  ! !  phalf(npoints,nlev+1) is the surface pressure
+  !  phalf(npoints,1)    is    top       of model
+  !  phalf(npoints,nlev+1) is the surface pressure
 
   REAL qv(npoints, nlev) !  water vapor specific humidity (kg vapor/ kg air)
-  ! !         on full model levels
+  !         on full model levels
 
   REAL cc(npoints, nlev) !  input cloud cover in each model level (fraction)
-  ! !  NOTE:  This is the HORIZONTAL area of each
-  ! !         grid box covered by clouds
+  !  NOTE:  This is the HORIZONTAL area of each
+  !         grid box covered by clouds
 
   REAL conv(npoints, nlev) !  input convective cloud cover in each model level (fraction)
-  ! !  NOTE:  This is the HORIZONTAL area of each
-  ! !         grid box covered by convective clouds
+  !  NOTE:  This is the HORIZONTAL area of each
+  !         grid box covered by convective clouds
 
   REAL dtau_s(npoints, nlev) !  mean 0.67 micron optical depth of stratiform
-  ! !  clouds in each model level
-  ! !  NOTE:  this the cloud optical depth of only the
-  ! !         cloudy part of the grid box, it is not weighted
-  ! !         with the 0 cloud optical depth of the clear
-  ! !         part of the grid box
+  !  clouds in each model level
+  !  NOTE:  this the cloud optical depth of only the
+  !         cloudy part of the grid box, it is not weighted
+  !         with the 0 cloud optical depth of the clear
+  !         part of the grid box
 
   REAL dtau_c(npoints, nlev) !  mean 0.67 micron optical depth of convective
-  ! !  clouds in each
-  ! !  model level.  Same note applies as in dtau_s.
+  !  clouds in each
+  !  model level.  Same note applies as in dtau_s.
 
   INTEGER overlap !  overlap type
@@ -85,22 +85,22 @@
 
   INTEGER top_height !  1 = adjust top height using both a computed
-  ! !  infrared brightness temperature and the visible
-  ! !  optical depth to adjust cloud top pressure. Note
-  ! !  that this calculation is most appropriate to compare
-  ! !  to ISCCP data during sunlit hours.
-  ! !  2 = do not adjust top height, that is cloud top
-  ! !  pressure is the actual cloud top pressure
-  ! !  in the model
-  ! !  3 = adjust top height using only the computed
-  ! !  infrared brightness temperature. Note that this
-  ! !  calculation is most appropriate to compare to ISCCP
-  ! !  IR only algortihm (i.e. you can compare to nighttime
-  ! !  ISCCP data with this option)
+  !  infrared brightness temperature and the visible
+  !  optical depth to adjust cloud top pressure. Note
+  !  that this calculation is most appropriate to compare
+  !  to ISCCP data during sunlit hours.
+  !  2 = do not adjust top height, that is cloud top
+  !  pressure is the actual cloud top pressure
+  !  in the model
+  !  3 = adjust top height using only the computed
+  !  infrared brightness temperature. Note that this
+  !  calculation is most appropriate to compare to ISCCP
+  !  IR only algortihm (i.e. you can compare to nighttime
+  !  ISCCP data with this option)
 
   REAL tautab(0:255) !  ISCCP table for converting count value to
-  ! !  optical thickness
+  !  optical thickness
 
   INTEGER invtau(-20:45000) !  ISCCP table for converting optical thickness
-  ! !  to count value
+  !  to count value
 
   ! The following input variables are used only if top_height = 1 or
@@ -111,9 +111,9 @@
   REAL at(npoints, nlev) !  temperature in each model level (K)
   REAL dem_s(npoints, nlev) !  10.5 micron longwave emissivity of stratiform
-  ! !  clouds in each
-  ! !  model level.  Same note applies as in dtau_s.
+  !  clouds in each
+  !  model level.  Same note applies as in dtau_s.
   REAL dem_c(npoints, nlev) !  10.5 micron longwave emissivity of convective
-  ! !  clouds in each
-  ! !  model level.  Same note applies as in dtau_s.
+  !  clouds in each
+  !  model level.  Same note applies as in dtau_s.
   ! IM reg.dyn BEG
   REAL t1, t2
@@ -133,20 +133,20 @@
 
   REAL fq_isccp(npoints, 7, 7) !  the fraction of the model grid box covered by
-  ! !  each of the 49 ISCCP D level cloud types
+  !  each of the 49 ISCCP D level cloud types
 
   REAL totalcldarea(npoints) !  the fraction of model grid box columns
-  ! !  with cloud somewhere in them.  This should
-  ! !  equal the sum over all entries of fq_isccp
-
-
-  ! ! The following three means are averages over the cloudy areas only.  If
+  !  with cloud somewhere in them.  This should
+  !  equal the sum over all entries of fq_isccp
+
+
+  ! The following three means are averages over the cloudy areas only.  If
   ! no
-  ! ! clouds are in grid box all three quantities should equal zero.
+  ! clouds are in grid box all three quantities should equal zero.
 
   REAL meanptop(npoints) !  mean cloud top pressure (mb) - linear averaging
-  ! !  in cloud top pressure.
+  !  in cloud top pressure.
 
   REAL meantaucld(npoints) !  mean optical thickness
-  ! !  linear averaging in albedo performed.
+  !  linear averaging in albedo performed.
 
   REAL boxtau(npoints, ncol) !  optical thickness in each column
@@ -162,14 +162,14 @@
 
   REAL frac_out(npoints, ncol, nlev) ! boxes gridbox divided up into
-  ! ! Equivalent of BOX in original version, but
-  ! ! indexed by column then row, rather than
-  ! ! by row then column
+  ! Equivalent of BOX in original version, but
+  ! indexed by column then row, rather than
+  ! by row then column
 
   REAL tca(npoints, 0:nlev) ! total cloud cover in each model level (fraction)
-  ! ! with extra layer of zeroes on top
-  ! ! in this version this just contains the values input
-  ! ! from cc but with an extra level
+  ! with extra layer of zeroes on top
+  ! in this version this just contains the values input
+  ! from cc but with an extra level
   REAL cca(npoints, nlev) ! convective cloud cover in each model level (fraction)
-  ! ! from conv
+  ! from conv
 
   REAL threshold(npoints, ncol) ! pointer to position in gridbox
@@ -180,9 +180,9 @@
 
   REAL threshold_min(npoints, ncol) ! minimum value to define range in with new threshold
-  ! ! is chosen
+  ! is chosen
 
   REAL dem(npoints, ncol), bb(npoints) !  working variables for 10.5 micron longwave
-  ! !  emissivity in part of
-  ! !  gridbox under consideration
+  !  emissivity in part of
+  !  gridbox under consideration
 
   REAL ran(npoints) ! vector of random numbers
@@ -203,5 +203,5 @@
   INTEGER levmatch(npoints, ncol)
 
-  ! !variables needed for water vapor continuum absorption
+  !variables needed for water vapor continuum absorption
   REAL fluxtop_clrsky(npoints), trans_layers_above_clrsky(npoints)
   REAL taumin(npoints)
@@ -226,7 +226,7 @@
   REAL boxarea
   INTEGER debug ! set to non-zero value to print out inputs
-  ! ! with step debug
+  ! with step debug
   INTEGER debugcol ! set to non-zero value to print out column
-  ! ! decomposition with step debugcol
+  ! decomposition with step debugcol
 
   INTEGER index1(npoints), num1, jj
@@ -1410,5 +1410,5 @@
           ! end if
 
-          ! !determine cloud top pressure category
+          !determine cloud top pressure category
           ! if (    ptop(j,ibox) .gt. 0.
           ! &          .and.ptop(j,ibox) .lt. 180.) then
@@ -1442,5 +1442,5 @@
           ! iw(j) = int((w(j)-wmin)/pas_w) +1
           ! pctj(itau(j),ipres(j),iw(j))=.FALSE.
-          ! !update frequencies W500
+          !update frequencies W500
           ! if (pct_ocean(j)) then
           ! if (ipres(j) .gt. 0.and.itau(j) .gt. 0) then
@@ -1537,5 +1537,5 @@
   ! do j=1,npoints,debugcol
 
-  ! !produce character output
+  !produce character output
   ! do ilev=1,nlev
   ! do ibox=1,ncol
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_exchange_coeff.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_exchange_coeff.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_exchange_coeff.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module lmdz_atke_exchange_coeff
 
-implicit none
+IMPLICIT NONE
 
 contains 
@@ -59,5 +59,5 @@
 !!-------------------------------------------------------------------------------------------------------------
 
-implicit none
+IMPLICIT NONE
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_turbulence_ini.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_turbulence_ini.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_atke_turbulence_ini.F90	(revision 5113)
@@ -1,5 +1,5 @@
 MODULE lmdz_atke_turbulence_ini
 
-  implicit none
+  IMPLICIT NONE
 
   ! declaration of constants and parameters
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_ini.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_ini.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_ini.F90	(revision 5113)
@@ -1,5 +1,5 @@
 module lmdz_blowing_snow_ini
 
-implicit none
+IMPLICIT NONE
 
    real, save, protected :: RCPD, RV, RLSTT, RLVTT, RLMLT, RVTMP2, RTT,RD,RG, RPI
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_blowing_snow_sublim_sedim.F90	(revision 5113)
@@ -15,5 +15,5 @@
 USE lmdz_lscp_tools, ONLY: calc_qsat_ecmwf
 
-implicit none
+IMPLICIT NONE
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_call_atke.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_call_atke.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_call_atke.F90	(revision 5113)
@@ -3,5 +3,5 @@
 USE lmdz_atke_exchange_coeff, ONLY:  atke_compute_km_kh
 
-implicit none
+IMPLICIT NONE
 
 
@@ -18,5 +18,5 @@
 USE phys_local_var_mod, ONLY: tke_shear, tke_buoy, tke_trans
 
-implicit none
+IMPLICIT NONE
 
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_call_blowing_snow.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_call_blowing_snow.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_call_blowing_snow.F90	(revision 5113)
@@ -7,5 +7,5 @@
 
 use lmdz_blowing_snow_sublim_sedim, ONLY: blowing_snow_sublim_sedim
-implicit none
+IMPLICIT NONE
 
 !INPUT
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloud_optics_prop.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloud_optics_prop.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloud_optics_prop.F90	(revision 5113)
@@ -509,7 +509,7 @@
   ! --calculation of cloud properties with cloud overlap
   ! choix de l'hypothese de recouvrement nuageuse via radopt.h (IM, 19.07.2016)
-  ! !novlp=1: max-random
-  ! !novlp=2: maximum
-  ! !novlp=3: random
+  !novlp=1: max-random
+  !novlp=2: maximum
+  !novlp=3: random
 
 
@@ -659,5 +659,5 @@
     ENDDO ! loop over i
 
-    ! ! Convective and Stratiform Cloud Droplet Effective Radius (REFFCLWC
+    ! Convective and Stratiform Cloud Droplet Effective Radius (REFFCLWC
     ! REFFCLWS)
     DO i = 1, klon
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth_ini.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth_ini.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_cloudth_ini.F90	(revision 5113)
@@ -13,5 +13,5 @@
 
 use lmdz_ioipsl_getin_p, ONLY: getin_p
-implicit none
+IMPLICIT NONE
 integer, intent(in) :: iflag_cloudth_vert_in,iflag_ratqs_in
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_tools.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_tools.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_lscp_tools.F90	(revision 5113)
@@ -499,5 +499,5 @@
            END IF ! Enough TKE
 
-        END IF ! ! MPC temperature
+        END IF ! MPC temperature
 
      END IF ! cldfra
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_main.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_main.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_main.F90	(revision 5113)
@@ -18,5 +18,5 @@
 USE lmdz_ratqs_multi,   ONLY: ratqs_inter, ratqs_oro, ratqs_hetero, ratqs_tke
 
-implicit none
+IMPLICIT NONE
 
 !========================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_multi.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_multi.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_ratqs_multi.F90	(revision 5113)
@@ -34,5 +34,5 @@
 USE lmdz_thermcell_dq,  ONLY: thermcell_dq
 
-implicit none
+IMPLICIT NONE
 
 !========================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dq.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dq.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dq.F90	(revision 5113)
@@ -7,5 +7,5 @@
     USE lmdz_abort_physic, ONLY: abort_physic
 
-    implicit none
+    IMPLICIT NONE
 
     !=======================================================================
@@ -161,5 +161,5 @@
     USE lmdz_print_control, ONLY: prt_level
     USE lmdz_abort_physic, ONLY: abort_physic
-    implicit none
+    IMPLICIT NONE
 
     !=======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dtke.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dtke.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dtke.F90	(revision 5113)
@@ -5,5 +5,5 @@
              rg,pplev,tke)
       USE lmdz_print_control, ONLY: prt_level
-      implicit none
+      IMPLICIT NONE
 
 !=======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dv2.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dv2.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_dv2.F90	(revision 5113)
@@ -6,5 +6,5 @@
       ,u,v,du,dv,ua,va,lev_out)
       USE lmdz_print_control, ONLY: prt_level,lunout
-      implicit none
+      IMPLICIT NONE
 
 !=======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_main.F90	(revision 5113)
@@ -868,5 +868,5 @@
           therm_tke_max)                                ! out
     USE lmdz_thermcell_ini, ONLY: prt_level
-    implicit none
+    IMPLICIT NONE
 
     !=======================================================================
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_qsat.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_qsat.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/lmdz_thermcell_qsat.F90	(revision 5113)
@@ -3,5 +3,5 @@
 
 SUBROUTINE thermcell_qsat(klon,active,pplev,ztemp,zqta,zqsat)
-implicit none
+IMPLICIT NONE
 
   INCLUDE "YOMCST.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/o3_chem_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/o3_chem_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/o3_chem_m.F90	(revision 5113)
@@ -4,5 +4,5 @@
   IMPLICIT none
 
-  private o3_prod
+  PRIVATE o3_prod
 
 contains
@@ -17,5 +17,5 @@
     ! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)".
 
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     use dimphy, only: klon
     use regr_pr_comb_coefoz_m, only: c_Mob, a4_mass, a2, r_het_interm
@@ -116,5 +116,5 @@
 
     use regr_pr_comb_coefoz_m, only: a6_mass
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     use dimphy, only: klon
     use lmdz_grid_phy, only: nbp_lev
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/output_physiqex_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/output_physiqex_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/output_physiqex_mod.F90	(revision 5113)
@@ -19,5 +19,5 @@
 
 
-implicit none
+IMPLICIT NONE
 logical, intent(in) :: debut
 real, intent(in) :: pdtphys,zjulian
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/ozonecm_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/ozonecm_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/ozonecm_m.F90	(revision 5113)
@@ -22,5 +22,5 @@
 
     USE dimphy, only: klon, klev
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
 
     REAL, INTENT (IN) :: rlat(:) ! (klon)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/phyaqua_mod.F90	(revision 5113)
@@ -601,5 +601,5 @@
       ierr = nf90_put_att(nid, nf90_global, 'title', &
               'Fichier conditions aux limites')
-      ! !        ierr = nf90_def_dim (nid, "points_physiques", klon, ndim)
+      !        ierr = nf90_def_dim (nid, "points_physiques", klon, ndim)
       ierr = nf90_def_dim(nid, 'points_physiques', klon_glo, ndim)
       ierr = nf90_def_dim(nid, 'time', nf90_unlimited, ntim)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/physiq_mod.F90	(revision 5113)
@@ -23,5 +23,5 @@
     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
+    USE lmdz_assert, ONLY: assert
     USE change_srf_frac_mod
     USE conf_phys_m, ONLY: conf_phys
@@ -600,5 +600,5 @@
 
     !      REAL,allocatable,save :: run_off_lic_0(:)
-    ! !$OMP THREADPRIVATE(run_off_lic_0)
+    !$OMP THREADPRIVATE(run_off_lic_0)
     !ym      SAVE run_off_lic_0
     !KE43
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/press_coefoz_m.F90	(revision 5113)
@@ -2,5 +2,5 @@
 module press_coefoz_m
 
-  implicit none
+  IMPLICIT NONE
 
   real, allocatable, save:: plev(:)
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/radlwsw_m.F90	(revision 5113)
@@ -48,5 +48,5 @@
     ! Modules necessaires
     USE DIMPHY
-    USE assert_m, ONLY: assert
+    USE lmdz_assert, ONLY: assert
     USE infotrac_phy, ONLY: type_trac
     USE lmdz_write_field_phy
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/readaerosolstrato.F90	(revision 5113)
@@ -18,5 +18,5 @@
   USE lmdz_xios
   USE lmdz_abort_physic, ONLY: abort_physic
-  implicit none
+  IMPLICIT NONE
 
   include "YOMCST.h"
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_horiz_time_climoz_m.F90	(revision 5113)
@@ -57,5 +57,5 @@
     !     Attribute "missing_value" or "_FillValue" must be present in input file.
     !-------------------------------------------------------------------------------
-    USE assert_m, ONLY: assert
+    USE lmdz_assert, ONLY: assert
     USE cal_tools_m, ONLY: year_len, mid_month
     !!  USE control_mod,        ONLY: anneeref
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_lat_time_coefoz_m.F90	(revision 5113)
@@ -4,7 +4,7 @@
   ! Author: Lionel GUEZ
 
-  implicit none
-
-  private
+  IMPLICIT NONE
+
+  PRIVATE
   public regr_lat_time_coefoz
 
@@ -241,5 +241,5 @@
 
     use lmdz_grid_phy, ONLY: nbp_lat
-    use assert_eq_m, only: assert_eq
+    use lmdz_assert_eq, only: assert_eq
 
     use netcdf95, only: nf95_create, nf95_def_dim, nf95_def_var, &
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_comb_coefoz_m.F90	(revision 5113)
@@ -2,5 +2,5 @@
 module regr_pr_comb_coefoz_m
 
-  implicit none
+  IMPLICIT NONE
 
   ! The five module variables declared here are on the partial
@@ -73,5 +73,5 @@
     use netcdf95, only: nf95_open, nf95_close
     use netcdf, only: nf90_nowrite
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     use dimphy, only: klon
     use lmdz_phys_mpi_data, only: is_mpi_root
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_int_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_int_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_int_m.F90	(revision 5113)
@@ -4,5 +4,5 @@
   ! Author: Lionel GUEZ
 
-  implicit none
+  IMPLICIT NONE
 
 contains
@@ -26,5 +26,5 @@
     use dimphy, only: klon
     use netcdf95, only: nf95_inq_varid, nf95_get_var
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     use regr_lint_m, only: regr_lint
     use lmdz_phys_mpi_data, only: is_mpi_root
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_o3_m.F90	(revision 5113)
@@ -2,5 +2,5 @@
 module regr_pr_o3_m
 
-  implicit none
+  IMPLICIT NONE
 
 contains
@@ -27,5 +27,5 @@
     use netcdf95, only: nf95_open, nf95_close, nf95_inq_varid, nf95_get_var
     use netcdf, only:  nf90_nowrite
-    use assert_m, only: assert
+    use lmdz_assert, only: assert
     use regr_conserv_m, only: regr_conserv
     use press_coefoz_m, only: press_in_edg
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 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/regr_pr_time_av_m.F90	(revision 5113)
@@ -116,6 +116,6 @@
             nf95_inq_dimid, nf95_inquire_dimension, nf95_get_var
     USE netcdf, ONLY: nf90_inq_varid, nf90_noerr
-    USE assert_m, ONLY: assert
-    USE assert_eq_m, ONLY: assert_eq
+    USE lmdz_assert, ONLY: assert
+    USE lmdz_assert_eq, ONLY: assert_eq
     !!  USE comvert_mod,    ONLY: scaleheight
     USE interpolation, ONLY: locate
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/simu_airs.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/simu_airs.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/simu_airs.F90	(revision 5113)
@@ -4,5 +4,5 @@
   USE lmdz_abort_physic, ONLY: abort_physic
 
-  implicit none
+  IMPLICIT NONE
 
   REAL, PARAMETER :: tau_thresh = 0.05 ! seuil nuages detectables
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/stratosphere_mask.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/stratosphere_mask.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/stratosphere_mask.F90	(revision 5113)
@@ -111,5 +111,5 @@
 ! reference: Reichler, T., M. Dameris, and R. Sausen (GRL, 10.1029/2003GL018240, 2003)
 
-implicit none
+IMPLICIT NONE
 
 include "YOMCST.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tilft43.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tilft43.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tilft43.F90	(revision 5113)
@@ -13,12 +13,12 @@
 
   ! -- sb:
-  ! !      CPD=1005.7
-  ! !      CPV=1870.0
-  ! !      CL=4190.0
-  ! !      RV=461.5
-  ! !      RD=287.04
-  ! !      LV0=2.501E6
-  ! !      G=9.8
-  ! !      ROWL=1000.0
+  !      CPD=1005.7
+  !      CPV=1870.0
+  !      CL=4190.0
+  !      RV=461.5
+  !      RD=287.04
+  !      LV0=2.501E6
+  !      G=9.8
+  !      ROWL=1000.0
   ! ajouts:
   include "YOMCST.h"
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/tropopause_m.F90	(revision 5113)
@@ -12,6 +12,6 @@
 
 !-------------------------------------------------------------------------------
-  USE assert_m,     ONLY: assert
-  USE assert_eq_m,  ONLY: assert_eq
+  USE lmdz_assert,     ONLY: assert
+  USE lmdz_assert_eq,  ONLY: assert_eq
   USE dimphy,       ONLY: klon, klev
   USE lmdz_geometry, ONLY: latitude_deg, longitude_deg
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/undefSTD.F90	(revision 5113)
@@ -22,7 +22,7 @@
 
   ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
-  ! ! de la physique
+  ! de la physique
   ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
-  ! ! de la physique
+  ! de la physique
   ! nout=3 !var. mensuelle "NMC" moyennee toutes les ecrit_hf
 
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/vdif_kcay.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/vdif_kcay.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/vdif_kcay.F90	(revision 5113)
@@ -598,5 +598,5 @@
     ! PRINT*,'Q2q20 ',(q2(1,ilev),ilev=1,10)
     ! PRINT*,'Q2km0 ',(km(1,ilev),ilev=1,10)
-    ! ! C'est quoi ca qu'etait dans l'original???
+    ! C'est quoi ca qu'etait dans l'original???
     ! do igrid=1,ngrid
     ! q2(igrid,1)=10.
Index: LMDZ6/branches/Amaury_dev/libf/phylmd/yamada_ini_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmd/yamada_ini_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmd/yamada_ini_mod.F90	(revision 5113)
@@ -4,5 +4,5 @@
 ! peut on passer une fonction du module au code.
 
-implicit none
+IMPLICIT NONE
 
   LOGICAL :: new_yamada4
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv30_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv30_routines.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv30_routines.F90	(revision 5113)
@@ -355,5 +355,5 @@
   icbmax = 2
   DO i = 1, len
-    ! !        icbmax=max(icbmax,icb(i))
+    !        icbmax=max(icbmax,icb(i))
     IF (iflag(i)<7) icbmax = max(icbmax, icb(i)) ! sb Jun7th02
   END DO
@@ -489,5 +489,5 @@
 
   ! Re-compute icbsmax (icbsmax2):        !convect3
-  ! !convect3
+  !convect3
   icbsmax2 = 2 !convect3
   DO i = 1, len !convect3
@@ -1691,18 +1691,18 @@
   END DO
 
-  ! !      if(inb.lt.(nl-1))then
-  ! !         do 85 i=inb+1,nl-1
-  ! !            sig(i)=beta*sig(i)+2.*alpha*buoy(inb)*
-  ! !     1              abs(buoy(inb))
-  ! !            sig(i)=amax1(sig(i),0.0)
-  ! !            w0(i)=beta*w0(i)
-  ! !   85    continue
-  ! !      end if
-
-  ! !      do 87 i=1,icb
-  ! !         sig(i)=beta*sig(i)-2.*alpha*buoy(icb)*buoy(icb)
-  ! !         sig(i)=amax1(sig(i),0.0)
-  ! !         w0(i)=beta*w0(i)
-  ! !   87 continue
+  !      if(inb.lt.(nl-1))then
+  !         do 85 i=inb+1,nl-1
+  !            sig(i)=beta*sig(i)+2.*alpha*buoy(inb)*
+  !     1              abs(buoy(inb))
+  !            sig(i)=amax1(sig(i),0.0)
+  !            w0(i)=beta*w0(i)
+  !   85    continue
+  !      end if
+
+  !      do 87 i=1,icb
+  !         sig(i)=beta*sig(i)-2.*alpha*buoy(icb)*buoy(icb)
+  !         sig(i)=amax1(sig(i),0.0)
+  !         w0(i)=beta*w0(i)
+  !   87 continue
 
   ! -------------------------------------------------------------
@@ -1787,31 +1787,31 @@
 
 
-  ! !      cape=0.0
-  ! !      do 98 i=icb+1,inb
-  ! !         deltap = min(pbase,ph(i-1))-min(pbase,ph(i))
-  ! !         cape=cape+rrd*buoy(i-1)*deltap/p(i-1)
-  ! !         dcape=rrd*buoy(i-1)*deltap/p(i-1)
-  ! !         dlnp=deltap/p(i-1)
-  ! !         cape=amax1(0.0,cape)
-  ! !         sigold=sig(i)
-
-  ! !         dtmin=100.0
-  ! !         do 97 j=icb,i-1
-  ! !            dtmin=amin1(dtmin,buoy(j))
-  ! !   97    continue
-
-  ! !         sig(i)=beta*sig(i)+alpha*dtmin*abs(dtmin)
-  ! !         sig(i)=amax1(sig(i),0.0)
-  ! !         sig(i)=amin1(sig(i),0.01)
-  ! !         fac=amin1(((dtcrit-dtmin)/dtcrit),1.0)
-  ! !         w=(1.-beta)*fac*sqrt(cape)+beta*w0(i)
-  ! !         amu=0.5*(sig(i)+sigold)*w
-  ! !         m(i)=amu*0.007*p(i)*(ph(i)-ph(i+1))/tv(i)
-  ! !         w0(i)=w
-  ! !   98 continue
-  ! !      w0(icb)=0.5*w0(icb+1)
-  ! !      m(icb)=0.5*m(icb+1)*(ph(icb)-ph(icb+1))/(ph(icb+1)-ph(icb+2))
-  ! !      sig(icb)=sig(icb+1)
-  ! !      sig(icb-1)=sig(icb)
+  !      cape=0.0
+  !      do 98 i=icb+1,inb
+  !         deltap = min(pbase,ph(i-1))-min(pbase,ph(i))
+  !         cape=cape+rrd*buoy(i-1)*deltap/p(i-1)
+  !         dcape=rrd*buoy(i-1)*deltap/p(i-1)
+  !         dlnp=deltap/p(i-1)
+  !         cape=amax1(0.0,cape)
+  !         sigold=sig(i)
+
+  !         dtmin=100.0
+  !         do 97 j=icb,i-1
+  !            dtmin=amin1(dtmin,buoy(j))
+  !   97    continue
+
+  !         sig(i)=beta*sig(i)+alpha*dtmin*abs(dtmin)
+  !         sig(i)=amax1(sig(i),0.0)
+  !         sig(i)=amin1(sig(i),0.01)
+  !         fac=amin1(((dtcrit-dtmin)/dtcrit),1.0)
+  !         w=(1.-beta)*fac*sqrt(cape)+beta*w0(i)
+  !         amu=0.5*(sig(i)+sigold)*w
+  !         m(i)=amu*0.007*p(i)*(ph(i)-ph(i+1))/tv(i)
+  !         w0(i)=w
+  !   98 continue
+  !      w0(icb)=0.5*w0(icb+1)
+  !      m(icb)=0.5*m(icb+1)*(ph(icb)-ph(icb+1))/(ph(icb+1)-ph(icb+2))
+  !      sig(icb)=sig(icb+1)
+  !      sig(icb-1)=sig(icb)
 
 
@@ -2798,5 +2798,5 @@
   ! enddo
   ! enddo
-  ! ! RomP >>>
+  ! RomP >>>
   DO i = 1, nd
     DO il = 1, ncum
@@ -2805,5 +2805,5 @@
     END DO
   END DO
-  ! ! RomP <<<
+  ! RomP <<<
 
   ! ***  check whether ep(inb)=0, if so, skip precipitating    ***
@@ -3683,8 +3683,8 @@
   ! ***  NE PAS UTILISER POUR L'INSTANT ***
 
-  ! !      do il=1,ncum
-  ! !        wd(il)=betad*abs(mp(il,icb(il)))*0.01*rrd*t(il,icb(il))
-  ! !     :                                  /(sigd*p(il,icb(il)))
-  ! !      enddo
+  !      do il=1,ncum
+  !        wd(il)=betad*abs(mp(il,icb(il)))*0.01*rrd*t(il,icb(il))
+  !     :                                  /(sigd*p(il,icb(il)))
+  !      enddo
 
 
@@ -5922,5 +5922,5 @@
   ! *** diagnose the in-cloud mixing ratio   ***            ! cld
   ! ***           of condensed water         ***            ! cld
-  ! ! cld
+  ! cld
 
   DO i = 1, nd ! cld
@@ -5984,5 +5984,5 @@
 END SUBROUTINE cv30_yield
 
-! !RomP >>>
+!RomP >>>
 SUBROUTINE cv30_tracer(nloc, len, ncum, nd, na, ment, sij, da, phi, phi2, &
     d1a, dam, ep, vprecip, elij, clw, epmlmmm, eplamm, icb, inb)
@@ -6042,7 +6042,7 @@
       DO i = 1, ncum
         IF (k>=icb(i) .AND. k<=inb(i) .AND. j<=inb(i)) THEN
-          ! !jyg             epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j)
+          !jyg             epm(i,j,k)=1.-(1.-ep(i,j))*clw(i,j)/elij(i,k,j)
           epm(i, j, k) = 1. - (1.-ep(i,j))*clw(i, j)/max(elij(i,k,j), 1.E-16)
-          ! !
+          !
           epm(i, j, k) = max(epm(i,j,k), 0.0)
         END IF
@@ -6353,5 +6353,5 @@
                 ,cape,ep,hp,icb,inb,clw,nk,t,h,lv &
                 ,epmax_diag)
-        implicit none
+        IMPLICIT NONE
 
         ! On fait varier epmax en fn de la cape
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv3_routines.F90	(revision 5113)
@@ -7600,5 +7600,5 @@
                  , pbase, p, ph, tv, buoy, sig, w0,iflag &
                  , epmax_diag)
-        implicit none
+        IMPLICIT NONE
 
         ! On fait varier epmax en fn de la cape
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_routines.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_routines.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/cv_routines.F90	(revision 5113)
@@ -1631,5 +1631,5 @@
   ! *** diagnose the in-cloud mixing ratio   ***            ! cld
   ! ***           of condensed water         ***            ! cld
-  ! ! cld
+  ! cld
   DO ij = 1, ncum ! cld
     DO i = 1, nd ! cld
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_routines_mod.F90	(revision 5113)
@@ -29,5 +29,5 @@
 &       uncompress_ilp_zone
 #endif
-implicit none
+IMPLICIT NONE
 
 ! inputs
@@ -866,5 +866,5 @@
 USE isotopes_verif_mod
 #endif
-implicit none
+IMPLICIT NONE
 
 ! calcul de Rsol et Revap lors de l'évaporation de l'eau du sol
@@ -1315,5 +1315,5 @@
 SUBROUTINE calcul_kcin(Vsurf,KCIN)
 USE isotopes_mod, ONLY: tv0cin,tkcin0,tkcin1,tkcin2
-implicit none
+IMPLICIT NONE
 ! calcul de kcin en fonction de Vsurf
 
@@ -1348,5 +1348,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !C-------------------------------------------------------------------------
@@ -1475,5 +1475,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !C-------------------------------------------------------------------------
@@ -1538,5 +1538,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !C-------------------------------------------------------------------------
@@ -1646,5 +1646,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !C-------------------------------------------------------------------------
@@ -1817,5 +1817,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !C-------------------------------------------------------------------------
@@ -1895,5 +1895,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !C-------------------------------------------------------------------------
@@ -2034,5 +2034,5 @@
 USE isotopes_verif_mod
 #endif
-implicit none
+IMPLICIT NONE
 
 ! calcul de Rsol
@@ -2246,5 +2246,5 @@
 USE isotrac_mod, ONLY: index_iso
 #endif
- implicit none
+ IMPLICIT NONE
 ! inputs
 integer i
@@ -2454,5 +2454,5 @@
         USE isotopes_verif_mod
 #endif
-implicit none
+IMPLICIT NONE
 
 ! version véctorisée: sur les isotopes et sur les points de
@@ -4411,5 +4411,5 @@
 USE isotopes_verif_mod
 #endif
-implicit none
+IMPLICIT NONE
 
 ! idem que stewart_loop, mais pour la rrévap de la glace.
@@ -4568,5 +4568,5 @@
 USE isotopes_verif_mod
 #endif
-implicit none
+IMPLICIT NONE
 
 ! rrévap de la glace.
@@ -4809,5 +4809,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression des variables en tableaux spécifiques pour le
@@ -4967,5 +4967,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none 
+         IMPLICIT NONE
 
          ! des compressions des cas de calcul de J dans stewart_explicit
@@ -5012,5 +5012,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none 
+         IMPLICIT NONE
 
          ! decompression des outputs communs à tous les cas dans
@@ -5076,5 +5076,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -5151,5 +5151,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -5224,5 +5224,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -5293,5 +5293,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -5465,5 +5465,5 @@
 #endif
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -5594,5 +5594,5 @@
   USE isotopes_mod, ONLY: iso_eau, iso_HDO
 
-         implicit none
+         IMPLICIT NONE
 
         ! inputs         
@@ -5628,5 +5628,5 @@
 
   USE isotopes_mod, ONLY: iso_eau, iso_HDO
-         implicit none
+         IMPLICIT NONE
 
          integer ncas
@@ -5665,5 +5665,5 @@
 
   USE isotopes_mod, ONLY: iso_eau, iso_HDO
-         implicit none
+         IMPLICIT NONE
 
          integer ncas
@@ -5719,5 +5719,5 @@
 USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
         ! inputs         
@@ -5794,5 +5794,5 @@
   USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! version vectorisée en ncas. La vesrion _bak23fev2008 était
@@ -5817,5 +5817,5 @@
         
         ! **locals
-        ! ! nombre max d'itération dans integrale rieman
+        ! nombre max d'itération dans integrale rieman
         integer j
         integer il,ixt,k
@@ -6002,5 +6002,5 @@
 #endif
 #endif
-      implicit none
+      IMPLICIT NONE
 
       !*inputs et outputs
@@ -6503,5 +6503,5 @@
 #endif  
               endif !if (T(il,i).ge.ztglace_kelvin) then
-          endif ! !if (Eqi_prime.lt.0.0) then
+          endif !if (Eqi_prime.lt.0.0) then
        endif !if (i.le.inb(il) .and. lwork(il)) then 
       enddo  !do il=1,ncum 
@@ -7567,5 +7567,5 @@
 USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -7934,5 +7934,5 @@
 USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -8138,5 +8138,5 @@
 USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -8276,5 +8276,5 @@
 USE isotrac_mod, only: ridicule_trac
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -8810,5 +8810,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
         ! inputs
@@ -9211,5 +9211,5 @@
 #endif
 #endif
-      implicit none
+      IMPLICIT NONE
 
       !*inputs et outputs
@@ -9786,5 +9786,5 @@
 !#endif  
               endif !if (T(il,i).ge.ztglace_kelvin) then
-          endif ! !if (Eqi_prime.lt.0.0) then
+          endif !if (Eqi_prime.lt.0.0) then
        endif !if (i.le.inb(il) .and. lwork(il)) then 
       enddo  !do il=1,ncum 
@@ -10902,5 +10902,5 @@
 USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -11054,5 +11054,5 @@
 #endif
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -11648,5 +11648,5 @@
 USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
         ! inputs
@@ -12076,5 +12076,5 @@
     USE isotopes_verif_mod
 #endif 
-        implicit none
+        IMPLICIT NONE
 
         ! version vectorisée de condiso_liq_ice
@@ -12313,5 +12313,5 @@
 #endif
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! version vectorisée de condiso_liq_ice
@@ -12768,5 +12768,5 @@
 USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! on s'interresse à l'isotope ixt.
@@ -12940,5 +12940,5 @@
 
     USE isotopes_mod, ONLY: pxtmelt,pxtice
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -12971,5 +12971,5 @@
     USE isotrac_mod, ONLY: izone_cont,index_zone,index_iso
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! gestion de la neige: on precipte dessus, sublime, effondre,
@@ -13541,5 +13541,5 @@
 &       bassin_map
 #endif
-        implicit none
+        IMPLICIT NONE
 
  include "YOETHF.h"
@@ -13864,5 +13864,5 @@
 &       bassin_map
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -14116,5 +14116,5 @@
 &       bassin_map
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -14456,5 +14456,5 @@
 #endif
 
-        implicit none
+        IMPLICIT NONE
 
  include "YOETHF.h"
@@ -15867,5 +15867,5 @@
   USE isotopes_verif_mod
 #endif
-       implicit none   
+       IMPLICIT NONE
 
       ! equivalent de phyetat0 pour les isotopes  
@@ -16044,5 +16044,5 @@
   USE isotrac_mod, ONLY: index_iso,index_zone,izone_init
 #endif
-        implicit none
+        IMPLICIT NONE
 
  include "dimsoil.h"
@@ -16633,5 +16633,5 @@
         USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 ! input
@@ -17952,5 +17952,5 @@
         USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !     Arguments
@@ -18080,5 +18080,5 @@
       use phys_cal_mod ! pour le calendrier
       use isotopes_mod, only: nessai, day_nucl, month_nucl, year_nucl
-      implicit none
+      IMPLICIT NONE
 
       ! Arguments
@@ -18152,5 +18152,5 @@
         USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !     Arguments
@@ -18230,5 +18230,5 @@
         USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
  include "dimensions.h"  ! pour avoir iim et jjm
@@ -18372,5 +18372,5 @@
         USE isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
 !     Arguments
@@ -18516,5 +18516,5 @@
     USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! version vectorisée de condiso_liq_ice
@@ -18646,5 +18646,5 @@
 USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! version vectorisée de condiso_liq_ice
@@ -18780,5 +18780,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -18840,5 +18840,5 @@
 USE isotopes_verif_mod
 #endif
-implicit none
+IMPLICIT NONE
 
 
@@ -18892,5 +18892,5 @@
 
 use infotrac_phy, ONLY: nqtot,nqo,ivap,iliq,isol,iqIsoPha,ntraciso=>ntiso
-implicit none
+IMPLICIT NONE
 
 ! inputs
@@ -18932,5 +18932,5 @@
 
 use infotrac_phy, ONLY: nqtot,nqo,ivap,iliq,isol,iqIsoPha,ntraciso=>ntiso
-implicit none
+IMPLICIT NONE
 
 ! inputs
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_verif_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_verif_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotopes_verif_mod.F90	(revision 5113)
@@ -9,5 +9,5 @@
 !#endif
 USE infotrac_phy, ONLY: ntraciso=>ntiso, niso, itZonIso, nzone
-implicit none
+IMPLICIT NONE
 save
 
@@ -95,5 +95,5 @@
         use lmdz_ioipsl_getin_p, ONLY: getin_p
         use isotopes_mod, ONLY: iso_O17, iso_O18, iso_HDO
-        implicit none
+        IMPLICIT NONE
 
         write(*,*) 'iso_verif_init 99: entree'
@@ -137,5 +137,5 @@
 
       SUBROUTINE iso_verif_egalite(a,b,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! compare a et b. Si pas egal à errmax près, on affiche message
         ! d'erreur et stoppe
@@ -166,5 +166,5 @@
 
         function iso_verif_egalite_nostop(a,b,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! compare a et b. Si pas egal à errmax près, on affiche message
         ! d'erreur et stoppe
@@ -197,5 +197,5 @@
         SUBROUTINE iso_verif_aberrant(R,err_msg)
         use isotopes_mod, ONLY: ridicule, iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -227,5 +227,5 @@
         SUBROUTINE iso_verif_aberrant_encadre(R,err_msg)
         use isotopes_mod, ONLY: ridicule, iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -262,5 +262,5 @@
         SUBROUTINE iso_verif_aberrant_choix(xt,q,qmin,deltaDmax,err_msg)
         use isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -296,5 +296,5 @@
         function iso_verif_aberrant_nostop(R,err_msg)
         use isotopes_mod, ONLY: ridicule,iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -327,5 +327,5 @@
         function iso_verif_aberrant_enc_nostop(R,err_msg)
         use isotopes_mod, ONLY: ridicule,iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -362,5 +362,5 @@
 
         use isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -423,5 +423,5 @@
                   qmin,deltaDmax,err_msg)
         use isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! si le rapprot iso R est plus grand que deltaDlim, on affiche message
         ! d'erreur et stoppe
@@ -467,5 +467,5 @@
 
         SUBROUTINE iso_verif_aberrant_o17(R17,R18,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si l'O17-excess est aberrant, on affiche un message
         ! d'erreur et stoppe
@@ -500,5 +500,5 @@
         function iso_verif_aberrant_o17_nostop(R17,R18,err_msg)
         USE isotopes_mod, ONLY: tnat,iso_O17,iso_O18
-        implicit none
+        IMPLICIT NONE
         ! si l'O17-excess est aberrant, on affiche un message
         ! d'erreur et renvoit 1
@@ -541,5 +541,5 @@
 
         SUBROUTINE iso_verif_noNaN(x,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x est NaN, on affiche message
         ! d'erreur et stoppe
@@ -566,5 +566,5 @@
 
         function iso_verif_noNaN_nostop(x,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x est NaN, on affiche message
         ! d'erreur et return 1 si erreur
@@ -596,5 +596,5 @@
 
         SUBROUTINE iso_verif_noNaN_vect2D(x,err_msg,ni,n,m)
-        implicit none
+        IMPLICIT NONE
         ! si x est NaN, on affiche message
         ! d'erreur et return 1 si erreur
@@ -635,5 +635,5 @@
 
         SUBROUTINE iso_verif_noNaN_vect1D(x,err_msg,ni,n)
-        implicit none
+        IMPLICIT NONE
         ! si x est NaN, on affiche message
         ! d'erreur et return 1 si erreur
@@ -674,5 +674,5 @@
         !************************
         SUBROUTINE iso_verif_egalite_choix(a,b,err_msg,erabs,errel)
-        implicit none
+        IMPLICIT NONE
         ! compare a et b. Si pas egal, on affiche message
         ! d'erreur et stoppe
@@ -703,5 +703,5 @@
         function iso_verif_egalite_choix_nostop &
                  (a,b,err_msg,erabs,errel)
-        implicit none
+        IMPLICIT NONE
         ! compare a et b. Si pas egal, on affiche message
         ! d'erreur et stoppe
@@ -758,5 +758,5 @@
         SUBROUTINE iso_verif_positif(x,err_msg)
         use isotopes_mod, ONLY: ridicule
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
         ! si très limite, on le met à 0.
@@ -786,5 +786,5 @@
         SUBROUTINE iso_verif_positif_vect(x,n,err_msg)
         use isotopes_mod, ONLY: ridicule
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
 
@@ -816,5 +816,5 @@
 
         SUBROUTINE iso_verif_positif_choix_vect(x,n,ridic,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
 
@@ -848,5 +848,5 @@
 !******************
         SUBROUTINE iso_verif_positif_strict(x,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
         ! si très limite, on le met à 0.
@@ -869,5 +869,5 @@
 
         function iso_verif_positif_strict_nostop(x,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
         ! si très limite, on le met à 0.
@@ -896,5 +896,5 @@
 
         SUBROUTINE iso_verif_positif_choix(x,ridic,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
         ! si très limite, on le met à 0.
@@ -925,5 +925,5 @@
         function iso_verif_positif_nostop(x,err_msg)
         use isotopes_mod, ONLY: ridicule
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
         ! si très limite, on le met à 0.
@@ -955,5 +955,5 @@
         !******************
         function iso_verif_positif_choix_nostop(x,ridic,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! si x<0, on plante.
         ! si très limite, on le met à 0.
@@ -992,5 +992,5 @@
         
         SUBROUTINE iso_verif_O18_aberrant(Rd,Ro,err_msg)
-        implicit none
+        IMPLICIT NONE
 
         ! vérifie que:
@@ -1012,5 +1012,5 @@
         function iso_verif_O18_aberrant_nostop(Rd,Ro,err_msg)
         USE isotopes_mod, ONLY: tnat, iso_HDO, iso_O18
-        implicit none
+        IMPLICIT NONE
 
         ! vérifie que:
@@ -1060,5 +1060,5 @@
         function deltaD(R)
         USE isotopes_mod, ONLY: tnat,iso_HDO
-        implicit none
+        IMPLICIT NONE
         real R,deltaD
 
@@ -1076,5 +1076,5 @@
         function deltaO(R)
         USE isotopes_mod, ONLY: tnat,iso_O18
-        implicit none
+        IMPLICIT NONE
         real R,deltaO
         
@@ -1091,5 +1091,5 @@
         function dexcess(RD,RO)
         USE isotopes_mod, ONLY: tnat,iso_O18,iso_HDO
-        implicit none
+        IMPLICIT NONE
         real RD,RO,deltaD,deltaO,dexcess
         
@@ -1108,5 +1108,5 @@
         function delta_all(R,ixt)
         USE isotopes_mod, ONLY: tnat
-        implicit none
+        IMPLICIT NONE
         real R,delta_all
         integer ixt 
@@ -1119,5 +1119,5 @@
         function delta_to_R(delta,ixt)
         USE isotopes_mod, ONLY: tnat
-        implicit none
+        IMPLICIT NONE
         real delta,delta_to_R
         integer ixt
@@ -1130,5 +1130,5 @@
         function o17excess(R17,R18)
         USE isotopes_mod, ONLY: tnat,iso_O18,iso_O17
-        implicit none
+        IMPLICIT NONE
         real R17,R18,o17excess
         
@@ -1151,5 +1151,5 @@
         
         USE isotopes_mod, ONLY: iso_eau
-          implicit none
+          IMPLICIT NONE
 
           ! inputs 
@@ -1202,5 +1202,5 @@
 
         USE isotopes_mod, ONLY: iso_eau
-        implicit none
+        IMPLICIT NONE
 
         ! inputs 
@@ -1242,5 +1242,5 @@
                  a,b,err_msg,n,m,errmax,errmaxrel)
 
-          implicit none
+          IMPLICIT NONE
 
           ! inputs 
@@ -1285,5 +1285,5 @@
                  xt,q,err_msg,ni,n,m)
         use isotopes_mod, ONLY: ridicule,tnat,iso_HDO
-          implicit none
+          IMPLICIT NONE
 
           ! inputs   
@@ -1333,5 +1333,5 @@
 
         use isotopes_mod, ONLY: ridicule,tnat,iso_HDO
-          implicit none
+          IMPLICIT NONE
 
           ! inputs   
@@ -1386,5 +1386,5 @@
 
         use isotopes_mod, ONLY: ridicule,tnat,iso_HDO
-          implicit none
+          IMPLICIT NONE
 
           ! inputs   
@@ -1436,5 +1436,5 @@
 
         use isotopes_mod, ONLY: ridicule,tnat,iso_HDO
-          implicit none
+          IMPLICIT NONE
 
 
@@ -1486,5 +1486,5 @@
 
         use isotopes_mod, ONLY: ridicule,tnat,iso_HDO,iso_O18
-          implicit none
+          IMPLICIT NONE
 
           ! inputs   
@@ -1538,5 +1538,5 @@
         SUBROUTINE select_dim23_from4D(n1,n2,n3,n4, &
                 var,vec,i1,i4)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1561,5 +1561,5 @@
         SUBROUTINE select_dim4_from4D(ntime,nlev,nlat,nlon, &
                 var,vec,itime,ilev,ilat)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1581,5 +1581,5 @@
         SUBROUTINE select_dim5_from5D(n1,n2,n3,n4,n5, &
                 var,vec,i1,i2,i3,i4)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1601,5 +1601,5 @@
         SUBROUTINE select_dim3_from3D(ntime,nlat,nlon, &
                 var,vec,itime,ilat)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1621,5 +1621,5 @@
         SUBROUTINE select_dim23_from3D(n1,n2,n3, &
                 var,vec,i1)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1642,5 +1642,5 @@
         SUBROUTINE putinto_dim23_from4D(n1,n2,n3,n4, &
                 var,vec,i1,i4)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1664,5 +1664,5 @@
         SUBROUTINE putinto_dim12_from4D(n1,n2,n3,n4, &
                 var,vec,i3,i4)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1685,5 +1685,5 @@
         SUBROUTINE putinto_dim23_from3D(n1,n2,n3, &
                 var,vec,i1)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1707,5 +1707,5 @@
 
         SUBROUTINE iso_verif_noNaN_par2D(x,err_msg,ni,n,m,ib,ie)
-        implicit none
+        IMPLICIT NONE
         ! si x est NaN, on affiche message
         ! d'erreur et return 1 si erreur
@@ -1750,5 +1750,5 @@
 
         use isotopes_mod, ONLY: ridicule,tnat,iso_HDO
-          implicit none
+          IMPLICIT NONE
 
           ! inputs   
@@ -1800,5 +1800,5 @@
         
         USE isotopes_mod, ONLY: iso_eau
-          implicit none
+          IMPLICIT NONE
 
           ! inputs 
@@ -1845,5 +1845,5 @@
              errmax,errmaxrel,ridicule_trac,deltalimtrac)
         use isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -1896,5 +1896,5 @@
              errmax,errmaxrel,ridicule_trac,deltalimtrac)
         USE isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -1941,5 +1941,5 @@
         function iso_verif_tracpos_choix_nostop(x,err_msg,seuil)
         use isotopes_mod, only: isoName
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1970,5 +1970,5 @@
         function iso_verif_traceur_noNaN_nostop(x,err_msg)
         use isotopes_mod, only: isoName
-        implicit none
+        IMPLICIT NONE
 
         ! on vérifie juste que pas NaN
@@ -2003,5 +2003,5 @@
         use isotopes_mod, ONLY: ridicule,isoName
         ! on vérifie juste bilan de masse
-        implicit none
+        IMPLICIT NONE
         
         ! inputs
@@ -2060,5 +2060,5 @@
         use isotrac_mod, only: strtrac
         ! on vérifie juste deltaD
-        implicit none
+        IMPLICIT NONE
                 
         ! inputs
@@ -2140,5 +2140,5 @@
       SUBROUTINE iso_verif_traceur(x,err_msg)
         use isotrac_mod, only: ridicule_trac
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2168,5 +2168,5 @@
         use isotrac_mod, only: ridicule_trac
 
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2200,5 +2200,5 @@
         use isotrac_mod, only: ridicule_trac
 
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2232,5 +2232,5 @@
                  i1,i2,err_msg)
         use isotrac_mod, only: ridicule_trac
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2262,5 +2262,5 @@
         SUBROUTINE iso_verif_traceur_vect(x,n,m,err_msg)
         USE isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2297,5 +2297,5 @@
         SUBROUTINE iso_verif_tracnps_vect(x,n,m,err_msg)
         USE isotopes_mod, ONLY: iso_HDO
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2329,5 +2329,5 @@
 
         SUBROUTINE iso_verif_traceur_noNaN_vect(x,n,m,err_msg)
-        implicit none
+        IMPLICIT NONE
        
        ! inputs
@@ -2373,5 +2373,5 @@
                   errmax,errmaxrel)
         use isotopes_mod, only: isoName
-        implicit none
+        IMPLICIT NONE
        
         ! inputs
@@ -2413,5 +2413,5 @@
         use isotopes_mod, only: iso_HDO,iso_eau
         use isotrac_mod, only: strtrac
-        implicit none
+        IMPLICIT NONE
        
         ! inputs
@@ -2453,5 +2453,5 @@
 
         SUBROUTINE iso_verif_tracpos_vect(x,n,m,err_msg,seuil)
-        implicit none
+        IMPLICIT NONE
 
        ! inputs
@@ -2496,5 +2496,5 @@
         use isotrac_mod, only: ridicule_trac
 
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2520,5 +2520,5 @@
 
         SUBROUTINE iso_verif_tracpos_choix(x,err_msg,seuil)
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2545,5 +2545,5 @@
         SUBROUTINE iso_verif_traceur_choix(x,err_msg, &
              errmax,errmaxrel,ridicule_trac_loc,deltalimtrac)
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2569,5 +2569,5 @@
         use isotrac_mod, only: ridicule_trac
         !use isotopes_verif, only: errmax,errmaxrel,deltalimtrac
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2595,5 +2595,5 @@
 
       SUBROUTINE iso_verif_traceur_justmass(x,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! on vérifie que noNaN et masse
 
@@ -2623,5 +2623,5 @@
 
         function iso_verif_traceur_jm_nostop(x,err_msg)
-        implicit none
+        IMPLICIT NONE
         ! on vérifie que noNaN et masse
 
@@ -2657,5 +2657,5 @@
         USE isotopes_mod, ONLY: tnat,iso_eau, ridicule,iso_HDO
         use isotrac_mod, only: option_traceurs,nzone_temp
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -2716,5 +2716,5 @@
         USE isotopes_mod, ONLY: tnat,iso_eau,iso_HDO,ridicule
         use isotrac_mod, only: option_traceurs,nzone_temp
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotrac_routines_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotrac_routines_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/isotrac_routines_mod.F90	(revision 5113)
@@ -20,5 +20,5 @@
     USE isotopes_mod, ONLY: ridicule,iso_eau
 
-         implicit none 
+         IMPLICIT NONE
 
          ! decompression des outputs communs à tous les cas dans
@@ -70,5 +70,5 @@
 #endif
 
-         implicit none 
+         IMPLICIT NONE
 
          ! decompression des outputs communs à tous les cas dans
@@ -235,5 +235,5 @@
 #endif
 
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -323,5 +323,5 @@
 #endif
 
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -409,5 +409,5 @@
     USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -476,5 +476,5 @@
     USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -644,5 +644,5 @@
     USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
          ! compression dans le cas condensation_facftmr
@@ -804,5 +804,5 @@
 #endif
 
-         implicit none
+         IMPLICIT NONE
 
         ! inputs         
@@ -891,5 +891,5 @@
         USE isotopes_verif_mod
 #endif
-         implicit none
+         IMPLICIT NONE
 
         ! inputs         
@@ -978,5 +978,5 @@
 #endif
 
-         implicit none
+         IMPLICIT NONE
 
         ! inputs         
@@ -1042,5 +1042,5 @@
 #endif
 USE isotrac_mod, only: izone_revap
-      implicit none
+      IMPLICIT NONE
 
       ! ajoute xtrevap_tag (evaps des différents traceurs d'isotopes)
@@ -1114,5 +1114,5 @@
 &       bassin_MerArabie,bassin_BengalGolf,bassin_SouthIndian, &
 &       bassin_tropics,bassin_midlats,bassin_HighLats
-      implicit none
+      IMPLICIT NONE
       ! répond true si lat,lon se trouve dans le bassin numéroté bassin
 
@@ -1320,5 +1320,5 @@
         use isotopes_verif_mod
 #endif
-      implicit none
+      IMPLICIT NONE
 
       ! inputs
@@ -1378,5 +1378,5 @@
         use isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
         real presnivs(klev)
 
@@ -1403,5 +1403,5 @@
 #endif
 
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1424,5 +1424,5 @@
 
         function is_in_rectangle(x,y,x1,y1,x2,y2)
-        implicit none
+        IMPLICIT NONE
         ! inputs 
         real x,y
@@ -1451,5 +1451,5 @@
 
         function is_in_triangle(x,y,x1,y1,x2,y2,x3,y3)
-        implicit none
+        IMPLICIT NONE
         ! inputs
         real x,y
@@ -1494,5 +1494,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inout
@@ -1578,5 +1578,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! recolorise selon la température minimum, mais les tags de
@@ -1633,5 +1633,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! recolorise selon la température minimum, mais les tags de
@@ -1697,5 +1697,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! SUBROUTINE écrite à la base pour tagguer 3 boites AMMA.
@@ -1750,5 +1750,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! SUBROUTINE écrite pour l'option de taggage 20
@@ -1798,5 +1798,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! SUBROUTINE écrite pour l'option de taggage 20
@@ -1867,5 +1867,5 @@
 #endif
         USE isotrac_mod, only: izone_aej,izone_mousson,izone_harmattan
-        implicit none
+        IMPLICIT NONE
 
         real lat(klon),lon(klon)
@@ -1920,5 +1920,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         real lat(klon),lon(klon)
@@ -1954,5 +1954,5 @@
         function index_zone_lat(lat)
         use isotrac_mod, only: lattag_min,dlattag,nzone_lat
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1974,5 +1974,5 @@
         function index_zone_pres(pres)
         use isotrac_mod, only: nzone_pres,zone_pres
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -1992,5 +1992,5 @@
 
         function find_index(pres,nzone_pres,zone_pres)
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -2029,5 +2029,5 @@
         function index_zone_latpres(lat,pres)
         use isotrac_mod, only: nzone_lat
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -2058,5 +2058,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! on recolorise la vapeur résiduelle selon la température de condensation
@@ -2263,5 +2263,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -2288,5 +2288,5 @@
         USE dimphy, only: klon,klev
         use isotrac_mod, only: option_traceurs,boite_map
-        implicit none
+        IMPLICIT NONE
 
         ! inputs
@@ -2319,5 +2319,5 @@
         !use isotrac_mod, only: ntraceurs_zone=>nzone
         USE infotrac_phy, ONLY: ntraceurs_zone=>nzone
-        implicit none
+        IMPLICIT NONE
         
         ! version vectrisée de iso_verif_traceur_jbidouille
@@ -2382,5 +2382,5 @@
         SUBROUTINE iso_verif_traceur_jbidouille(x)
         USE isotopes_mod, ONLY: bidouille_anti_divergence,iso_eau,ridicule
-        implicit none
+        IMPLICIT NONE
         
         ! on réajuste aussi les valeurs des traceurs pour la
@@ -2424,5 +2424,5 @@
 !        use isotopes_verif_mod, only: iso_verif_traceur_pbidouille
 !#endif
-        implicit none
+        IMPLICIT NONE
         
         ! on réajuste les valeurs des traceurs pour qu'il n'y ai pas de
@@ -2497,5 +2497,5 @@
         USE isotopes_verif_mod
 #endif
-        implicit none
+        IMPLICIT NONE
        
        ! inputs
@@ -2577,5 +2577,5 @@
         use isotopes_verif_mod
 #endif        
-        implicit none
+        IMPLICIT NONE
         
         ! même but que iso_verif_traceur_jbid_pos, mais n'induit
@@ -2644,5 +2644,5 @@
         SUBROUTINE iso_verif_traceur_jbid_vect1D(x,n)
         USE isotopes_mod, ONLY: bidouille_anti_divergence,iso_eau,ridicule
-        implicit none
+        IMPLICIT NONE
         
         ! version vectrisée de iso_verif_traceur_jbidouille
@@ -2687,5 +2687,5 @@
         SUBROUTINE iso_verif_traceur_pbidouille(x,err_msg)
         use isotopes_verif_mod
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2714,5 +2714,5 @@
         use isotrac_mod, only: ridicule_trac
         use isotopes_verif_mod
-        implicit none
+        IMPLICIT NONE
         ! vérifier des choses sur les traceurs
         ! * toutes les zones donne t l'istope total
@@ -2775,5 +2775,5 @@
         use isotopes_mod, ONLY: iso_HDO,bidouille_anti_divergence
         use isotopes_verif_mod
-        implicit none
+        IMPLICIT NONE
        
        ! inputs
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyaqua_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyaqua_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyaqua_mod.F90	(revision 5113)
@@ -630,5 +630,5 @@
       ierr = nf90_put_att(nid, nf90_global, 'title', &
         'Fichier conditions aux limites')
-      ! !        ierr = nf90_def_dim (nid, "points_physiques", klon, ndim)
+      !        ierr = nf90_def_dim (nid, "points_physiques", klon, ndim)
       ierr = nf90_def_dim(nid, 'points_physiques', klon_glo, ndim)
       ierr = nf90_def_dim(nid, 'time', nf90_unlimited, ntim)
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyredem.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyredem.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/phyredem.F90	(revision 5113)
@@ -509,5 +509,5 @@
       !USE phyredem, ONLY: put_field_srf1
 
-        implicit none
+        IMPLICIT NONE
 
         ! equivalent isotopique de phyredem
Index: LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5112)
+++ LMDZ6/branches/Amaury_dev/libf/phylmdiso/physiq_mod.F90	(revision 5113)
@@ -24,5 +24,5 @@
     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
+    USE lmdz_assert, only: assert
     USE change_srf_frac_mod
     USE conf_phys_m, only: conf_phys
@@ -679,5 +679,5 @@
 
     !      REAL,allocatable,save :: run_off_lic_0(:)
-    ! !$OMP THREADPRIVATE(run_off_lic_0)
+    !$OMP THREADPRIVATE(run_off_lic_0)
     !ym      SAVE run_off_lic_0
     !KE43
