Index: LMDZ5/trunk/libf/phylmd/iophy.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/iophy.F90	(revision 1791)
+++ LMDZ5/trunk/libf/phylmd/iophy.F90	(revision 1797)
@@ -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
@@ -24,18 +24,25 @@
 
 
-contains
-
-  subroutine init_iophy_new(rlat,rlon)
+CONTAINS
+
+! ug Routine pour définir itau_iophy depuis phys_output_write_mod:
+  SUBROUTINE set_itau_iophy(ito)
+      IMPLICIT NONE
+      INTEGER, INTENT(IN) :: ito
+      itau_iophy = ito
+  END SUBROUTINE
+
+  SUBROUTINE init_iophy_new(rlat,rlon)
   USE dimphy
   USE mod_phys_lmdz_para
   USE mod_grid_phy_lmdz
   USE ioipsl
-  implicit none
-  include 'dimensions.h'   
-    real,dimension(klon),intent(in) :: rlon
-    real,dimension(klon),intent(in) :: rlat
-
-    REAL,dimension(klon_glo)        :: rlat_glo
-    REAL,dimension(klon_glo)        :: rlon_glo
+  IMPLICIT NONE
+  INCLUDE 'dimensions.h'   
+    REAL,DIMENSION(klon),INTENT(IN) :: rlon
+    REAL,DIMENSION(klon),INTENT(IN) :: rlat
+
+    REAL,DIMENSION(klon_glo)        :: rlat_glo
+    REAL,DIMENSION(klon_glo)        :: rlon_glo
     
     INTEGER,DIMENSION(2) :: ddid
@@ -72,25 +79,25 @@
     dpl=(/ iim, jj_end /)
     dhs=(/ ii_begin-1,0 /)
-    if (mpi_rank==mpi_size-1) then
+    IF (mpi_rank==mpi_size-1) THEN
       dhe=(/0,0/)
-    else
+    ELSE
       dhe=(/ iim-ii_end,0 /)  
-    endif
-    
-    call flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
+    ENDIF
+    
+    CALL flio_dom_set(mpi_size,mpi_rank,ddid,dsg,dsl,dpf,dpl,dhs,dhe, &
                       'APPLE',phys_domain_id)
 
 !$OMP END MASTER
       
-  end subroutine init_iophy_new
-
-  subroutine init_iophy(lat,lon)
-  USE dimphy
-  USE mod_phys_lmdz_para
-  use ioipsl
-  implicit none
-  include 'dimensions.h'   
-    real,dimension(iim),intent(in) :: lon
-    real,dimension(jjm+1-1/(iim*jjm)),intent(in) :: lat
+  END SUBROUTINE init_iophy_new
+
+  SUBROUTINE init_iophy(lat,lon)
+  USE dimphy
+  USE mod_phys_lmdz_para
+  USE ioipsl
+  IMPLICIT NONE
+  INCLUDE 'dimensions.h'   
+    REAL,DIMENSION(iim),INTENT(IN) :: lon
+    REAL,DIMENSION(jjm+1-1/(iim*jjm)),INTENT(IN) :: lat
 
     INTEGER,DIMENSION(2) :: ddid
@@ -125,18 +132,18 @@
 !$OMP END MASTER
       
-  end subroutine init_iophy
-  
-  subroutine histbeg_phy(name,itau0,zjulian,dtime,nhori,nid_day)
+  end SUBROUTINE init_iophy
+  
+  SUBROUTINE histbeg_phy(name,itau0,zjulian,dtime,nhori,nid_day)
   USE dimphy
   USE mod_phys_lmdz_para
   use ioipsl
   use write_field
-  implicit none
+  IMPLICIT NONE
   include 'dimensions.h'
     
-    character*(*), intent(IN) :: name
-    integer, intent(in) :: itau0
-    real,intent(in) :: zjulian
-    real,intent(in) :: dtime
+    character*(*), INTENT(IN) :: name
+    integer, INTENT(IN) :: itau0
+    REAL,INTENT(IN) :: zjulian
+    REAL,INTENT(IN) :: dtime
     integer,intent(out) :: nhori
     integer,intent(out) :: nid_day
@@ -152,7 +159,7 @@
 !$OMP END MASTER
   
-  end subroutine histbeg_phy
-
-  subroutine histbeg_phy_points(rlon,rlat,pim,tabij,ipt,jpt, &
+  END SUBROUTINE histbeg_phy
+
+  SUBROUTINE histbeg_phy_points(rlon,rlat,pim,tabij,ipt,jpt, &
              plon,plat,plon_bounds,plat_bounds, &
              nname,itau0,zjulian,dtime,nnhori,nnid_day)
@@ -162,23 +169,23 @@
   use ioipsl
   use write_field
-  implicit none
+  IMPLICIT NONE
   include 'dimensions.h' 
 
-    real,dimension(klon),intent(in) :: rlon
-    real,dimension(klon),intent(in) :: rlat
-    integer, intent(in) :: itau0
-    real,intent(in) :: zjulian
-    real,intent(in) :: dtime
-    integer, intent(in) :: pim
+    REAL,DIMENSION(klon),INTENT(IN) :: rlon
+    REAL,DIMENSION(klon),INTENT(IN) :: rlat
+    integer, INTENT(IN) :: itau0
+    REAL,INTENT(IN) :: zjulian
+    REAL,INTENT(IN) :: dtime
+    integer, INTENT(IN) :: pim
     integer, intent(out) :: nnhori
-    character(len=20), intent(in) :: nname
+    character(len=20), INTENT(IN) :: nname
     INTEGER, intent(out) :: nnid_day
     integer :: i
-    REAL,dimension(klon_glo)        :: rlat_glo
-    REAL,dimension(klon_glo)        :: rlon_glo
-    INTEGER, DIMENSION(pim), intent(in)  :: tabij
-    REAL,dimension(pim), intent(in) :: plat, plon
-    INTEGER,dimension(pim), intent(in) :: ipt, jpt
-    REAL,dimension(pim,2), intent(out) :: plat_bounds, plon_bounds
+    REAL,DIMENSION(klon_glo)        :: rlat_glo
+    REAL,DIMENSION(klon_glo)        :: rlon_glo
+    INTEGER, DIMENSION(pim), INTENT(IN)  :: tabij
+    REAL,DIMENSION(pim), INTENT(IN) :: plat, plon
+    INTEGER,DIMENSION(pim), INTENT(IN) :: ipt, jpt
+    REAL,DIMENSION(pim,2), intent(out) :: plat_bounds, plon_bounds
 
     INTEGER, SAVE :: tabprocbeg, tabprocend
@@ -187,8 +194,8 @@
     INTEGER, PARAMETER :: nip=1
     INTEGER :: npproc
-    REAL, allocatable, dimension(:) :: npplat, npplon
-    REAL, allocatable, dimension(:,:) :: npplat_bounds, npplon_bounds
+    REAL, allocatable, DIMENSION(:) :: npplat, npplon
+    REAL, allocatable, DIMENSION(:,:) :: npplat_bounds, npplon_bounds
     INTEGER, PARAMETER :: jjmp1=jjm+1-1/jjm
-    REAL, dimension(iim,jjmp1) :: zx_lon, zx_lat
+    REAL, DIMENSION(iim,jjmp1) :: zx_lon, zx_lat
 
     CALL gather(rlat,rlat_glo)
@@ -323,5 +330,5 @@
 !$OMP END MASTER
 
-  end subroutine histbeg_phy_points
+  end SUBROUTINE histbeg_phy_points
  
   SUBROUTINE histwrite2d_phy_old(nid,lpoint,name,itau,field)
@@ -334,18 +341,18 @@
   include 'iniprint.h'
     
-    integer,intent(in) :: nid
-    logical,intent(in) :: lpoint 
-    character*(*), intent(IN) :: name
-    integer, intent(in) :: itau
-    real,dimension(:),intent(in) :: field
-    REAL,dimension(klon_mpi) :: buffer_omp
-    INTEGER, allocatable, dimension(:) :: index2d
+    integer,INTENT(IN) :: nid
+    logical,INTENT(IN) :: lpoint 
+    character*(*), INTENT(IN) :: name
+    integer, INTENT(IN) :: itau
+    REAL,DIMENSION(:),INTENT(IN) :: field
+    REAL,DIMENSION(klon_mpi) :: buffer_omp
+    INTEGER, allocatable, DIMENSION(:) :: index2d
     REAL :: Field2d(iim,jj_nb)
 
     integer :: ip
-    real,allocatable,dimension(:) :: fieldok
-
-
-    IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first dimension not equal to klon',1)
+    REAL,allocatable,DIMENSION(:) :: fieldok
+
+
+    IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first DIMENSION not equal to klon',1)
     
     CALL Gather_omp(field,buffer_omp)    
@@ -387,7 +394,7 @@
 
  
-  end subroutine histwrite2d_phy_old
-
-  subroutine histwrite3d_phy_old(nid,lpoint,name,itau,field)
+  end SUBROUTINE histwrite2d_phy_old
+
+  SUBROUTINE histwrite3d_phy_old(nid,lpoint,name,itau,field)
   USE dimphy
   USE mod_phys_lmdz_para
@@ -395,21 +402,21 @@
 
   use ioipsl
-  implicit none
+  IMPLICIT NONE
   include 'dimensions.h'
   include 'iniprint.h'
     
-    integer,intent(in) :: nid
-    logical,intent(in) :: lpoint
-    character*(*), intent(IN) :: name
-    integer, intent(in) :: itau
-    real,dimension(:,:),intent(in) :: field  ! --> field(klon,:)
-    REAL,dimension(klon_mpi,size(field,2)) :: buffer_omp
+    integer,INTENT(IN) :: nid
+    logical,INTENT(IN) :: lpoint
+    character*(*), INTENT(IN) :: name
+    integer, INTENT(IN) :: itau
+    REAL,DIMENSION(:,:),INTENT(IN) :: field  ! --> field(klon,:)
+    REAL,DIMENSION(klon_mpi,size(field,2)) :: buffer_omp
     REAL :: Field3d(iim,jj_nb,size(field,2))
     INTEGER :: ip, n, nlev
-    INTEGER, ALLOCATABLE, dimension(:) :: index3d
-    real,allocatable, dimension(:,:) :: fieldok
-
-
-    IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first dimension not equal to klon',1)
+    INTEGER, ALLOCATABLE, DIMENSION(:) :: index3d
+    REAL,allocatable, DIMENSION(:,:) :: fieldok
+
+
+    IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)
     nlev=size(field,2)
 
@@ -460,5 +467,5 @@
 !$OMP END MASTER    
 
-  end subroutine histwrite3d_phy_old
+  end SUBROUTINE histwrite3d_phy_old
 
 
@@ -480,9 +487,9 @@
   include 'dimensions.h'
     
-!    integer,intent(in) :: nid
-!    logical,intent(in) :: lpoint 
-!    character*(*), intent(IN) :: name
-!    integer, intent(in) :: itau
-!    real,dimension(:),intent(in) :: field
+!    integer,INTENT(IN) :: nid
+!    logical,INTENT(IN) :: lpoint 
+!    character*(*), INTENT(IN) :: name
+!    integer, INTENT(IN) :: itau
+!    REAL,DIMENSION(:),INTENT(IN) :: field
 
       TYPE(ctrl_out), INTENT(IN) :: var
@@ -492,6 +499,6 @@
       INTEGER :: iff, iff_beg, iff_end
       
-    REAL,dimension(klon_mpi) :: buffer_omp
-    INTEGER, allocatable, dimension(:) :: index2d
+    REAL,DIMENSION(klon_mpi) :: buffer_omp
+    INTEGER, allocatable, DIMENSION(:) :: index2d
     REAL :: Field2d(iim,jj_nb)
 
@@ -508,5 +515,5 @@
       END IF
 
-    IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first dimension not equal to klon',1)
+    IF (size(field)/=klon) CALL abort_gcm('iophy::histwrite2d','Field first DIMENSION not equal to klon',1)
     
     CALL Gather_omp(field,buffer_omp)    
@@ -578,9 +585,9 @@
   include 'dimensions.h'
     
-!    integer,intent(in) :: nid
-!    logical,intent(in) :: lpoint
-!    character*(*), intent(IN) :: name
-!    integer, intent(in) :: itau
-!    real,dimension(:,:),intent(in) :: field  ! --> field(klon,:)
+!    integer,INTENT(IN) :: nid
+!    logical,INTENT(IN) :: lpoint
+!    character*(*), INTENT(IN) :: name
+!    integer, INTENT(IN) :: itau
+!    REAL,DIMENSION(:,:),INTENT(IN) :: field  ! --> field(klon,:)
 
       TYPE(ctrl_out), INTENT(IN) :: var
@@ -594,5 +601,5 @@
     REAL,ALLOCATABLE, DIMENSION(:,:) :: fieldok
 
-    IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first dimension not equal to klon',1)
+    IF (size(field,1)/=klon) CALL abort_gcm('iophy::histwrite3d','Field first DIMENSION not equal to klon',1)
     nlev=size(field,2)
 
