Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advtrac_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advtrac_loc.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/advtrac_loc.f90	(revision 5114)
@@ -19,4 +19,5 @@
   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO
   USE strings_mod, ONLY: int2str
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -26,6 +27,4 @@
   include "comdissip.h"
   include "comgeom2.h"
-  include "description.h"
-  !   include "iniprint.h"
 
   !---------------------------------------------------------------------------
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynetat0_loc.F90	(revision 5114)
@@ -21,4 +21,5 @@
   USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_INCA
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -26,5 +27,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 !===============================================================================
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/dynredem_loc.F90	(revision 5114)
@@ -21,4 +21,5 @@
   USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn, itaufin, start_time
   USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -26,5 +27,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 !===============================================================================
@@ -174,9 +174,9 @@
                           err, modname, fil, msg
   USE temps_mod, ONLY: itau_dyn, itaufin
+  USE lmdz_description, ONLY: descript
   
   IMPLICIT NONE
   include "dimensions.h"
   include "paramet.h"
-  include "description.h"
   include "comgeom.h"
   include "iniprint.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gcm.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gcm.F90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/gcm.F90	(revision 5114)
@@ -25,4 +25,5 @@
   USE mod_xios_dyn3dmem, ONLY: xios_dyn3dmem_init
   USE lmdz_filtreg, ONLY: inifilr
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -61,5 +62,4 @@
   include "comdissnew.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
   include "tracstoke.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initdynav_loc.f90	(revision 5114)
@@ -15,4 +15,5 @@
    USE comvert_mod, ONLY: presnivs
    USE temps_mod, ONLY: itau_dyn
+   USE lmdz_description, ONLY: descript
 
    IMPLICIT NONE
@@ -46,5 +47,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/initfluxsto_p.f90	(revision 5114)
@@ -1,17 +1,13 @@
-
 ! $Id$
 
-SUBROUTINE initfluxsto_p &
-        (infile,tstep,t_ops,t_wrt, &
-        fileid,filevid,filedid)
-
-  ! This routine needs IOIPSL
-   USE IOIPSL
-   USE parallel_lmdz
-   use Write_field
-   use misc_mod
-   USE comconst_mod, ONLY: pi
-   USE comvert_mod, ONLY: nivsigs
-   USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn
+SUBROUTINE initfluxsto_p(infile, tstep, t_ops, t_wrt, fileid, filevid, filedid)
+  USE IOIPSL
+  USE parallel_lmdz
+  use Write_field
+  use misc_mod
+  USE comconst_mod, ONLY: pi
+  USE comvert_mod, ONLY: nivsigs
+  USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -47,12 +43,11 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 
   !   Arguments
   !
-  character(len=*) :: infile
+  character(len = *) :: infile
   real :: tstep, t_ops, t_wrt
-  integer :: fileid, filevid,filedid
+  integer :: fileid, filevid, filedid
 
   ! This routine needs IOIPSL
@@ -62,23 +57,23 @@
   integer :: tau0
   real :: zjulian
-  character(len=3) :: str
-  character(len=10) :: ctrac
+  character(len = 3) :: str
+  character(len = 10) :: ctrac
   integer :: iq
-  real :: rlong(iip1,jjp1), rlat(iip1,jjp1),rl(1,1)
-  integer :: uhoriid, vhoriid, thoriid, zvertiid,dhoriid,dvertiid
-  integer :: ii,jj
+  real :: rlong(iip1, jjp1), rlat(iip1, jjp1), rl(1, 1)
+  integer :: uhoriid, vhoriid, thoriid, zvertiid, dhoriid, dvertiid
+  integer :: ii, jj
   integer :: zan, idayref
   logical :: ok_sync
-  integer :: jjb,jje,jjn
+  integer :: jjb, jje, jjn
 
   ! definition du domaine d'ecriture pour le rebuild
 
-  INTEGER,DIMENSION(2) :: ddid
-  INTEGER,DIMENSION(2) :: dsg
-  INTEGER,DIMENSION(2) :: dsl
-  INTEGER,DIMENSION(2) :: dpf
-  INTEGER,DIMENSION(2) :: dpl
-  INTEGER,DIMENSION(2) :: dhs
-  INTEGER,DIMENSION(2) :: dhe
+  INTEGER, DIMENSION(2) :: ddid
+  INTEGER, DIMENSION(2) :: dsg
+  INTEGER, DIMENSION(2) :: dsl
+  INTEGER, DIMENSION(2) :: dpf
+  INTEGER, DIMENSION(2) :: dpl
+  INTEGER, DIMENSION(2) :: dhs
+  INTEGER, DIMENSION(2) :: dhe
 
   INTEGER :: dynu_domain_id
@@ -89,5 +84,5 @@
   !
   pi = 4. * atan (1.)
-  str='q  '
+  str = 'q  '
   ctrac = 'traceur   '
   ok_sync = .TRUE.
@@ -101,29 +96,29 @@
   tau0 = itau_dyn
 
-    do jj = 1, jjp1
+  do jj = 1, jjp1
     do ii = 1, iip1
-      rlong(ii,jj) = rlonu(ii) * 180. / pi
-      rlat(ii,jj) = rlatu(jj) * 180. / pi
+      rlong(ii, jj) = rlonu(ii) * 180. / pi
+      rlat(ii, jj) = rlatu(jj) * 180. / pi
     enddo
   enddo
 
-  jjb=jj_begin
-  jje=jj_end
-  jjn=jj_nb
-
-  ddid=(/ 1,2 /)
-  dsg=(/ iip1,jjp1 /)
-  dsl=(/ iip1,jjn /)
-  dpf=(/ 1,jjb /)
-  dpl=(/ iip1,jje /)
-  dhs=(/ 0,0 /)
-  dhe=(/ 0,0 /)
-
-  CALL flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
-        'box',dynu_domain_id)
-
-  CALL histbeg(trim(infile),iip1, rlong(:,1), jjn, rlat(1,jjb:jje), &
-        1, iip1, 1, jjn, tau0, zjulian, tstep, uhoriid, &
-        fileid,dynu_domain_id)
+  jjb = jj_begin
+  jje = jj_end
+  jjn = jj_nb
+
+  ddid = (/ 1, 2 /)
+  dsg = (/ iip1, jjp1 /)
+  dsl = (/ iip1, jjn /)
+  dpf = (/ 1, jjb /)
+  dpl = (/ iip1, jje /)
+  dhs = (/ 0, 0 /)
+  dhe = (/ 0, 0 /)
+
+  CALL flio_dom_set(mpi_size, mpi_rank, ddid, dsg, dsl, dpf, dpl, dhs, dhe, &
+          'box', dynu_domain_id)
+
+  CALL histbeg(trim(infile), iip1, rlong(:, 1), jjn, rlat(1, jjb:jje), &
+          1, iip1, 1, jjn, tau0, zjulian, tstep, uhoriid, &
+          fileid, dynu_domain_id)
   !
   !  Creation du fichier histoire pour la grille en V (oblige pour l'instant,
@@ -131,40 +126,39 @@
   !  un meme fichier)
 
-
   do jj = 1, jjm
     do ii = 1, iip1
-      rlong(ii,jj) = rlonv(ii) * 180. / pi
-      rlat(ii,jj) = rlatv(jj) * 180. / pi
+      rlong(ii, jj) = rlonv(ii) * 180. / pi
+      rlat(ii, jj) = rlatv(jj) * 180. / pi
     enddo
   enddo
 
-  jjb=jj_begin
-  jje=jj_end
-  jjn=jj_nb
-  if (pole_sud) jje=jj_end-1
-  if (pole_sud) jjn=jj_nb-1
-
-  ddid=(/ 1,2 /)
-  dsg=(/ iip1,jjm /)
-  dsl=(/ iip1,jjn /)
-  dpf=(/ 1,jjb /)
-  dpl=(/ iip1,jje /)
-  dhs=(/ 0,0 /)
-  dhe=(/ 0,0 /)
-
-  CALL flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
-        'box',dynv_domain_id)
-
-  CALL histbeg('fluxstokev',iip1, rlong(:,1), jjn, rlat(1,jjb:jje), &
-        1, iip1, 1, jjn,tau0, zjulian, tstep, vhoriid, &
-        filevid,dynv_domain_id)
-
-  rl(1,1) = 1.
+  jjb = jj_begin
+  jje = jj_end
+  jjn = jj_nb
+  if (pole_sud) jje = jj_end - 1
+  if (pole_sud) jjn = jj_nb - 1
+
+  ddid = (/ 1, 2 /)
+  dsg = (/ iip1, jjm /)
+  dsl = (/ iip1, jjn /)
+  dpf = (/ 1, jjb /)
+  dpl = (/ iip1, jje /)
+  dhs = (/ 0, 0 /)
+  dhe = (/ 0, 0 /)
+
+  CALL flio_dom_set(mpi_size, mpi_rank, ddid, dsg, dsl, dpf, dpl, dhs, dhe, &
+          'box', dynv_domain_id)
+
+  CALL histbeg('fluxstokev', iip1, rlong(:, 1), jjn, rlat(1, jjb:jje), &
+          1, iip1, 1, jjn, tau0, zjulian, tstep, vhoriid, &
+          filevid, dynv_domain_id)
+
+  rl(1, 1) = 1.
 
   if (mpi_rank==0) then
 
     CALL histbeg('defstoke.nc', 1, rl, 1, rl, &
-          1, 1, 1, 1, &
-          tau0, zjulian, tstep, dhoriid, filedid)
+            1, 1, 1, 1, &
+            tau0, zjulian, tstep, dhoriid, filedid)
 
   endif
@@ -174,15 +168,15 @@
   do jj = 1, jjp1
     do ii = 1, iip1
-      rlong(ii,jj) = rlonv(ii) * 180. / pi
-      rlat(ii,jj) = rlatu(jj) * 180. / pi
+      rlong(ii, jj) = rlonv(ii) * 180. / pi
+      rlat(ii, jj) = rlatu(jj) * 180. / pi
     enddo
   enddo
 
-  jjb=jj_begin
-  jje=jj_end
-  jjn=jj_nb
-
-  CALL histhori(fileid, iip1, rlong(:,jjb:jje),jjn,rlat(:,jjb:jje), &
-        'scalar','Grille points scalaires', thoriid)
+  jjb = jj_begin
+  jje = jj_end
+  jjn = jj_nb
+
+  CALL histhori(fileid, iip1, rlong(:, jjb:jje), jjn, rlat(:, jjb:jje), &
+          'scalar', 'Grille points scalaires', thoriid)
 
   !
@@ -190,71 +184,71 @@
   !
   CALL histvert(fileid, 'sig_s', 'Niveaux sigma', &
-        'sigma_level', &
-        llm, nivsigs, zvertiid)
+          'sigma_level', &
+          llm, nivsigs, zvertiid)
   ! Pour le fichier V
   CALL histvert(filevid, 'sig_s', 'Niveaux sigma', &
-        'sigma_level', &
-        llm, nivsigs, zvertiid)
+          'sigma_level', &
+          llm, nivsigs, zvertiid)
   ! pour le fichier def
   if (mpi_rank==0) then
-     nivd(1) = 1
-     CALL histvert(filedid, 'sig_s', 'Niveaux sigma', &
-           'sigma_level', &
-           1, nivd, dvertiid)
+    nivd(1) = 1
+    CALL histvert(filedid, 'sig_s', 'Niveaux sigma', &
+            'sigma_level', &
+            1, nivd, dvertiid)
   endif
   !
   !  Appels a histdef pour la definition des variables a sauvegarder
 
-    CALL histdef(fileid, "phis", "Surface geop. height", "-", &
-          iip1,jjn,thoriid, 1,1,1, -99, 32, &
+  CALL histdef(fileid, "phis", "Surface geop. height", "-", &
+          iip1, jjn, thoriid, 1, 1, 1, -99, 32, &
           "once", t_ops, t_wrt)
 
-     CALL histdef(fileid, "aire", "Grid area", "-", &
-           iip1,jjn,thoriid, 1,1,1, -99, 32, &
-           "once", t_ops, t_wrt)
-
-    if (mpi_rank==0) then
+  CALL histdef(fileid, "aire", "Grid area", "-", &
+          iip1, jjn, thoriid, 1, 1, 1, -99, 32, &
+          "once", t_ops, t_wrt)
+
+  if (mpi_rank==0) then
 
     CALL histdef(filedid, "dtvr", "tps dyn", "s", &
-          1,1,dhoriid, 1,1,1, -99, 32, &
-          "once", t_ops, t_wrt)
-
-     CALL histdef(filedid, "istdyn", "tps stock", "s", &
-           1,1,dhoriid, 1,1,1, -99, 32, &
-           "once", t_ops, t_wrt)
-
-     CALL histdef(filedid, "istphy", "tps stock phy", "s", &
-           1,1,dhoriid, 1,1,1, -99, 32, &
-           "once", t_ops, t_wrt)
-
-    endif
+            1, 1, dhoriid, 1, 1, 1, -99, 32, &
+            "once", t_ops, t_wrt)
+
+    CALL histdef(filedid, "istdyn", "tps stock", "s", &
+            1, 1, dhoriid, 1, 1, 1, -99, 32, &
+            "once", t_ops, t_wrt)
+
+    CALL histdef(filedid, "istphy", "tps stock phy", "s", &
+            1, 1, dhoriid, 1, 1, 1, -99, 32, &
+            "once", t_ops, t_wrt)
+
+  endif
   !
   ! Masse
   !
   CALL histdef(fileid, 'masse', 'Masse', 'kg', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  Pbaru
   !
   CALL histdef(fileid, 'pbaru', 'flx de masse zonal', 'kg m/s', &
-        iip1, jjn, uhoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, uhoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
 
   !
   !  Pbarv
   !
-  if (pole_sud) jjn=jj_nb-1
+  if (pole_sud) jjn = jj_nb - 1
 
   CALL histdef(filevid, 'pbarv', 'flx de masse mer', 'kg m/s', &
-        iip1, jjn, vhoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, vhoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  w
   !
-  if (pole_sud) jjn=jj_nb
+  if (pole_sud) jjn = jj_nb
   CALL histdef(fileid, 'w', 'flx de masse vert', 'kg m/s', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
 
   !
@@ -262,6 +256,6 @@
   !
   CALL histdef(fileid, 'teta', 'temperature potentielle', '-', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
 
@@ -270,6 +264,6 @@
   !
   CALL histdef(fileid, 'phi', 'geopotentiel instantane', '-', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  Fin
@@ -284,4 +278,3 @@
   endif
 
-
 end subroutine initfluxsto_p
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/inithist_loc.F90	(revision 5114)
@@ -4,13 +4,14 @@
 
   ! This routine needs IOIPSL
-   USE IOIPSL
+  USE IOIPSL
   USE parallel_lmdz
-  use Write_field
-  use misc_mod
-  use com_io_dyn_mod, ONLY: histid, histvid, histuid, &
+  USE Write_field
+  USE misc_mod
+  USE com_io_dyn_mod, ONLY: histid, histvid, histuid, &
           dynhist_file, dynhistv_file, dynhistu_file
   USE comconst_mod, ONLY: pi
   USE comvert_mod, ONLY: presnivs
   USE temps_mod, ONLY: itau_dyn
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -43,5 +44,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 
@@ -57,20 +57,20 @@
   real :: zjulian
   integer :: iq
-  real :: rlong(iip1,jjp1), rlat(iip1,jjp1)
+  real :: rlong(iip1, jjp1), rlat(iip1, jjp1)
   integer :: uhoriid, vhoriid, thoriid
-  integer :: zvertiid,zvertiidv,zvertiidu
-  integer :: ii,jj
+  integer :: zvertiid, zvertiidv, zvertiidu
+  integer :: ii, jj
   integer :: zan, dayref
-  integer :: jjb,jje,jjn
+  integer :: jjb, jje, jjn
 
   ! definition du domaine d'ecriture pour le rebuild
 
-  INTEGER,DIMENSION(2) :: ddid
-  INTEGER,DIMENSION(2) :: dsg
-  INTEGER,DIMENSION(2) :: dsl
-  INTEGER,DIMENSION(2) :: dpf
-  INTEGER,DIMENSION(2) :: dpl
-  INTEGER,DIMENSION(2) :: dhs
-  INTEGER,DIMENSION(2) :: dhe
+  INTEGER, DIMENSION(2) :: ddid
+  INTEGER, DIMENSION(2) :: dsg
+  INTEGER, DIMENSION(2) :: dsl
+  INTEGER, DIMENSION(2) :: dpf
+  INTEGER, DIMENSION(2) :: dpl
+  INTEGER, DIMENSION(2) :: dhs
+  INTEGER, DIMENSION(2) :: dhe
 
   INTEGER :: dynhist_domain_id
@@ -95,6 +95,6 @@
   do jj = 1, jjp1
     do ii = 1, iip1
-      rlong(ii,jj) = rlonv(ii) * 180. / pi
-      rlat(ii,jj)  = rlatu(jj) * 180. / pi
+      rlong(ii, jj) = rlonv(ii) * 180. / pi
+      rlat(ii, jj) = rlatu(jj) * 180. / pi
     enddo
   enddo
@@ -105,24 +105,23 @@
   ! Grille Scalaire
 
-  jjb=jj_begin
-  jje=jj_end
-  jjn=jj_nb
-
-  ddid=(/ 1,2 /)
-  dsg=(/ iip1,jjp1 /)
-  dsl=(/ iip1,jjn /)
-  dpf=(/ 1,jjb /)
-  dpl=(/ iip1,jje /)
-  dhs=(/ 0,0 /)
-  dhe=(/ 0,0 /)
-
-
-  CALL flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
-        'box',dynhist_domain_id)
-
-  CALL histbeg(dynhist_file,iip1, rlong(:,1), jjn, &
-        rlat(1,jjb:jje), 1, iip1, 1, jjn,tau0, &
-        zjulian, tstep, thoriid, &
-        histid,dynhist_domain_id)
+  jjb = jj_begin
+  jje = jj_end
+  jjn = jj_nb
+
+  ddid = (/ 1, 2 /)
+  dsg = (/ iip1, jjp1 /)
+  dsl = (/ iip1, jjn /)
+  dpf = (/ 1, jjb /)
+  dpl = (/ iip1, jje /)
+  dhs = (/ 0, 0 /)
+  dhe = (/ 0, 0 /)
+
+  CALL flio_dom_set(mpi_size, mpi_rank, ddid, dsg, dsl, dpf, dpl, dhs, dhe, &
+          'box', dynhist_domain_id)
+
+  CALL histbeg(dynhist_file, iip1, rlong(:, 1), jjn, &
+          rlat(1, jjb:jje), 1, iip1, 1, jjn, tau0, &
+          zjulian, tstep, thoriid, &
+          histid, dynhist_domain_id)
 
 
@@ -132,33 +131,32 @@
   ! Grille V
 
-  jjb=jj_begin
-  jje=jj_end
-  jjn=jj_nb
-  IF (pole_sud) jjn=jjn-1
-  IF (pole_sud) jje=jje-1
+  jjb = jj_begin
+  jje = jj_end
+  jjn = jj_nb
+  IF (pole_sud) jjn = jjn - 1
+  IF (pole_sud) jje = jje - 1
 
   do jj = jjb, jje
     do ii = 1, iip1
-      rlong(ii,jj) = rlonv(ii) * 180. / pi
-      rlat(ii,jj) = rlatv(jj) * 180. / pi
+      rlong(ii, jj) = rlonv(ii) * 180. / pi
+      rlat(ii, jj) = rlatv(jj) * 180. / pi
     enddo
   enddo
 
-  ddid=(/ 1,2 /)
-  dsg=(/ iip1,jjm /)
-  dsl=(/ iip1,jjn /)
-  dpf=(/ 1,jjb /)
-  dpl=(/ iip1,jje /)
-  dhs=(/ 0,0 /)
-  dhe=(/ 0,0 /)
-
-
-  CALL flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
-        'box',dynhistv_domain_id)
-
-  CALL histbeg(dynhistv_file,iip1, rlong(:,1), jjn, &
-        rlat(1,jjb:jje), 1, iip1, 1, jjn,tau0, &
-        zjulian, tstep, vhoriid, &
-        histvid,dynhistv_domain_id)
+  ddid = (/ 1, 2 /)
+  dsg = (/ iip1, jjm /)
+  dsl = (/ iip1, jjn /)
+  dpf = (/ 1, jjb /)
+  dpl = (/ iip1, jje /)
+  dhs = (/ 0, 0 /)
+  dhe = (/ 0, 0 /)
+
+  CALL flio_dom_set(mpi_size, mpi_rank, ddid, dsg, dsl, dpf, dpl, dhs, dhe, &
+          'box', dynhistv_domain_id)
+
+  CALL histbeg(dynhistv_file, iip1, rlong(:, 1), jjn, &
+          rlat(1, jjb:jje), 1, iip1, 1, jjn, tau0, &
+          zjulian, tstep, vhoriid, &
+          histvid, dynhistv_domain_id)
 
   ! Grille U
@@ -166,29 +164,28 @@
   do jj = 1, jjp1
     do ii = 1, iip1
-      rlong(ii,jj) = rlonu(ii) * 180. / pi
-      rlat(ii,jj) = rlatu(jj) * 180. / pi
+      rlong(ii, jj) = rlonu(ii) * 180. / pi
+      rlat(ii, jj) = rlatu(jj) * 180. / pi
     enddo
   enddo
 
-  jjb=jj_begin
-  jje=jj_end
-  jjn=jj_nb
-
-  ddid=(/ 1,2 /)
-  dsg=(/ iip1,jjp1 /)
-  dsl=(/ iip1,jjn /)
-  dpf=(/ 1,jjb /)
-  dpl=(/ iip1,jje /)
-  dhs=(/ 0,0 /)
-  dhe=(/ 0,0 /)
-
-
-  CALL flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
-        'box',dynhistu_domain_id)
-
-  CALL histbeg(dynhistu_file,iip1, rlong(:,1), jjn, &
-        rlat(1,jjb:jje), 1, iip1, 1, jjn,tau0, &
-        zjulian, tstep, uhoriid, &
-        histuid,dynhistu_domain_id)
+  jjb = jj_begin
+  jje = jj_end
+  jjn = jj_nb
+
+  ddid = (/ 1, 2 /)
+  dsg = (/ iip1, jjp1 /)
+  dsl = (/ iip1, jjn /)
+  dpf = (/ 1, jjb /)
+  dpl = (/ iip1, jje /)
+  dhs = (/ 0, 0 /)
+  dhe = (/ 0, 0 /)
+
+  CALL flio_dom_set(mpi_size, mpi_rank, ddid, dsg, dsl, dpf, dpl, dhs, dhe, &
+          'box', dynhistu_domain_id)
+
+  CALL histbeg(dynhistu_file, iip1, rlong(:, 1), jjn, &
+          rlat(1, jjb:jje), 1, iip1, 1, jjn, tau0, &
+          zjulian, tstep, uhoriid, &
+          histuid, dynhistu_domain_id)
 
 
@@ -196,10 +193,10 @@
   !  Appel a histvert pour la grille verticale
   ! -------------------------------------------------------------
-  CALL histvert(histid, 'presnivs', 'Niveaux pression','mb', &
-        llm, presnivs/100., zvertiid,'down')
-  CALL histvert(histvid, 'presnivs', 'Niveaux pression','mb', &
-        llm, presnivs/100., zvertiidv,'down')
-  CALL histvert(histuid, 'presnivs', 'Niveaux pression','mb', &
-        llm, presnivs/100., zvertiidu,'down')
+  CALL histvert(histid, 'presnivs', 'Niveaux pression', 'mb', &
+          llm, presnivs / 100., zvertiid, 'down')
+  CALL histvert(histvid, 'presnivs', 'Niveaux pression', 'mb', &
+          llm, presnivs / 100., zvertiidv, 'down')
+  CALL histvert(histuid, 'presnivs', 'Niveaux pression', 'mb', &
+          llm, presnivs / 100., zvertiidu, 'down')
 
   !
@@ -210,30 +207,30 @@
   !  Vents U
   !
-  jjn=jj_nb
+  jjn = jj_nb
   CALL histdef(histuid, 'u', 'vent u', &
-        'm/s', iip1, jjn, uhoriid, llm, 1, llm, zvertiidu, &
-        32, 'inst(X)', t_ops, t_wrt)
+          'm/s', iip1, jjn, uhoriid, llm, 1, llm, zvertiidu, &
+          32, 'inst(X)', t_ops, t_wrt)
 
   !
   !  Vents V
   !
-  if (pole_sud) jjn=jj_nb-1
+  if (pole_sud) jjn = jj_nb - 1
   CALL histdef(histvid, 'v', 'vent v', &
-        'm/s', iip1, jjn, vhoriid, llm, 1, llm, zvertiidv, &
-        32, 'inst(X)', t_ops, t_wrt)
+          'm/s', iip1, jjn, vhoriid, llm, 1, llm, zvertiidv, &
+          32, 'inst(X)', t_ops, t_wrt)
 
   !
   !  Temperature
   !
-  jjn=jj_nb
+  jjn = jj_nb
   CALL histdef(histid, 'temp', 'temperature', 'K', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  Temperature potentielle
   !
   CALL histdef(histid, 'theta', 'temperature potentielle', 'K', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
 
 
@@ -242,6 +239,6 @@
   !
   CALL histdef(histid, 'phi', 'geopotentiel', '-', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  Traceurs
@@ -257,12 +254,12 @@
   !
   CALL histdef(histid, 'masse', 'masse', 'kg', &
-        iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, llm, 1, llm, zvertiid, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  Pression au sol
   !
   CALL histdef(histid, 'ps', 'pression naturelle au sol', 'Pa', &
-        iip1, jjn, thoriid, 1, 1, 1, -99, &
-        32, 'inst(X)', t_ops, t_wrt)
+          iip1, jjn, thoriid, 1, 1, 1, -99, &
+          32, 'inst(X)', t_ops, t_wrt)
   !
   !  Geopotentiel au sol
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/leapfrog_loc.F90	(revision 5114)
@@ -40,4 +40,5 @@
           using_xios
   USE lmdz_cppkeys_wrapper, ONLY: CPPKEY_DEBUGIO
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -78,5 +79,4 @@
   include "comdissnew.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
   include "academic.h"
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedyn_xios.F90	(revision 5114)
@@ -1,162 +1,160 @@
-
 ! $Id$
 
-      SUBROUTINE writedyn_xios( vcov, ucov,teta,ppk,phi,q, &
-                             masse,ps,phis)
+SUBROUTINE writedyn_xios(vcov, ucov, teta, ppk, phi, q, &
+        masse, ps, phis)
 
-      USE lmdz_xios
-      USE parallel_lmdz
-      USE misc_mod
-      USE infotrac, ONLY: nqtot
-      use com_io_dyn_mod, ONLY: histaveid,histvaveid,histuaveid
-      USE comconst_mod, ONLY: cpp
-      USE temps_mod, ONLY: itau_dyn
-      USE mod_xios_dyn3dmem, ONLY: writefield_dyn_u, writefield_dyn_v
-      
-      IMPLICIT NONE
+  USE lmdz_xios
+  USE parallel_lmdz
+  USE misc_mod
+  USE infotrac, ONLY: nqtot
+  use com_io_dyn_mod, ONLY: histaveid, histvaveid, histuaveid
+  USE comconst_mod, ONLY: cpp
+  USE temps_mod, ONLY: itau_dyn
+  USE mod_xios_dyn3dmem, ONLY: writefield_dyn_u, writefield_dyn_v
+  USE lmdz_description, ONLY: descript
 
-!   Ecriture du fichier histoire au format xios
+  IMPLICIT NONE
+
+  !   Ecriture du fichier histoire au format xios
 
 
-!   Entree:
-!      vcov: vents v covariants
-!      ucov: vents u covariants
-!      teta: temperature potentielle
-!      phi : geopotentiel instantane
-!      q   : traceurs
-!      masse: masse
-!      ps   :pression au sol
-!      phis : geopotentiel au sol
+  !   Entree:
+  !      vcov: vents v covariants
+  !      ucov: vents u covariants
+  !      teta: temperature potentielle
+  !      phi : geopotentiel instantane
+  !      q   : traceurs
+  !      masse: masse
+  !      ps   :pression au sol
+  !      phis : geopotentiel au sol
 
-!   L. Fairhead, LMD, 03/21
+  !   L. Fairhead, LMD, 03/21
 
-! =====================================================================
+  ! =====================================================================
 
-!   Declarations
-      include "dimensions.h"
-      include "paramet.h"
-      include "comgeom.h"
-      include "description.h"
-      include "iniprint.h"
+  !   Declarations
+  include "dimensions.h"
+  include "paramet.h"
+  include "comgeom.h"
+  include "iniprint.h"
 
-!   Arguments
+  !   Arguments
 
-      REAL vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm) 
-      REAL teta(ijb_u:ije_u,llm),phi(ijb_u:ije_u,llm)
-      REAL ppk(ijb_u:ije_u,llm)                  
-      REAL ps(ijb_u:ije_u),masse(ijb_u:ije_u,llm)                   
-      REAL phis(ijb_u:ije_u)                  
-      REAL q(ijb_u:ije_u,llm,nqtot)
-      integer time
+  REAL vcov(ijb_v:ije_v, llm), ucov(ijb_u:ije_u, llm)
+  REAL teta(ijb_u:ije_u, llm), phi(ijb_u:ije_u, llm)
+  REAL ppk(ijb_u:ije_u, llm)
+  REAL ps(ijb_u:ije_u), masse(ijb_u:ije_u, llm)
+  REAL phis(ijb_u:ije_u)
+  REAL q(ijb_u:ije_u, llm, nqtot)
+  integer time
 
 
-!   Variables locales
+  !   Variables locales
 
-      INTEGER,SAVE,ALLOCATABLE :: ndex2d(:),ndexu(:),ndexv(:)
-      INTEGER :: iq, ii, ll
-      REAL,SAVE,ALLOCATABLE :: tm(:,:)
-      REAL,SAVE,ALLOCATABLE :: vnat(:,:),unat(:,:)
-      REAL,SAVE,ALLOCATABLE :: vbuffer(:,:)
-      logical ok_sync
-      integer itau_w
-      integer :: ijb,ije,jjn
-      LOGICAL,SAVE :: first=.TRUE.
-      LOGICAL,SAVE :: debuglf=.TRUE.
-!$OMP THREADPRIVATE(debuglf)
-!$OMP THREADPRIVATE(first)
+  INTEGER, SAVE, ALLOCATABLE :: ndex2d(:), ndexu(:), ndexv(:)
+  INTEGER :: iq, ii, ll
+  REAL, SAVE, ALLOCATABLE :: tm(:, :)
+  REAL, SAVE, ALLOCATABLE :: vnat(:, :), unat(:, :)
+  REAL, SAVE, ALLOCATABLE :: vbuffer(:, :)
+  logical ok_sync
+  integer itau_w
+  integer :: ijb, ije, jjn
+  LOGICAL, SAVE :: first = .TRUE.
+  LOGICAL, SAVE :: debuglf = .TRUE.
+  !$OMP THREADPRIVATE(debuglf)
+  !$OMP THREADPRIVATE(first)
 
-!  Initialisations
+  !  Initialisations
 
-!      WRITE(*,*)'IN WRITEDYN_XIOS'
-      IF (first) THEN
-!$OMP BARRIER
-!$OMP MASTER
-        ALLOCATE(unat(ijb_u:ije_u,llm))
-        ALLOCATE(vnat(ijb_v:ije_v,llm))
-        IF (pole_sud) THEN
-           ALLOCATE(vbuffer(ijb_v:ije_v+iip1,llm))
-        ELSE
-           ALLOCATE(vbuffer(ijb_v:ije_v+iip1,llm))
-        ENDIF
-        ALLOCATE(tm(ijb_u:ije_u,llm))
-        ALLOCATE(ndex2d(ijnb_u*llm))
-        ALLOCATE(ndexu(ijnb_u*llm))
-        ALLOCATE(ndexv(ijnb_v*llm))
-        unat = 0.; vnat = 0.; tm = 0. ;
-        ndex2d = 0
-        ndexu = 0
-        ndexv = 0
-        vbuffer=0.
-!$OMP END MASTER
-!$OMP BARRIER
-        first=.FALSE.
-      ENDIF
-      
-      ok_sync = .TRUE.
-      itau_w = itau_dyn + time
+  !      WRITE(*,*)'IN WRITEDYN_XIOS'
+  IF (first) THEN
+    !$OMP BARRIER
+    !$OMP MASTER
+    ALLOCATE(unat(ijb_u:ije_u, llm))
+    ALLOCATE(vnat(ijb_v:ije_v, llm))
+    IF (pole_sud) THEN
+      ALLOCATE(vbuffer(ijb_v:ije_v + iip1, llm))
+    ELSE
+      ALLOCATE(vbuffer(ijb_v:ije_v + iip1, llm))
+    ENDIF
+    ALLOCATE(tm(ijb_u:ije_u, llm))
+    ALLOCATE(ndex2d(ijnb_u * llm))
+    ALLOCATE(ndexu(ijnb_u * llm))
+    ALLOCATE(ndexv(ijnb_v * llm))
+    unat = 0.; vnat = 0.; tm = 0. ;
+    ndex2d = 0
+    ndexu = 0
+    ndexv = 0
+    vbuffer = 0.
+    !$OMP END MASTER
+    !$OMP BARRIER
+    first = .FALSE.
+  ENDIF
 
-! Passage aux composantes naturelles du vent
-      CALL covnat_loc(llm, ucov, vcov, unat, vnat)
+  ok_sync = .TRUE.
+  itau_w = itau_dyn + time
 
-!  Appels a histwrite pour l'ecriture des variables a sauvegarder
+  ! Passage aux composantes naturelles du vent
+  CALL covnat_loc(llm, ucov, vcov, unat, vnat)
 
-!  Vents U
+  !  Appels a histwrite pour l'ecriture des variables a sauvegarder
 
-      ijb=ij_begin
-      ije=ij_end
-      jjn=jj_nb
-     
-      CALL writefield_dyn_u('U', unat(ijb:ije,:))
+  !  Vents U
 
-!  Vents V
+  ijb = ij_begin
+  ije = ij_end
+  jjn = jj_nb
 
-      ije=ij_end
-      IF (pole_sud) THEN
-         jjn=jj_nb-1
-         ije=ij_end-iip1
-      ENDIF
-      vbuffer(ijb:ije,:)=vnat(ijb:ije,:)
+  CALL writefield_dyn_u('U', unat(ijb:ije, :))
 
+  !  Vents V
 
-      IF (pole_sud) THEN
-         CALL writefield_dyn_v('V', vbuffer(ijb:ije+iip1,:))
-      ELSE
-         CALL writefield_dyn_v('V', vbuffer(ijb:ije,:))
-      ENDIF
+  ije = ij_end
+  IF (pole_sud) THEN
+    jjn = jj_nb - 1
+    ije = ij_end - iip1
+  ENDIF
+  vbuffer(ijb:ije, :) = vnat(ijb:ije, :)
 
-!  Temperature potentielle moyennee
+  IF (pole_sud) THEN
+    CALL writefield_dyn_v('V', vbuffer(ijb:ije + iip1, :))
+  ELSE
+    CALL writefield_dyn_v('V', vbuffer(ijb:ije, :))
+  ENDIF
 
-      ijb=ij_begin
-      ije=ij_end
-      jjn=jj_nb
-     CALL writefield_dyn_u('THETA', teta(ijb:ije,:))
+  !  Temperature potentielle moyennee
 
-!  Temperature moyennee
+  ijb = ij_begin
+  ije = ij_end
+  jjn = jj_nb
+  CALL writefield_dyn_u('THETA', teta(ijb:ije, :))
 
-!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)       
-      do ll=1,llm
-        do ii = ijb, ije
-          tm(ii,ll) = teta(ii,ll) * ppk(ii,ll)/cpp
-        enddo
-      enddo
-!$OMP ENDDO
-      CALL writefield_dyn_u('TEMP', tm(ijb:ije,:))
+  !  Temperature moyennee
 
-!  Geopotentiel
+  !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
+  do ll = 1, llm
+    do ii = ijb, ije
+      tm(ii, ll) = teta(ii, ll) * ppk(ii, ll) / cpp
+    enddo
+  enddo
+  !$OMP ENDDO
+  CALL writefield_dyn_u('TEMP', tm(ijb:ije, :))
 
-      CALL writefield_dyn_u('PHI', phi(ijb:ije,:))
+  !  Geopotentiel
 
-! Tracers?
+  CALL writefield_dyn_u('PHI', phi(ijb:ije, :))
 
-!        DO iq=1,nqtot
-!        ENDDO
+  ! Tracers?
 
-!  Masse
+  !        DO iq=1,nqtot
+  !        ENDDO
 
-      CALL writefield_dyn_u('MASSE', masse(ijb:ije,:))
+  !  Masse
 
-!  Pression au sol
+  CALL writefield_dyn_u('MASSE', masse(ijb:ije, :))
 
-      CALL writefield_dyn_u('PS', ps(ijb:ije))
+  !  Pression au sol
 
-      END
+  CALL writefield_dyn_u('PS', ps(ijb:ije))
+
+END
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writedynav_loc.f90	(revision 5114)
@@ -1,7 +1,6 @@
-
 ! $Id: writedynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
 
-SUBROUTINE writedynav_loc( time, vcov, ucov,teta,ppk,phi,q, &
-        masse,ps,phis)
+SUBROUTINE writedynav_loc(time, vcov, ucov, teta, ppk, phi, q, &
+        masse, ps, phis)
 
   ! This routine needs IOIPSL
@@ -10,7 +9,8 @@
   USE misc_mod
   USE infotrac, ONLY: nqtot
-  use com_io_dyn_mod, ONLY: histaveid,histvaveid,histuaveid
+  use com_io_dyn_mod, ONLY: histaveid, histvaveid, histuaveid
   USE comconst_mod, ONLY: cpp
   USE temps_mod, ONLY: itau_dyn
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -45,5 +45,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 
@@ -52,10 +51,10 @@
   !
 
-  REAL :: vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm)
-  REAL :: teta(ijb_u:ije_u,llm),phi(ijb_u:ije_u,llm)
-  REAL :: ppk(ijb_u:ije_u,llm)
-  REAL :: ps(ijb_u:ije_u),masse(ijb_u:ije_u,llm)
+  REAL :: vcov(ijb_v:ije_v, llm), ucov(ijb_u:ije_u, llm)
+  REAL :: teta(ijb_u:ije_u, llm), phi(ijb_u:ije_u, llm)
+  REAL :: ppk(ijb_u:ije_u, llm)
+  REAL :: ps(ijb_u:ije_u), masse(ijb_u:ije_u, llm)
   REAL :: phis(ijb_u:ije_u)
-  REAL :: q(ijb_u:ije_u,llm,nqtot)
+  REAL :: q(ijb_u:ije_u, llm, nqtot)
   integer :: time
 
@@ -64,13 +63,13 @@
   !   Variables locales
   !
-  INTEGER,SAVE,ALLOCATABLE :: ndex2d(:),ndexu(:),ndexv(:)
+  INTEGER, SAVE, ALLOCATABLE :: ndex2d(:), ndexu(:), ndexv(:)
   INTEGER :: iq, ii, ll
-  REAL,SAVE,ALLOCATABLE :: tm(:,:)
-  REAL,SAVE,ALLOCATABLE :: vnat(:,:),unat(:,:)
+  REAL, SAVE, ALLOCATABLE :: tm(:, :)
+  REAL, SAVE, ALLOCATABLE :: vnat(:, :), unat(:, :)
   logical :: ok_sync
   integer :: itau_w
-  integer :: ijb,ije,jjn
-  LOGICAL,SAVE :: first=.TRUE.
-!$OMP THREADPRIVATE(first)
+  integer :: ijb, ije, jjn
+  LOGICAL, SAVE :: first = .TRUE.
+  !$OMP THREADPRIVATE(first)
 
   !
@@ -80,18 +79,18 @@
 
   IF (first) THEN
-!$OMP BARRIER
-!$OMP MASTER
-    ALLOCATE(unat(ijb_u:ije_u,llm))
-    ALLOCATE(vnat(ijb_v:ije_v,llm))
-    ALLOCATE(tm(ijb_u:ije_u,llm))
-    ALLOCATE(ndex2d(ijnb_u*llm))
-    ALLOCATE(ndexu(ijnb_u*llm))
-    ALLOCATE(ndexv(ijnb_v*llm))
+    !$OMP BARRIER
+    !$OMP MASTER
+    ALLOCATE(unat(ijb_u:ije_u, llm))
+    ALLOCATE(vnat(ijb_v:ije_v, llm))
+    ALLOCATE(tm(ijb_u:ije_u, llm))
+    ALLOCATE(ndex2d(ijnb_u * llm))
+    ALLOCATE(ndexu(ijnb_u * llm))
+    ALLOCATE(ndexv(ijnb_v * llm))
     ndex2d = 0
     ndexu = 0
     ndexv = 0
-!$OMP END MASTER
-!$OMP BARRIER
-    first=.FALSE.
+    !$OMP END MASTER
+    !$OMP BARRIER
+    first = .FALSE.
   ENDIF
 
@@ -108,25 +107,25 @@
   !
 
-!$OMP BARRIER
-!$OMP MASTER
-  ijb=ij_begin
-  ije=ij_end
-  jjn=jj_nb
-
-  CALL histwrite(histuaveid, 'u', itau_w, unat(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP BARRIER
+  !$OMP MASTER
+  ijb = ij_begin
+  ije = ij_end
+  jjn = jj_nb
+
+  CALL histwrite(histuaveid, 'u', itau_w, unat(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
   !
   !  Vents V
   !
-  ije=ij_end
-  if (pole_sud) jjn=jj_nb-1
-  if (pole_sud) ije=ij_end-iip1
-!$OMP BARRIER
-!$OMP MASTER
-  CALL histwrite(histvaveid, 'v', itau_w, vnat(ijb:ije,:), &
-        iip1*jjn*llm, ndexv)
-!$OMP END MASTER
+  ije = ij_end
+  if (pole_sud) jjn = jj_nb - 1
+  if (pole_sud) ije = ij_end - iip1
+  !$OMP BARRIER
+  !$OMP MASTER
+  CALL histwrite(histvaveid, 'v', itau_w, vnat(ijb:ije, :), &
+          iip1 * jjn * llm, ndexv)
+  !$OMP END MASTER
 
 
@@ -134,11 +133,11 @@
   !  Temperature potentielle moyennee
   !
-  ijb=ij_begin
-  ije=ij_end
-  jjn=jj_nb
-!$OMP MASTER
-  CALL histwrite(histaveid, 'theta', itau_w, teta(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  ijb = ij_begin
+  ije = ij_end
+  jjn = jj_nb
+  !$OMP MASTER
+  CALL histwrite(histaveid, 'theta', itau_w, teta(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
   !
@@ -146,16 +145,16 @@
   !
 
-!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
-  do ll=1,llm
+  !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
+  do ll = 1, llm
     do ii = ijb, ije
-      tm(ii,ll) = teta(ii,ll) * ppk(ii,ll)/cpp
+      tm(ii, ll) = teta(ii, ll) * ppk(ii, ll) / cpp
     enddo
   enddo
-!$OMP ENDDO
-
-!$OMP MASTER
-  CALL histwrite(histaveid, 'temp', itau_w, tm(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP ENDDO
+
+  !$OMP MASTER
+  CALL histwrite(histaveid, 'temp', itau_w, tm(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
 
@@ -163,8 +162,8 @@
   !  Geopotentiel
   !
-!$OMP MASTER
-  CALL histwrite(histaveid, 'phi', itau_w, phi(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP MASTER
+  CALL histwrite(histaveid, 'phi', itau_w, phi(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
 
@@ -183,8 +182,8 @@
   !  Masse
   !
-!$OMP MASTER
-   CALL histwrite(histaveid, 'masse', itau_w, masse(ijb:ije,:), &
-         iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP MASTER
+  CALL histwrite(histaveid, 'masse', itau_w, masse(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
 
@@ -192,27 +191,27 @@
   !  Pression au sol
   !
-!$OMP MASTER
-
-   CALL histwrite(histaveid, 'ps', itau_w, ps(ijb:ije), &
-         iip1*jjn, ndex2d)
-!$OMP END MASTER
+  !$OMP MASTER
+
+  CALL histwrite(histaveid, 'ps', itau_w, ps(ijb:ije), &
+          iip1 * jjn, ndex2d)
+  !$OMP END MASTER
 
   !
   !  Geopotentiel au sol
   !
-!$OMP MASTER
-    ! CALL histwrite(histaveid, 'phis', itau_w, phis(ijb:ije),
+  !$OMP MASTER
+  ! CALL histwrite(histaveid, 'phis', itau_w, phis(ijb:ije),
   ! .                 iip1*jjn, ndex2d)
-!$OMP END MASTER
+  !$OMP END MASTER
 
   !
   !  Fin
   !
-!$OMP MASTER
+  !$OMP MASTER
   if (ok_sync) then
-      CALL histsync(histaveid)
-      CALL histsync(histvaveid)
-      CALL histsync(histuaveid)
+    CALL histsync(histaveid)
+    CALL histsync(histvaveid)
+    CALL histsync(histuaveid)
   ENDIF
-!$OMP END MASTER
+  !$OMP END MASTER
 end subroutine writedynav_loc
Index: LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.f90
===================================================================
--- LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.f90	(revision 5113)
+++ LMDZ6/branches/Amaury_dev/libf/dyn3dmem/writehist_loc.f90	(revision 5114)
@@ -1,16 +1,13 @@
-
 ! $Id: writedynav_p.F 1279 2009-12-10 09:02:56Z fairhead $
 
-SUBROUTINE writehist_loc( time, vcov, ucov,teta,ppk,phi,q, &
-        masse,ps,phis)
-
-  ! This routine needs IOIPSL
+SUBROUTINE writehist_loc(time, vcov, ucov, teta, ppk, phi, q, masse, ps, phis)
   USE ioipsl
   USE parallel_lmdz
   USE misc_mod
   USE infotrac, ONLY: nqtot
-  use com_io_dyn_mod, ONLY: histid,histvid,histuid
+  use com_io_dyn_mod, ONLY: histid, histvid, histuid
   USE comconst_mod, ONLY: cpp
   USE temps_mod, ONLY: itau_dyn
+  USE lmdz_description, ONLY: descript
 
   IMPLICIT NONE
@@ -45,5 +42,4 @@
   include "paramet.h"
   include "comgeom.h"
-  include "description.h"
   include "iniprint.h"
 
@@ -52,10 +48,10 @@
   !
 
-  REAL :: vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm)
-  REAL :: teta(ijb_u:ije_u,llm),phi(ijb_u:ije_u,llm)
-  REAL :: ppk(ijb_u:ije_u,llm)
-  REAL :: ps(ijb_u:ije_u),masse(ijb_u:ije_u,llm)
+  REAL :: vcov(ijb_v:ije_v, llm), ucov(ijb_u:ije_u, llm)
+  REAL :: teta(ijb_u:ije_u, llm), phi(ijb_u:ije_u, llm)
+  REAL :: ppk(ijb_u:ije_u, llm)
+  REAL :: ps(ijb_u:ije_u), masse(ijb_u:ije_u, llm)
   REAL :: phis(ijb_u:ije_u)
-  REAL :: q(ijb_u:ije_u,llm,nqtot)
+  REAL :: q(ijb_u:ije_u, llm, nqtot)
   integer :: time
 
@@ -64,13 +60,13 @@
   !   Variables locales
   !
-  INTEGER,SAVE,ALLOCATABLE :: ndex2d(:),ndexu(:),ndexv(:)
+  INTEGER, SAVE, ALLOCATABLE :: ndex2d(:), ndexu(:), ndexv(:)
   INTEGER :: iq, ii, ll
-  REAL,SAVE,ALLOCATABLE :: tm(:,:)
-  REAL,SAVE,ALLOCATABLE :: vnat(:,:),unat(:,:)
+  REAL, SAVE, ALLOCATABLE :: tm(:, :)
+  REAL, SAVE, ALLOCATABLE :: vnat(:, :), unat(:, :)
   logical :: ok_sync
   integer :: itau_w
-  integer :: ijb,ije,jjn
-  LOGICAL,SAVE :: first=.TRUE.
-!$OMP THREADPRIVATE(first)
+  integer :: ijb, ije, jjn
+  LOGICAL, SAVE :: first = .TRUE.
+  !$OMP THREADPRIVATE(first)
 
   !
@@ -80,18 +76,18 @@
 
   IF (first) THEN
-!$OMP BARRIER
-!$OMP MASTER
-    ALLOCATE(unat(ijb_u:ije_u,llm))
-    ALLOCATE(vnat(ijb_v:ije_v,llm))
-    ALLOCATE(tm(ijb_u:ije_u,llm))
-    ALLOCATE(ndex2d(ijnb_u*llm))
-    ALLOCATE(ndexu(ijnb_u*llm))
-    ALLOCATE(ndexv(ijnb_v*llm))
+    !$OMP BARRIER
+    !$OMP MASTER
+    ALLOCATE(unat(ijb_u:ije_u, llm))
+    ALLOCATE(vnat(ijb_v:ije_v, llm))
+    ALLOCATE(tm(ijb_u:ije_u, llm))
+    ALLOCATE(ndex2d(ijnb_u * llm))
+    ALLOCATE(ndexu(ijnb_u * llm))
+    ALLOCATE(ndexv(ijnb_v * llm))
     ndex2d = 0
     ndexu = 0
     ndexv = 0
-!$OMP END MASTER
-!$OMP BARRIER
-    first=.FALSE.
+    !$OMP END MASTER
+    !$OMP BARRIER
+    first = .FALSE.
   ENDIF
 
@@ -108,25 +104,25 @@
   !
 
-!$OMP BARRIER
-!$OMP MASTER
-  ijb=ij_begin
-  ije=ij_end
-  jjn=jj_nb
-
-  CALL histwrite(histuid, 'u', itau_w, unat(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP BARRIER
+  !$OMP MASTER
+  ijb = ij_begin
+  ije = ij_end
+  jjn = jj_nb
+
+  CALL histwrite(histuid, 'u', itau_w, unat(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
   !
   !  Vents V
   !
-  ije=ij_end
-  if (pole_sud) jjn=jj_nb-1
-  if (pole_sud) ije=ij_end-iip1
-!$OMP BARRIER
-!$OMP MASTER
-  CALL histwrite(histvid, 'v', itau_w, vnat(ijb:ije,:), &
-        iip1*jjn*llm, ndexv)
-!$OMP END MASTER
+  ije = ij_end
+  if (pole_sud) jjn = jj_nb - 1
+  if (pole_sud) ije = ij_end - iip1
+  !$OMP BARRIER
+  !$OMP MASTER
+  CALL histwrite(histvid, 'v', itau_w, vnat(ijb:ije, :), &
+          iip1 * jjn * llm, ndexv)
+  !$OMP END MASTER
 
 
@@ -134,11 +130,11 @@
   !  Temperature potentielle
   !
-  ijb=ij_begin
-  ije=ij_end
-  jjn=jj_nb
-!$OMP MASTER
-  CALL histwrite(histid, 'theta', itau_w, teta(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  ijb = ij_begin
+  ije = ij_end
+  jjn = jj_nb
+  !$OMP MASTER
+  CALL histwrite(histid, 'theta', itau_w, teta(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
   !
@@ -146,16 +142,16 @@
   !
 
-!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
-  do ll=1,llm
+  !$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
+  do ll = 1, llm
     do ii = ijb, ije
-      tm(ii,ll) = teta(ii,ll) * ppk(ii,ll)/cpp
+      tm(ii, ll) = teta(ii, ll) * ppk(ii, ll) / cpp
     enddo
   enddo
-!$OMP ENDDO
-
-!$OMP MASTER
-  CALL histwrite(histid, 'temp', itau_w, tm(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP ENDDO
+
+  !$OMP MASTER
+  CALL histwrite(histid, 'temp', itau_w, tm(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
 
@@ -163,8 +159,8 @@
   !  Geopotentiel
   !
-!$OMP MASTER
-  CALL histwrite(histid, 'phi', itau_w, phi(ijb:ije,:), &
-        iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP MASTER
+  CALL histwrite(histid, 'phi', itau_w, phi(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
 
@@ -183,8 +179,8 @@
   !  Masse
   !
-!$OMP MASTER
-   CALL histwrite(histid, 'masse', itau_w, masse(ijb:ije,:), &
-         iip1*jjn*llm, ndexu)
-!$OMP END MASTER
+  !$OMP MASTER
+  CALL histwrite(histid, 'masse', itau_w, masse(ijb:ije, :), &
+          iip1 * jjn * llm, ndexu)
+  !$OMP END MASTER
 
 
@@ -192,21 +188,21 @@
   !  Pression au sol
   !
-!$OMP MASTER
-   CALL histwrite(histid, 'ps', itau_w, ps(ijb:ije), &
-         iip1*jjn, ndex2d)
-!$OMP END MASTER
+  !$OMP MASTER
+  CALL histwrite(histid, 'ps', itau_w, ps(ijb:ije), &
+          iip1 * jjn, ndex2d)
+  !$OMP END MASTER
 
   !
   !  Geopotentiel au sol
   !
-!$OMP MASTER
-    ! CALL histwrite(histid, 'phis', itau_w, phis(ijb:ije),
+  !$OMP MASTER
+  ! CALL histwrite(histid, 'phis', itau_w, phis(ijb:ije),
   ! .                 iip1*jjn, ndex2d)
-!$OMP END MASTER
+  !$OMP END MASTER
 
   !
   !  Fin
   !
-!$OMP MASTER
+  !$OMP MASTER
   if (ok_sync) then
     CALL histsync(histid)
@@ -214,4 +210,4 @@
     CALL histsync(histuid)
   endif
-!$OMP END MASTER
+  !$OMP END MASTER
 end subroutine writehist_loc
