Index: trunk/LMDZ.COMMON/libf/dyn3d_common/disvert.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/disvert.F90	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/disvert.F90	(revision 1391)
@@ -27,5 +27,8 @@
 !-------------------------------------------------------------------------------
 ! Read    in "comvert.h":
-! pa                         !--- PURE PRESSURE COORDINATE FOR P<pa (in Pascals)
+
+! pa !--- vertical coordinate is close to a PRESSURE COORDINATE FOR P
+! < 0.3 * pa (relative variation of p on a model level is < 0.1 %)
+
 ! preff                      !--- REFERENCE PRESSURE                 (101325 Pa)
 ! Written in "comvert.h":
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/grid_atob.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/grid_atob.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/grid_atob.F	(revision 1391)
@@ -1,4 +1,4 @@
 !
-! $Id: grid_atob.F 1403 2010-07-01 09:02:53Z fairhead $
+! $Id: grid_atob.F 2197 2015-02-09 07:13:05Z emillour $
 !
       SUBROUTINE grille_m(imdep, jmdep, xdata, ydata, entree,
@@ -52,4 +52,5 @@
       REAL zzmin
 #endif
+      include "iniprint.h"
 c
       IF (imar.GT.2200 .OR. jmar.GT.1100) THEN
@@ -118,5 +119,5 @@
          sortie(i,j) = sortie(i,j) / number(i,j)
          ELSE
-         PRINT*, 'probleme,i,j=', i,j
+         if (prt_level >= 1) PRINT*, 'probleme,i,j=', i,j
 ccc         CALL ABORT_GCM("", "", 1)
          CALL dist_sphe(x(i),y(j),xdata,ydata,imdep,jmdep,distans)
@@ -135,5 +136,6 @@
          j_proche = (ij_proche-1)/imdep + 1
          i_proche = ij_proche - (j_proche-1)*imdep
-         PRINT*, "solution:", ij_proche, i_proche, j_proche
+         if (prt_level >= 1) PRINT*, "solution:", ij_proche, i_proche,
+     $        j_proche
          sortie(i,j) = entree(i_proche,j_proche)
          ENDIF
@@ -258,5 +260,5 @@
             PRINT*, 'Probleme grave,i,j,indx,indy=',
      .              i,j,indx(i,j),indy(i,j)
-            CALL abort_gcm("", "", 1)
+            call abort_gcm("", "", 1)
          ENDIF
       ENDDO
@@ -449,4 +451,5 @@
       REAL zzmin
 #endif
+      include "iniprint.h"
 c
       IF (imar.GT.400 .OR. jmar.GT.400) THEN
@@ -512,5 +515,5 @@
             sortie(i,j) = EXP(sortie(i,j))
          ELSE
-            PRINT*, 'probleme,i,j=', i,j
+            if (prt_level >= 1) PRINT*, 'probleme,i,j=', i,j
 ccc            CALL ABORT_GCM("", "", 1)
          CALL dist_sphe(x(i),y(j),xdata,ydata,imdep,jmdep,distans)
@@ -529,5 +532,6 @@
          j_proche = (ij_proche-1)/imdep + 1
          i_proche = ij_proche - (j_proche-1)*imdep
-         PRINT*, "solution:", ij_proche, i_proche, j_proche
+         if (prt_level >= 1) PRINT*, "solution:", ij_proche, i_proche,
+     $        j_proche
          sortie(i,j) = entree(i_proche,j_proche)
          ENDIF
@@ -574,4 +578,5 @@
       REAL zzmin
 #endif
+      include "iniprint.h"
 c
       IF (imar.GT.400 .OR. jmar.GT.400) THEN
@@ -641,5 +646,5 @@
            ENDIF
          ELSE
-           PRINT*, 'probleme,i,j=', i,j
+           if (prt_level >= 1) PRINT*, 'probleme,i,j=', i,j
 ccc           CALL ABORT_GCM("", "", 1)
          CALL dist_sphe(x(i),y(j),xdata,ydata,imdep,jmdep,distans)
@@ -658,5 +663,6 @@
          j_proche = (ij_proche-1)/imdep + 1
          i_proche = ij_proche - (j_proche-1)*imdep
-         PRINT*, "solution:", ij_proche, i_proche, j_proche
+         if (prt_level >= 1) PRINT*, "solution:", ij_proche, i_proche,
+     $        j_proche
          IF (NINT(glace01(i_proche,j_proche)).EQ.1 ) THEN
             frac_ice(i,j) = 1.0
@@ -710,4 +716,6 @@
       INTEGER i_proche, j_proche, ij_proche
 c
+      include "iniprint.h"
+
       IF (immod.GT.2200 .OR. jmmod.GT.1100) THEN
          PRINT*, 'immod ou jmmod trop grand', immod, jmmod
@@ -874,5 +882,5 @@
          rugs(i,j) = EXP(rugs(i,j))
          ELSE
-         PRINT*, 'probleme,i,j=', i,j
+         if (prt_level >= 1) PRINT*, 'probleme,i,j=', i,j
 ccc         CALL ABORT_GCM("", "", 1)
          CALL dist_sphe(xmod(i),ymod(j),xtmp,ytmp,imtmp,jmtmp,distans)
@@ -891,5 +899,6 @@
          j_proche = (ij_proche-1)/imtmp + 1
          i_proche = ij_proche - (j_proche-1)*imtmp
-         PRINT*, "solution:", ij_proche, i_proche, j_proche
+         if (prt_level >= 1) PRINT*, "solution:", ij_proche, i_proche,
+     $        j_proche
          rugs(i,j) = LOG(MAX(0.001_8,cham2tmp(i_proche,j_proche)))
          ENDIF
@@ -927,4 +936,5 @@
 c
       SUBROUTINE dist_sphe(rf_lon,rf_lat,rlon,rlat,im,jm,distance)
+      IMPLICIT NONE
 c
 c Auteur: Laurent Li (le 30 decembre 1996)
@@ -949,4 +959,5 @@
       REAL radius
       PARAMETER (radius=6371229.)
+      INTEGER i,j
 c
       pi = 4.0 * ATAN(1.0)
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/infotrac.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/infotrac.F90	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/infotrac.F90	(revision 1391)
@@ -5,4 +5,6 @@
 ! nqtot : total number of tracers and higher order of moment, water vapor and liquid included
   INTEGER, SAVE :: nqtot
+! CR: add number of tracers for water (for Earth model only!!)
+  INTEGER, SAVE :: nqo
 
 ! nbtr : number of tracers not including higher order of moment or water vapor or liquid
@@ -27,4 +29,5 @@
 
   CHARACTER(len=4),SAVE :: type_trac
+  CHARACTER(len=8),DIMENSION(:),ALLOCATABLE, SAVE :: solsym
  
 CONTAINS
@@ -60,5 +63,4 @@
 
     CHARACTER(len=15), ALLOCATABLE, DIMENSION(:) :: tnom_0  ! tracer short name
-    CHARACTER(len=8), ALLOCATABLE, DIMENSION(:) :: tracnam ! name from INCA
     CHARACTER(len=3), DIMENSION(30) :: descrq
     CHARACTER(len=1), DIMENSION(3)  :: txts
@@ -94,5 +96,5 @@
        WRITE(lunout,*) 'You have choosen to couple with INCA chemestry model : type_trac=', &
             type_trac,' config_inca=',config_inca
-       IF (config_inca/='aero' .AND. config_inca/='chem') THEN
+       IF (config_inca/='aero' .AND. config_inca/='aeNP' .AND. config_inca/='chem') THEN
           WRITE(lunout,*) 'Incoherence between type_trac and config_inca. Model stops. Modify run.def'
           CALL abort_gcm('infotrac_init','Incoherence between type_trac and config_inca',1)
@@ -179,5 +181,5 @@
 !
     ALLOCATE(tnom_0(nqtrue), hadv(nqtrue), vadv(nqtrue))
-    ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), tracnam(nbtr))
+    ALLOCATE(conv_flg(nbtr), pbl_flg(nbtr), solsym(nbtr))
     conv_flg(:) = 1 ! convection activated for all tracers
     pbl_flg(:)  = 1 ! boundary layer activated for all tracers
@@ -240,4 +242,11 @@
        END IF
        
+!CR: nombre de traceurs de l eau
+       if (tnom_0(3) == 'H2Oi') then
+          nqo=3
+       else
+          nqo=2
+       endif
+
        WRITE(lunout,*) trim(modname),': Valeur de traceur.def :'
        WRITE(lunout,*) trim(modname),': nombre de traceurs ',nqtrue
@@ -262,6 +271,7 @@
 
        DO iq =3,nqtrue
-          tnom_0(iq)=tracnam(iq-2)
+          tnom_0(iq)=solsym(iq-2)
        END DO
+       nqo = 2
 
      END IF ! type_trac
@@ -430,5 +440,5 @@
 !
     DEALLOCATE(tnom_0, hadv, vadv)
-    DEALLOCATE(tracnam)
+
 
   END SUBROUTINE infotrac_init
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/iniacademic.F90
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/iniacademic.F90	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/iniacademic.F90	(revision 1391)
@@ -4,12 +4,12 @@
 SUBROUTINE iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
 
-  USE filtreg_mod
+  USE filtreg_mod, ONLY: inifilr
   USE infotrac, ONLY : nqtot
   USE control_mod, ONLY: day_step,planet_type
 #ifdef CPP_IOIPSL
-  USE IOIPSL
+  USE IOIPSL, ONLY: getin
 #else
   ! if not using IOIPSL, we still need to use (a local version of) getin
-  USE ioipsl_getincom
+  USE ioipsl_getincom, ONLY: getin
 #endif
   USE Write_Field
@@ -40,13 +40,14 @@
   !   ----------
 
-  real time_0
-
-  !   variables dynamiques
-  REAL vcov(ip1jm,llm),ucov(ip1jmp1,llm) ! vents covariants
-  REAL teta(ip1jmp1,llm)                 ! temperature potentielle
-  REAL q(ip1jmp1,llm,nqtot)               ! champs advectes
-  REAL ps(ip1jmp1)                       ! pression  au sol
-  REAL masse(ip1jmp1,llm)                ! masse d'air
-  REAL phis(ip1jmp1)                     ! geopotentiel au sol
+  REAL,INTENT(OUT) :: time_0
+
+  !   fields
+  REAL,INTENT(OUT) :: vcov(ip1jm,llm) ! meridional covariant wind
+  REAL,INTENT(OUT) :: ucov(ip1jmp1,llm) ! zonal covariant wind
+  REAL,INTENT(OUT) :: teta(ip1jmp1,llm) ! potential temperature (K)
+  REAL,INTENT(OUT) :: q(ip1jmp1,llm,nqtot) ! advected tracers (.../kg_of_air)
+  REAL,INTENT(OUT) :: ps(ip1jmp1) ! surface pressure (Pa)
+  REAL,INTENT(OUT) :: masse(ip1jmp1,llm) ! air mass in grid cell (kg)
+  REAL,INTENT(OUT) :: phis(ip1jmp1) ! surface geopotential
 
   !   Local:
@@ -76,4 +77,14 @@
   character(len=80) :: abort_message
 
+
+  ! Sanity check: verify that options selected by user are not incompatible
+  if ((iflag_phys==1).and. .not. read_start) then
+    write(lunout,*) trim(modname)," error: if read_start is set to ", &
+    " false then iflag_phys should not be 1"
+    write(lunout,*) "You most likely want an aquaplanet initialisation", &
+    " (iflag_phys >= 100)"
+    call abort_gcm(modname,"incompatible iflag_phys==1 and read_start==.false.",1)
+  endif
+  
   !-----------------------------------------------------------------------
   ! 1. Initializations for Earth-like case
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/interpre.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/interpre.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/interpre.F	(revision 1391)
@@ -29,5 +29,5 @@
       real   masse(iip1,jjp1,llm) 
       real   massebx(iip1,jjp1,llm),masseby(iip1,jjm,llm)      
-      real   w(iip1,jjp1,llm+1)
+      real   w(iip1,jjp1,llm)
       real   fluxwppm(iim,jjp1,llm)
       real   pbaru(iip1,jjp1,llm )
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/juldate.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/juldate.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/juldate.F	(revision 1391)
@@ -1,4 +1,4 @@
 !
-! $Id: juldate.F 1403 2010-07-01 09:02:53Z fairhead $
+! $Id: juldate.F 2197 2015-02-09 07:13:05Z emillour $
 !
 	subroutine juldate(ian,imoi,ijou,oh,om,os,tjd,tjdsec)
@@ -7,5 +7,11 @@
 c	En entree:an,mois,jour,heure,min.,sec.
 c	En sortie:tjd
-	implicit real (a-h,o-z)
+        IMPLICIT NONE
+        INTEGER,INTENT(IN) :: ian,imoi,ijou,oh,om,os
+        REAL,INTENT(OUT) :: tjd,tjdsec
+        
+        REAL frac,year,rmon,cf,a,b
+        INTEGER ojou
+        
 	frac=((os/60.+om)/60.+oh)/24.
 	ojou=dble(ijou)+frac
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/massbar.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/massbar.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/massbar.F	(revision 1391)
@@ -3,4 +3,5 @@
 !
       SUBROUTINE massbar(  masse, massebx, masseby )
+      IMPLICIT NONE
 c
 c **********************************************************************
@@ -24,4 +25,5 @@
       REAL    masse( ip1jmp1,llm ), massebx( ip1jmp1,llm )  ,
      *      masseby(   ip1jm,llm )
+      INTEGER ij,l
 c
 c
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/massbarxy.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/massbarxy.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/massbarxy.F	(revision 1391)
@@ -3,4 +3,5 @@
 !
       SUBROUTINE massbarxy(  masse, massebxy )
+      IMPLICIT NONE
 c
 c **********************************************************************
@@ -23,4 +24,5 @@
 c
        REAL  masse( ip1jmp1,llm ), massebxy( ip1jm,llm )
+       INTEGER ij,l
 c
 
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/ppm3d.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/ppm3d.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/ppm3d.F	(revision 1391)
@@ -1,4 +1,4 @@
 !
-! $Id: ppm3d.F 1403 2010-07-01 09:02:53Z fairhead $
+! $Id: ppm3d.F 2197 2015-02-09 07:13:05Z emillour $
 !
 
@@ -66,5 +66,5 @@
      &                  JNP,j1,NLAY,AP,BP,PT,AE,fill,dum,Umax)
 
-c      implicit none
+      implicit none
 
 c     rajout de déclarations
@@ -270,5 +270,5 @@
 C     User modifiable parameters
 C
-      parameter (Jmax = 361, kmax = 150)
+      integer,parameter :: Jmax = 361, kmax = 150
 C
 C ****6***0*********0*********0*********0*********0*********0**********72
@@ -299,7 +299,13 @@
       data NDT0, NSTEP /0, 0/
       data cross /.true./
+      REAL DTDY, DTDY5, RCAP
+      INTEGER JS0, JN0, IML, JMR, IMJM
       SAVE DTDY, DTDY5, RCAP, JS0, JN0, IML,
      &     DTDX, DTDX5, ACOSP, COSP, COSE, DAP,DBK
 C
+      INTEGER NDT0, NSTEP, j2, k,j,i,ic,l,JS,JN,IMH
+      INTEGER IU,IIU,JT,iad,jad,krd
+      REAL r23,r3,PI,DL,DP,DT,CR1,MAXDT,ZTC,D5
+      REAL sum1,sum2,ru
             
       JMR = JNP -1
@@ -756,6 +762,8 @@
       subroutine FZPPM(IMR,JNP,NLAY,j1,DQ,WZ,P,DC,DQDT,AR,AL,A6,
      &                 flux,wk1,wk2,wz2,delp,KORD)
-      parameter ( kmax = 150 )
-      parameter ( R23 = 2./3., R3 = 1./3.)
+      implicit none
+      integer,parameter :: kmax = 150 
+      real,parameter :: R23 = 2./3., R3 = 1./3.
+      integer IMR,JNP,NLAY,J1,KORD
       real WZ(IMR,JNP,NLAY),P(IMR,JNP,NLAY),DC(IMR,JNP,NLAY),
      &     wk1(IMR,*),delp(IMR,JNP,NLAY),DQ(IMR,JNP,NLAY),
@@ -764,4 +772,6 @@
       real AR(IMR,*),AL(IMR,*),A6(IMR,*),flux(IMR,*),wk2(IMR,*),
      &     wz2(IMR,*)
+      integer JMR,IMJM,NLAYM1,LMT,K,I,J
+      real c0,c1,c2,tmp,qmax,qmin,a,b,fct,a1,a2,cm,cp
 C
       JMR = JNP - 1
@@ -922,7 +932,14 @@
       subroutine xtp(IMR,JNP,IML,j1,j2,JN,JS,PU,DQ,Q,UC,
      &               fx1,xmass,IORD)
+      implicit none
+      integer IMR,JNP,IML,j1,j2,JN,JS,IORD
+      real PU,DQ,Q,UC,fx1,xmass
+      real dc,qtmp
+      integer ISAVE(IMR)
       dimension UC(IMR,*),DC(-IML:IMR+IML+1),xmass(IMR,JNP)
      &    ,fx1(IMR+1),DQ(IMR,JNP),qtmp(-IML:IMR+1+IML)
-      dimension PU(IMR,JNP),Q(IMR,JNP),ISAVE(IMR)
+      dimension PU(IMR,JNP),Q(IMR,JNP)
+      integer jvan,j1vl,j2vl,j,i,iu,itmp,ist,imp
+      real rut
 C
       IMP = IMR + 1
@@ -1031,8 +1048,11 @@
 C
       subroutine fxppm(IMR,IML,UT,P,DC,flux,IORD)
-      parameter ( R3 = 1./3., R23 = 2./3. )
+      implicit none
+      integer IMR,IML,IORD
+      real UT,P,DC,flux
+      real,parameter ::  R3 = 1./3., R23 = 2./3. 
       DIMENSION UT(*),flux(*),P(-IML:IMR+IML+1),DC(-IML:IMR+IML+1)
-      DIMENSION AR(0:IMR),AL(0:IMR),A6(0:IMR)
-      integer LMT 
+      REAL :: AR(0:IMR),AL(0:IMR),A6(0:IMR)
+      integer LMT,IMP,JLVL,i
 c      logical first
 c      data first /.true./
@@ -1088,6 +1108,10 @@
 C
       subroutine xmist(IMR,IML,P,DC)
-      parameter( R24 = 1./24.)
-      dimension P(-IML:IMR+1+IML),DC(-IML:IMR+1+IML)
+      implicit none
+      integer IMR,IML
+      real,parameter :: R24 = 1./24.
+      real :: P(-IML:IMR+1+IML),DC(-IML:IMR+1+IML)
+      integer :: i
+      real :: tmp,pmax,pmin
 C
       do 10  i=1,IMR
@@ -1101,8 +1125,13 @@
       subroutine ytp(IMR,JNP,j1,j2,acosp,RCAP,DQ,P,VC,DC2
      &              ,ymass,fx,A6,AR,AL,JORD)
+      implicit none
+      integer :: IMR,JNP,j1,j2,JORD
+      real :: acosp,RCAP,DQ,P,VC,DC2,ymass,fx,A6,AR,AL
       dimension P(IMR,JNP),VC(IMR,JNP),ymass(IMR,JNP)
      &       ,DC2(IMR,JNP),DQ(IMR,JNP),acosp(JNP)
 C Work array
       DIMENSION fx(IMR,JNP),AR(IMR,JNP),AL(IMR,JNP),A6(IMR,JNP)
+      integer :: JMR,len,i,jt,j
+      real :: sum1,sum2
 C
       JMR = JNP - 1
@@ -1161,6 +1190,10 @@
 C
       subroutine  ymist(IMR,JNP,j1,P,DC,ID)
-      parameter ( R24 = 1./24. )
-      dimension P(IMR,JNP),DC(IMR,JNP)
+      implicit none
+      integer :: IMR,JNP,j1,ID
+      real,parameter :: R24 = 1./24.
+      real :: P(IMR,JNP),DC(IMR,JNP)
+      integer :: iimh,jmr,ijm3,imh,i
+      real :: pmax,pmin,tmp
 C
       IMH = IMR / 2
@@ -1239,9 +1272,12 @@
 C
       subroutine fyppm(VC,P,DC,flux,IMR,JNP,j1,j2,A6,AR,AL,JORD)
-      parameter ( R3 = 1./3., R23 = 2./3. )
+      implicit none
+      integer IMR,JNP,j1,j2,JORD
+      real,parameter :: R3 = 1./3., R23 = 2./3.
       real VC(IMR,*),flux(IMR,*),P(IMR,*),DC(IMR,*)
 C Local work arrays.
       real AR(IMR,JNP),AL(IMR,JNP),A6(IMR,JNP)
-      integer LMT
+      integer LMT,i
+      integer IMH,JMR,j11,IMJM1,len
 c      logical first
 C      data first /.true./
@@ -1315,6 +1351,10 @@
 C
 	subroutine yadv(IMR,JNP,j1,j2,p,VA,ady,wk,IAD)
+        implicit none
+        integer IMR,JNP,j1,j2,IAD
 	REAL p(IMR,JNP),ady(IMR,JNP),VA(IMR,JNP)
         REAL WK(IMR,-1:JNP+2)
+        INTEGER JMR,IMH,i,j,jp
+        REAL rv,a1,b1,sum1,sum2
 C
 	JMR = JNP-1
@@ -1401,5 +1441,9 @@
 C
 	subroutine xadv(IMR,JNP,j1,j2,p,UA,JS,JN,IML,adx,IAD)
+        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)
+        INTEGER JMR,j,i,ip,iu,iiu
+        REAL ru,a1,b1
 C
 	JMR = JNP-1
@@ -1489,4 +1533,5 @@
 C
       subroutine lmtppm(DC,A6,AR,AL,P,IM,LMT)
+      implicit none
 C
 C A6 =  CURVATURE OF THE TEST PARABOLA
@@ -1503,6 +1548,9 @@
 C LMT = 2: POSITIVE-DEFINITE CONSTRAINT
 C
-      parameter ( R12 = 1./12. )
-      dimension A6(IM),AR(IM),AL(IM),P(IM),DC(IM)
+      real,parameter :: R12 = 1./12. 
+      real :: A6(IM),AR(IM),AL(IM),P(IM),DC(IM)
+      integer :: IM,LMT
+      INTEGER i
+      REAL da1,da2,a6da,fmin
 C
       if(LMT.eq.0) then
@@ -1564,5 +1612,8 @@
 C
       subroutine A2C(U,V,IMR,JMR,j1,j2,CRX,CRY,dtdx5,DTDY5)
-      dimension U(IMR,*),V(IMR,*),CRX(IMR,*),CRY(IMR,*),DTDX5(*)
+      implicit none
+      integer IMR,JMR,j1,j2
+      real :: U(IMR,*),V(IMR,*),CRX(IMR,*),CRY(IMR,*),DTDX5(*),DTDY5
+      integer i,j
 C
       do 35 j=j1,j2
@@ -1579,5 +1630,9 @@
 C
       subroutine cosa(cosp,cose,JNP,PI,DP)
-      dimension cosp(*),cose(*)
+      implicit none
+      integer JNP
+      real :: cosp(*),cose(*),PI,DP
+      integer JMR,j,jeq
+      real ph5
       JMR = JNP-1
       do 55 j=2,JNP
@@ -1606,5 +1661,9 @@
 C
       subroutine cosc(cosp,cose,JNP,PI,DP)
-      dimension cosp(*),cose(*)
+      implicit none
+      integer JNP
+      real :: cosp(*),cose(*),PI,DP
+      real phi
+      integer j
 C
       phi = -0.5*PI
@@ -1628,7 +1687,10 @@
      &                   cross,IC,NSTEP)
 C
-      parameter( tiny = 1.E-60 )
-      DIMENSION Q(IMR,JNP,NLAY),qtmp(IMR,JNP),cosp(*),acosp(*)
+      real,parameter :: tiny = 1.E-60 
+      INTEGER :: IMR,JNP,NLAY,j1,j2,IC,NSTEP
+      REAL :: Q(IMR,JNP,NLAY),qtmp(IMR,JNP),cosp(*),acosp(*)
       logical cross
+      INTEGER :: NLAYM1,len,ip,L,icr,ipy,ipx,i
+      real :: qup,qly,dup,sum
 C
       NLAYM1 = NLAY-1
@@ -1730,5 +1792,9 @@
 C
       subroutine filcr(q,IMR,JNP,j1,j2,cosp,acosp,icr,tiny)
-      dimension q(IMR,*),cosp(*),acosp(*)
+      implicit none
+      integer :: IMR,JNP,j1,j2,icr
+      real :: q(IMR,*),cosp(*),acosp(*),tiny
+      integer :: i,j
+      real :: dq,dn,d0,d1,ds,d2
       icr = 0
       do 65 j=j1+1,j2-1
@@ -1828,5 +1894,9 @@
 C
       subroutine filns(q,IMR,JNP,j1,j2,cosp,acosp,ipy,tiny)
-      dimension q(IMR,*),cosp(*),acosp(*)
+      implicit none
+      integer :: IMR,JNP,j1,j2,ipy
+      real :: q(IMR,*),cosp(*),acosp(*),tiny
+      real :: DP,CAP1,dq,dn,d0,d1,ds,d2
+      INTEGER :: i,j
 c      logical first
 c      data first /.true./
@@ -1910,5 +1980,9 @@
 C
       subroutine filew(q,qtmp,IMR,JNP,j1,j2,ipx,tiny)
-      dimension q(IMR,*),qtmp(JNP,IMR)
+      implicit none
+      integer :: IMR,JNP,j1,j2,ipx
+      real :: q(IMR,*),qtmp(JNP,IMR),tiny
+      integer :: i,j
+      real :: d0,d1,d2
 C
       ipx = 0
@@ -1983,8 +2057,11 @@
 C
       subroutine zflip(q,im,km,nc)
+      implicit none
 C This routine flip the array q (in the vertical).
+      integer :: im,km,nc
       real q(im,km,nc)
 C local dynamic array
       real qtmp(im,km)
+      integer IC,k,i
 C
       do 4000 IC = 1, nc
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/ran1.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/ran1.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/ran1.F	(revision 1391)
@@ -1,13 +1,17 @@
 !
-! $Id: ran1.F 1403 2010-07-01 09:02:53Z fairhead $
+! $Id: ran1.F 2197 2015-02-09 07:13:05Z emillour $
 !
       FUNCTION RAN1(IDUM)
-      DIMENSION R(97)
-      save r
-      save iff,ix1,ix2,ix3
-      PARAMETER (M1=259200,IA1=7141,IC1=54773,RM1=3.8580247E-6)
-      PARAMETER (M2=134456,IA2=8121,IC2=28411,RM2=7.4373773E-6)
-      PARAMETER (M3=243000,IA3=4561,IC3=51349)
-      DATA IFF /0/
+      IMPLICIT NONE
+      REAL RAN1
+      REAL,SAVE :: R(97)
+      REAL,PARAMETER :: RM1=3.8580247E-6,RM2=7.4373773E-6
+      INTEGER,SAVE :: IFF=0
+      integer,save :: ix1,ix2,ix3
+      INTEGER,PARAMETER :: M1=259200,IA1=7141,IC1=54773
+      INTEGER,PARAMETER :: M2=134456,IA2=8121,IC2=28411
+      INTEGER,PARAMETER :: M3=243000,IA3=4561,IC3=51349
+      INTEGER :: IDUM,J
+
       IF (IDUM.LT.0.OR.IFF.EQ.0) THEN
         IFF=1
Index: trunk/LMDZ.COMMON/libf/dyn3d_common/sortvarc.F
===================================================================
--- trunk/LMDZ.COMMON/libf/dyn3d_common/sortvarc.F	(revision 1345)
+++ trunk/LMDZ.COMMON/libf/dyn3d_common/sortvarc.F	(revision 1391)
@@ -1,4 +1,4 @@
 !
-! $Id: sortvarc.F 1403 2010-07-01 09:02:53Z fairhead $
+! $Id: sortvarc.F 2083 2014-07-09 14:43:31Z emillour $
 !
       SUBROUTINE sortvarc
@@ -6,6 +6,7 @@
      $ vcov )
 
-      use control_mod,only:resetvarc 
+      USE control_mod, ONLY: resetvarc 
       IMPLICIT NONE
+
 
 c=======================================================================
@@ -24,25 +25,30 @@
 c   -------------
 
-#include "dimensions.h"
-#include "paramet.h"
-#include "comconst.h"
-#include "comvert.h"
-#include "comgeom.h"
-#include "ener.h"
-#include "logic.h"
-#include "temps.h"
+      INCLUDE "dimensions.h"
+      INCLUDE "paramet.h"
+      INCLUDE "comconst.h"
+      INCLUDE "comvert.h"
+      INCLUDE "comgeom.h"
+      INCLUDE "ener.h"
+      INCLUDE "logic.h"
+      INCLUDE "temps.h"
+      INCLUDE "iniprint.h"
 
 c   Arguments:
 c   ----------
 
-      INTEGER itau
-      REAL ucov(ip1jmp1,llm),teta(ip1jmp1,llm),masse(ip1jmp1,llm)
-      REAL vcov(ip1jm,llm)
-      REAL ps(ip1jmp1),phis(ip1jmp1)
-      REAL vorpot(ip1jm,llm)
-      REAL phi(ip1jmp1,llm),bern(ip1jmp1,llm)
-      REAL dp(ip1jmp1)
-      REAL time
-      REAL pk(ip1jmp1,llm)
+      INTEGER,INTENT(IN) :: itau
+      REAL,INTENT(IN) :: ucov(ip1jmp1,llm)
+      REAL,INTENT(IN) :: teta(ip1jmp1,llm)
+      REAL,INTENT(IN) :: masse(ip1jmp1,llm)
+      REAL,INTENT(IN) :: vcov(ip1jm,llm)
+      REAL,INTENT(IN) :: ps(ip1jmp1)
+      REAL,INTENT(IN) :: phis(ip1jmp1)
+      REAL,INTENT(IN) :: vorpot(ip1jm,llm)
+      REAL,INTENT(IN) :: phi(ip1jmp1,llm)
+      REAL,INTENT(IN) :: bern(ip1jmp1,llm)
+      REAL,INTENT(IN) :: dp(ip1jmp1)
+      REAL,INTENT(IN) :: time
+      REAL,INTENT(IN) :: pk(ip1jmp1,llm)
 
 c   Local:
@@ -57,8 +63,6 @@
 
       REAL       SSUM
-
-      logical  firstcal
-      data     firstcal/.true./
-      save     firstcal
+      LOGICAL,SAVE :: firstcal=.true.
+      CHARACTER(LEN=*),PARAMETER :: modname="sortvarc"
 
 c-----------------------------------------------------------------------
@@ -143,8 +147,9 @@
 
       IF (firstcal.and.resetvarc) then
-         PRINT 3500, itau, rjour, heure,time
-         PRINT*,'WARNING!!! On recalcule les valeurs initiales de :'
-         PRINT*,'ptot,rmsdpdt,etot,ztot,stot,rmsv,ang'
-         PRINT *, ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
+         WRITE(lunout,3500) itau, rjour, heure, time
+         WRITE(lunout,*) trim(modname),
+     &     ' WARNING!!! Recomputing initial values of : '
+         WRITE(lunout,*) 'ptot,rmsdpdt,etot,ztot,stot,rmsv,ang'
+         WRITE(lunout,*) ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
          etot0 = etot
          ptot0 = ptot
@@ -185,8 +190,6 @@
       firstcal = .false.
 
-      PRINT 3500, itau, rjour, heure, time
-      PRINT 4000, ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
-
-      RETURN
+      WRITE(lunout,3500) itau, rjour, heure, time
+      WRITE(lunout,4000) ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
 
 3500   FORMAT(10("*"),4x,'pas',i7,5x,'jour',f9.0,'heure',f5.1,4x 
