Index: /LMDZ5/trunk/libf/dyn3d/conf_gcm.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3d/conf_gcm.F	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3d/conf_gcm.F	(revision 2083)
@@ -150,4 +150,11 @@
       raz_date = 0
       CALL getin('raz_date', raz_date)
+
+!Config  Key  = resetvarc
+!Config  Desc = Reinit des variables de controle
+!Config  Def  = n
+!Config  Help = Reinit des variables de controle
+      resetvarc = .false.
+      CALL getin('resetvarc',resetvarc)
 
 !Config  Key  = nday
Index: /LMDZ5/trunk/libf/dyn3d/iniacademic.F90
===================================================================
--- /LMDZ5/trunk/libf/dyn3d/iniacademic.F90	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3d/iniacademic.F90	(revision 2083)
@@ -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.(read_start==.false.)) 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: /LMDZ5/trunk/libf/dyn3d_common/caldyn0.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3d_common/caldyn0.F	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3d_common/caldyn0.F	(revision 2083)
@@ -6,4 +6,5 @@
      $  phi,w,pbaru,pbarv,time )
 
+      USE control_mod, ONLY: resetvarc 
       IMPLICIT NONE
 
@@ -83,5 +84,6 @@
       ENDDO
 
-        CALL sortvarc0
+      resetvarc=.true. ! force a recomputation of initial values in sortvarc
+      CALL sortvarc
      $ ( itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time,vcov )
 
Index: /LMDZ5/trunk/libf/dyn3d_common/control_mod.F90
===================================================================
--- /LMDZ5/trunk/libf/dyn3d_common/control_mod.F90	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3d_common/control_mod.F90	(revision 2083)
@@ -10,18 +10,33 @@
   IMPLICIT NONE
 
-  REAL    :: periodav, starttime
-  INTEGER :: nday,day_step,iperiod,iapp_tracvl,nsplit_phys
-  INTEGER :: iconser,iecri,dissip_period,iphysiq,iecrimoy
-  INTEGER :: dayref,anneeref, raz_date, ip_ebil_dyn
-  LOGICAL :: offline
-  CHARACTER (len=4)  :: config_inca
-  CHARACTER (len=10) :: planet_type ! planet type ('earth','mars',...)
-  LOGICAL output_grads_dyn ! output dynamics diagnostics in
-                           ! binary grads file 'dyn.dat' (y/n)
-  LOGICAL ok_dynzon  ! output zonal transports in dynzon.nc file
-  LOGICAL ok_dyn_ins ! output instantaneous values of fields
-                     ! in the dynamics in NetCDF files dyn_hist*nc
-  LOGICAL ok_dyn_ave ! output averaged values of fields in the dynamics
-                     ! in NetCDF files dyn_hist*ave.nc
+  REAL,SAVE :: periodav
+  REAL,SAVE :: starttime
+  INTEGER,SAVE :: nday ! # of days to run
+  INTEGER,SAVE :: day_step ! # of dynamical time steps per day
+  INTEGER,SAVE :: iperiod ! make a Matsuno step before avery iperiod-1 LF steps
+  INTEGER,SAVE :: iapp_tracvl ! apply (cumulated) traceur advection every
+                              ! iapp_tracvl dynamical steps
+  INTEGER,SAVE :: nsplit_phys ! number of sub-cycle steps in call to physics
+  INTEGER,SAVE :: iconser
+  INTEGER,SAVE :: iecri
+  INTEGER,SAVE :: dissip_period ! apply dissipation every dissip_period
+                                ! dynamical step
+  INTEGER,SAVE :: iphysiq ! call physics every iphysiq dynamical steps
+  INTEGER,SAVE :: iecrimoy
+  INTEGER,SAVE :: dayref
+  INTEGER,SAVE :: anneeref ! reference year #
+  INTEGER,SAVE :: raz_date
+  INTEGER,SAVE :: ip_ebil_dyn
+  LOGICAL,SAVE :: offline
+  CHARACTER(len=4),SAVE :: config_inca
+  CHARACTER(len=10),SAVE :: planet_type ! planet type ('earth','mars',...)
+  LOGICAL,SAVE :: output_grads_dyn ! output dynamics diagnostics in
+                                   ! binary grads file 'dyn.dat' (y/n)
+  LOGICAL,SAVE :: ok_dynzon  ! output zonal transports in dynzon.nc file
+  LOGICAL,SAVE ::  ok_dyn_ins ! output instantaneous values of fields
+                              ! in the dynamics in NetCDF files dyn_hist*nc
+  LOGICAL,SAVE :: ok_dyn_ave ! output averaged values of fields in the dynamics
+                             ! in NetCDF files dyn_hist*ave.nc
+  LOGICAL,SAVE :: resetvarc  ! allows to reset the variables in sortvarc
 
 END MODULE
Index: /LMDZ5/trunk/libf/dyn3d_common/sortvarc.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3d_common/sortvarc.F	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3d_common/sortvarc.F	(revision 2083)
@@ -5,5 +5,8 @@
      $(itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time ,
      $ vcov )
+
+      USE control_mod, ONLY: resetvarc 
       IMPLICIT NONE
+
 
 c=======================================================================
@@ -22,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:
@@ -51,10 +59,19 @@
       REAL cosphi(ip1jm),omegcosp(ip1jm)
       REAL dtvrs1j,rjour,heure,radsg,radomeg
-      REAL rday, massebxy(ip1jm,llm)
+      REAL massebxy(ip1jm,llm)
       INTEGER  l, ij, imjmp1
 
       REAL       SSUM
+      LOGICAL,SAVE :: firstcal=.true.
+      CHARACTER(LEN=*),PARAMETER :: modname="sortvarc"
 
 c-----------------------------------------------------------------------
+! Ehouarn: when no initialization fields from file, resetvarc should be
+!          set to false
+       if (firstcal) then
+         if (.not.read_start) then
+           resetvarc=.true.
+         endif
+       endif
 
        dtvrs1j   = dtvr/daysec
@@ -115,5 +132,5 @@
      *               cosphi(ij)
           ENDDO
-          angl(l) = radsg *
+          angl(l) = rad *
      s    (SSUM(ip1jm-iip1,ge(iip2),1)-SSUM(jjm-1,ge(iip2),iip1))
       ENDDO
@@ -129,12 +146,10 @@
       ang   = SSUM(     llm,  angl, 1 )
 
-c      rday = REAL(INT ( day_ini + time ))
-c
-       rday = REAL(INT(time-jD_ref-jH_ref))
-      IF(ptot0.eq.0.)  THEN
-         PRINT 3500, itau, rday, 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
+      IF (firstcal.and.resetvarc) then
+         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
@@ -144,16 +159,37 @@
       END IF
 
-      etot= etot/etot0
+      ! compute relative changes in etot,... (except if 'reference' values
+      ! are zero, which can happen when using iniacademic)
+      if (etot0.ne.0) then
+        etot= etot/etot0
+      else
+        etot=1.
+      endif
       rmsv= SQRT(rmsv/ptot)
-      ptot= ptot/ptot0
-      ztot= ztot/ztot0
-      stot= stot/stot0
-      ang = ang /ang0
-
-
-      PRINT 3500, itau, rday, heure, time
-      PRINT 4000, ptot,rmsdpdt,etot,ztot,stot,rmsv,ang
-
-      RETURN
+      if (ptot0.ne.0) then
+        ptot= ptot/ptot0
+      else
+        ptot=1.
+      endif
+      if (ztot0.ne.0) then
+        ztot= ztot/ztot0
+      else
+        ztot=1.
+      endif
+      if (stot0.ne.0) then
+        stot= stot/stot0
+      else
+        stot=1.
+      endif
+      if (ang0.ne.0) then
+        ang = ang /ang0
+      else
+        ang=1.
+      endif
+
+      firstcal = .false.
+
+      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 
Index: DZ5/trunk/libf/dyn3d_common/sortvarc0.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3d_common/sortvarc0.F	(revision 2082)
+++ 	(revision )
@@ -1,141 +1,0 @@
-!
-! $Id$
-!
-      SUBROUTINE sortvarc0
-     $(itau,ucov,teta,ps,masse,pk,phis,vorpot,phi,bern,dp,time ,
-     $ vcov)
-      IMPLICIT NONE
-
-c=======================================================================
-c
-c   Auteur:    P. Le Van
-c   -------
-c
-c   Objet:
-c   ------
-c
-c   sortie des variables de controle
-c
-c=======================================================================
-c-----------------------------------------------------------------------
-c   Declarations:
-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"
-
-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)
-
-c   Local:
-c   ------
-
-      REAL vor(ip1jm),bernf(ip1jmp1,llm),ztotl(llm)
-      REAL etotl(llm),stotl(llm),rmsvl(llm),angl(llm),ge(ip1jmp1)
-      REAL cosphi(ip1jm),omegcosp(ip1jm)
-      REAL dtvrs1j,rjour,heure,radsg,radomeg
-      REAL rday, massebxy(ip1jm,llm)
-      INTEGER  l, ij, imjmp1
-
-      REAL       SSUM
-      integer  ismin,ismax
-
-c-----------------------------------------------------------------------
-
-       dtvrs1j   = dtvr/daysec
-       rjour     = REAL( INT( itau * dtvrs1j ))
-       heure     = ( itau*dtvrs1j-rjour ) * 24.
-       imjmp1    = iim * jjp1
-       IF(ABS(heure - 24.).LE.0.0001 ) heure = 0.
-c
-       CALL massbarxy ( masse, massebxy )
-
-c   .....  Calcul  de  rmsdpdt  .....
-
-       ge=dp*dp
-
-       rmsdpdt = SSUM(ip1jmp1,ge,1) - SSUM(jjp1,ge,iip1)
-c
-       rmsdpdt = daysec* 1.e-2 * SQRT(rmsdpdt/imjmp1) 
-
-       CALL SCOPY( ijp1llm,bern,1,bernf,1 )
-       CALL filtreg(bernf,jjp1,llm,-2,2,.TRUE.,1)
-
-c   .....  Calcul du moment  angulaire   .....
-
-       radsg    = rad /g
-       radomeg  = rad * omeg
-c
-       DO ij=iip2,ip1jm
-          cosphi( ij ) = COS(rlatu((ij-1)/iip1+1))
-          omegcosp(ij) = radomeg   * cosphi(ij)
-       ENDDO
-
-c  ...  Calcul  de l'energie,de l'enstrophie,de l'entropie et de rmsv  .
-
-       DO l=1,llm
-          DO ij = 1,ip1jm
-             vor(ij)=vorpot(ij,l)*vorpot(ij,l)*massebxy(ij,l)
-          ENDDO
-          ztotl(l)=(SSUM(ip1jm,vor,1)-SSUM(jjm,vor,iip1))
-
-          DO ij = 1,ip1jmp1
-             ge(ij)= masse(ij,l)*(phis(ij)+teta(ij,l)*pk(ij,l)  +
-     s        bernf(ij,l)-phi(ij,l))
-          ENDDO
-          etotl(l) = SSUM(ip1jmp1,ge,1) - SSUM(jjp1,ge,iip1)
-
-          DO   ij   = 1, ip1jmp1
-             ge(ij) = masse(ij,l)*teta(ij,l)
-          ENDDO
-          stotl(l)= SSUM(ip1jmp1,ge,1) - SSUM(jjp1,ge,iip1)
-
-          DO ij=1,ip1jmp1
-             ge(ij)=masse(ij,l)*AMAX1(bernf(ij,l)-phi(ij,l),0.)
-          ENDDO
-          rmsvl(l)=2.*(SSUM(ip1jmp1,ge,1)-SSUM(jjp1,ge,iip1))
-
-          DO ij =iip2,ip1jm
-             ge(ij)=(ucov(ij,l)/cu(ij)+omegcosp(ij))*masse(ij,l) *
-     *               cosphi(ij)
-          ENDDO
-          angl(l) = radsg *
-     s    (SSUM(ip1jm-iip1,ge(iip2),1)-SSUM(jjm-1,ge(iip2),iip1))
-      ENDDO
-
-          DO ij=1,ip1jmp1
-            ge(ij)= ps(ij)*aire(ij)
-          ENDDO
-      ptot0  = SSUM(ip1jmp1,ge,1)-SSUM(jjp1,ge,iip1)
-      etot0  = SSUM(     llm, etotl, 1 )
-      ztot0  = SSUM(     llm, ztotl, 1 )
-      stot0  = SSUM(     llm, stotl, 1 )
-      rmsv   = SSUM(     llm, rmsvl, 1 )
-      ang0   = SSUM(     llm,  angl, 1 )
-
-      rday = REAL(INT (time ))
-c
-      PRINT 3500, itau, rday, heure, time
-      PRINT *, ptot0,etot0,ztot0,stot0,ang0
-
-3500   FORMAT(10("*"),4x,'pas',i7,5x,'jour',f5.0,'heure',f5.1,4x 
-     *   ,'date',f10.5,4x,10("*"))
-      RETURN
-      END
-
Index: /LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3dmem/conf_gcm.F	(revision 2083)
@@ -177,4 +177,11 @@
       raz_date = 0
       CALL getin('raz_date', raz_date)
+
+!Config  Key  = resetvarc
+!Config  Desc = Reinit des variables de controle
+!Config  Def  = n
+!Config  Help = Reinit des variables de controle
+      resetvarc = .false.
+      CALL getin('resetvarc',resetvarc)
 
 !Config  Key  = nday
Index: /LMDZ5/trunk/libf/dyn3dmem/iniacademic_loc.F90
===================================================================
--- /LMDZ5/trunk/libf/dyn3dmem/iniacademic_loc.F90	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3dmem/iniacademic_loc.F90	(revision 2083)
@@ -4,15 +4,15 @@
 SUBROUTINE iniacademic_loc(vcov,ucov,teta,q,masse,ps,phis,time_0)
 
+  USE filtreg_mod, ONLY: inifilr
   use exner_hyb_m, only: exner_hyb
   use exner_milieu_m, only: exner_milieu
-  USE filtreg_mod
   USE infotrac, ONLY : nqtot
   USE control_mod, ONLY: day_step,planet_type
-  USE parallel_lmdz
+  USE parallel_lmdz, ONLY: ijb_u, ije_u, ijb_v, ije_v
 #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
@@ -41,13 +41,14 @@
   !   ----------
 
-  real time_0
-
-  !   variables dynamiques
-  REAL vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm) ! vents covariants
-  REAL teta(ijb_u:ije_u,llm)                 ! temperature potentielle
-  REAL q(ijb_u:ije_u,llm,nqtot)               ! champs advectes
-  REAL ps(ijb_u:ije_u)                       ! pression  au sol
-  REAL masse(ijb_u:ije_u,llm)                ! masse d'air
-  REAL phis(ijb_u:ije_u)                     ! geopotentiel au sol
+  REAL,INTENT(OUT) :: time_0
+
+  !   fields
+  REAL,INTENT(OUT) :: vcov(ijb_v:ije_v,llm) ! meridional covariant wind
+  REAL,INTENT(OUT) :: ucov(ijb_u:ije_u,llm) ! zonal covariant wind
+  REAL,INTENT(OUT) :: teta(ijb_u:ije_u,llm) ! potential temperature (K)
+  REAL,INTENT(OUT) :: q(ijb_u:ije_u,llm,nqtot) ! advected tracers (.../kg_of_air)
+  REAL,INTENT(OUT) :: ps(ijb_u:ije_u) ! surface pressure (Pa)
+  REAL,INTENT(OUT) :: masse(ijb_u:ije_u,llm) ! air mass in grid cell (kg)
+  REAL,INTENT(OUT) :: phis(ijb_u:ije_u) ! surface geopotential
 
   !   Local:
@@ -80,4 +81,13 @@
   character(len=80) :: abort_message
 
+  ! Sanity check: verify that options selected by user are not incompatible
+  if ((iflag_phys==1).and.(read_start==.false.)) 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: /LMDZ5/trunk/libf/dyn3dpar/conf_gcm.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3dpar/conf_gcm.F	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3dpar/conf_gcm.F	(revision 2083)
@@ -176,4 +176,11 @@
       raz_date = 0
       CALL getin('raz_date', raz_date)
+
+!Config  Key  = resetvarc
+!Config  Desc = Reinit des variables de controle
+!Config  Def  = n
+!Config  Help = Reinit des variables de controle
+      resetvarc = .false.
+      CALL getin('resetvarc',resetvarc)
 
 !Config  Key  = nday
Index: /LMDZ5/trunk/libf/dyn3dpar/iniacademic.F90
===================================================================
--- /LMDZ5/trunk/libf/dyn3dpar/iniacademic.F90	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3dpar/iniacademic.F90	(revision 2083)
@@ -4,16 +4,16 @@
 SUBROUTINE iniacademic(vcov,ucov,teta,q,masse,ps,phis,time_0)
 
-  use exner_hyb_m, only: exner_hyb
-  use exner_milieu_m, only: exner_milieu
-  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
+  use exner_hyb_m, only: exner_hyb
+  use exner_milieu_m, only: exner_milieu
 
   !   Author:    Frederic Hourdin      original: 15/01/93
@@ -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.(read_start==.false.)) 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
@@ -224,5 +235,5 @@
         CALL pression ( ip1jmp1, ap, bp, ps, p       )
         if (pressure_exner) then
-          CALL exner_hyb( ip1jmp1, ps, p, pks, pk )
+          CALL exner_hyb( ip1jmp1, ps, p, pks, pk)
         else
           call exner_milieu(ip1jmp1,ps,p,pks,pk)
Index: /LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F
===================================================================
--- /LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F	(revision 2082)
+++ /LMDZ5/trunk/libf/dyn3dpar/leapfrog_p.F	(revision 2083)
@@ -717,8 +717,9 @@
            CALL exner_milieu_p( ip1jmp1, ps, p, pks, pk, pkf )
          endif
+c$OMP BARRIER
 ! Appel a geopot ajoute le 2014/05/08 pour garantir la convergence numerique
 ! avec dyn3dmem
-      CALL geopot  ( ip1jmp1, teta  , pk , pks,  phis  , phi   )
-c$OMP BARRIER
+      CALL geopot_p  ( ip1jmp1, teta  , pk , pks,  phis  , phi   )
+
            jD_cur = jD_ref + day_ini - day_ref
      $        + itau/day_step
