Index: trunk/LMDZ.VENUS/libf/phyvenus/iostart.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/iostart.F90	(revision 3714)
+++ trunk/LMDZ.VENUS/libf/phyvenus/iostart.F90	(revision 3719)
@@ -4,6 +4,8 @@
     INTEGER,SAVE :: nid_start 
     INTEGER,SAVE :: nid_restart
-    
+!$OMP THREADPRIVATE(nid_start,nid_restart)    
+
     INTEGER,SAVE :: idim1,idim2,idim3,idim4
+!$OMP THREADPRIVATE(idim1,idim2,idim3,idim4)
     INTEGER,PARAMETER :: length=100
     
@@ -30,16 +32,16 @@
 
   SUBROUTINE open_startphy(filename)
-  USE netcdf
-  USE mod_phys_lmdz_para
-  IMPLICIT NONE
-    CHARACTER(LEN=*) :: filename
+  USE netcdf, ONLY: NF90_OPEN, nf90_strerror, NF90_NOWRITE, NF90_NOERR
+  USE mod_phys_lmdz_para, ONLY: is_master
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: filename
     INTEGER          :: ierr
 
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
       ierr = NF90_OPEN (filename, NF90_NOWRITE,nid_start)
       IF (ierr.NE.NF90_NOERR) THEN
-        write(6,*)' Pb d''ouverture du fichier '//filename
-        write(6,*)' ierr = ', ierr
-        CALL ABORT
+        write(*,*)'open_startphy: problem opening file '//trim(filename)
+        write(*,*)trim(nf90_strerror(ierr))
+        CALL abort_physic("open_startphy","Cannot open file",1)
       ENDIF
     ENDIF
@@ -48,10 +50,10 @@
 
   SUBROUTINE Close_startphy
-  USE netcdf
-  USE mod_phys_lmdz_para
+  USE netcdf, ONLY: NF90_CLOSE
+  USE mod_phys_lmdz_para, ONLY: is_master
   IMPLICIT NONE
     INTEGER          :: ierr
 
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
         ierr = NF90_CLOSE (nid_start)
     ENDIF
@@ -61,13 +63,13 @@
 
   FUNCTION Inquire_Field(Field_name)
-  USE netcdf
-  USE mod_phys_lmdz_para
-  IMPLICIT NONE
-    CHARACTER(LEN=*) :: Field_name
+  USE netcdf, ONLY: NF90_INQ_VARID, NF90_NOERR
+  USE mod_phys_lmdz_para, only: is_master, bcast
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: Field_name
     LOGICAL :: inquire_field
     INTEGER :: varid
     INTEGER :: ierr
     
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
       ierr=NF90_INQ_VARID(nid_start,Field_name,varid)
       IF (ierr==NF90_NOERR) THEN
@@ -127,25 +129,31 @@
   
   SUBROUTINE Get_field_rgen(field_name,field,field_size,found)
-  USE netcdf
-  USE dimphy
-  USE mod_grid_phy_lmdz
-  USE mod_phys_lmdz_para
-  IMPLICIT NONE
-    CHARACTER(LEN=*) :: Field_name
-    INTEGER          :: field_size
-    REAL             :: field(klon,field_size)
-    LOGICAL,OPTIONAL :: found
-    
-    REAL    :: field_glo(klon_glo,field_size)
+  USE netcdf, ONLY: NF90_INQ_VARID, NF90_GET_VAR, NF90_NOERR
+  USE dimphy, ONLY: klon ! number of columns on local grid
+  USE geometry_mod, ONLY: ind_cell_glo
+  USE mod_grid_phy_lmdz, ONLY: klon_glo ! number of columns on global grid
+  USE mod_phys_lmdz_para, ONLY: is_master, bcast, scatter, gather
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: Field_name
+    INTEGER,INTENT(IN) :: field_size
+    REAL,INTENT(OUT) :: field(klon,field_size)
+    LOGICAL,OPTIONAL,INTENT(OUT) :: found
+    
+    REAL    :: field_glo(klon_glo,field_size) ! field on global grid
+    REAL :: field_glo_tmp(klon_glo,field_size)
+    INTEGER :: ind_cell_glo_glo(klon_glo) ! cell indexes on global grid
     LOGICAL :: tmp_found
     INTEGER :: varid
-    INTEGER :: ierr
-    
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    INTEGER :: ierr, i
+    
+    ! gather columns indexes on global grid
+    CALL gather(ind_cell_glo,ind_cell_glo_glo)
+
+    IF (is_master) THEN
   
       ierr=NF90_INQ_VARID(nid_start,Field_name,varid)
       
       IF (ierr==NF90_NOERR) THEN
-        CALL body(field_glo)
+        CALL body(field_glo_tmp)
         tmp_found=.TRUE.
       ELSE
@@ -153,9 +161,15 @@
       ENDIF
     
-    ENDIF
+    ENDIF ! of IF (is_master)
     
     CALL bcast(tmp_found)
 
     IF (tmp_found) THEN
+      IF (is_master) THEN
+        ! reorder columns according to ind_cell_glo(:) indexes
+        DO i=1,klon_glo
+          field_glo(i,:)=field_glo_tmp(ind_cell_glo_glo(i),:)
+        ENDDO
+      ENDIF
       CALL scatter(field_glo,field)
     ENDIF
@@ -165,6 +179,6 @@
     ELSE
       IF (.NOT. tmp_found) THEN
-        PRINT*, 'phyetat0: Le champ <'//field_name//'> est absent'
-        CALL abort
+        PRINT*, 'get_field_rgen: Field <'//field_name//'> not found'
+        CALL abort_physic("get_field_rgen","Failed to find field",1)
       ENDIF
     ENDIF
@@ -178,19 +192,19 @@
          IF (ierr/=NF90_NOERR) THEN
            ! La variable exist dans le fichier mais la lecture a echouee. 
-           PRINT*, 'phyetat0: Lecture echouee pour <'//field_name//'>'
-
-           IF (field_name=='CLWCON' .OR. field_name=='RNEBCON' .OR. field_name=='RATQS') THEN
-              ! Essaye de lire le variable sur surface uniqument, comme fait avant
-              field_glo(:)=0.
-              ierr=NF90_GET_VAR(nid_start,varid,field_glo(1:klon_glo))
-              IF (ierr/=NF90_NOERR) THEN
-                 PRINT*, 'phyetat0: Lecture echouee aussi en 2D pour <'//field_name//'>'
-                 CALL abort
-              ELSE
-                 PRINT*, 'phyetat0: La variable <'//field_name//'> lu sur surface seulement'!, selon ancien format, le reste mis a zero'
-              END IF
-           ELSE
-              CALL abort
-           ENDIF
+           PRINT*, 'get_field_rgen: Failed reading <'//field_name//'>'
+           ! It looks like the following is for Earth physics only...
+           !IF (field_name=='CLWCON' .OR. field_name=='RNEBCON' .OR. field_name=='RATQS') THEN
+           !   ! Essaye de lire le variable sur surface uniqument, comme fait avant
+           !   field_glo(:)=0.
+           !   ierr=NF90_GET_VAR(nid_start,varid,field_glo(1:klon_glo))
+           !   IF (ierr/=NF90_NOERR) THEN
+           !      PRINT*, 'phyetat0: Lecture echouee aussi en 2D pour <'//field_name//'>'
+           !      CALL abort
+           !   ELSE
+           !      PRINT*, 'phyetat0: La variable <'//field_name//'> lu sur surface seulement'!, selon ancien format, le reste mis a zero'
+           !   END IF
+           !ELSE
+          CALL abort_physic("get_field_rgen","Failed to read field",1)
+           !ENDIF
          ENDIF
 
@@ -260,13 +274,11 @@
 
   SUBROUTINE Get_var_rgen(var_name,var,var_size,found)
-  USE netcdf
-  USE dimphy
-  USE mod_grid_phy_lmdz
-  USE mod_phys_lmdz_para
-  IMPLICIT NONE
-    CHARACTER(LEN=*) :: var_name
-    INTEGER          :: var_size
-    REAL             :: var(var_size)
-    LOGICAL,OPTIONAL :: found
+  USE netcdf, ONLY: NF90_INQ_VARID, NF90_GET_VAR, NF90_NOERR
+  USE mod_phys_lmdz_para, ONLY: is_master, bcast
+  IMPLICIT NONE
+    CHARACTER(LEN=*),INTENT(IN) :: var_name
+    INTEGER,INTENT(IN) :: var_size
+    REAL,INTENT(OUT) :: var(var_size)
+    LOGICAL,OPTIONAL,INTENT(OUT) :: found
     
     LOGICAL :: tmp_found
@@ -274,5 +286,5 @@
     INTEGER :: ierr
     
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
   
       ierr=NF90_INQ_VARID(nid_start,var_name,varid)
@@ -281,6 +293,6 @@
         ierr=NF90_GET_VAR(nid_start,varid,var)
         IF (ierr/=NF90_NOERR) THEN
-          PRINT*, 'phyetat0: Lecture echouee pour <'//var_name//'>'
-          CALL abort
+          PRINT*, 'phyetat0: Failed loading <'//trim(var_name)//'>'
+          CALL abort_physic("get_var_rgen","Failed to read variable",1)
         ENDIF
         tmp_found=.TRUE.
@@ -301,6 +313,6 @@
     ELSE
       IF (.NOT. tmp_found) THEN
-        PRINT*, 'phyetat0: La variable champ <'//var_name//'> est absente'
-        CALL abort
+        PRINT*, 'phyetat0: Variable <'//trim(var_name)//'> not found'
+        CALL abort_physic("get_var_rgen","Failed to read variable",1)
       ENDIF
     ENDIF
@@ -310,18 +322,20 @@
 
   SUBROUTINE open_restartphy(filename)
-  USE netcdf
-  USE mod_phys_lmdz_para
-  USE mod_grid_phy_lmdz
-  USE dimphy
+  USE netcdf, ONLY: NF90_CREATE, NF90_CLOBBER, NF90_NOERR, nf90_strerror, &
+                    NF90_PUT_ATT, NF90_GLOBAL, NF90_DEF_DIM, &
+                    NF90_ENDDEF
+  USE mod_phys_lmdz_para,ONLY: is_master
+  USE mod_grid_phy_lmdz, ONLY: klon_glo
+  USE dimphy, ONLY: klev, klevp1
   IMPLICIT NONE
     CHARACTER(LEN=*),INTENT(IN) :: filename
     INTEGER                     :: ierr
     
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
       ierr = NF90_CREATE(filename, NF90_CLOBBER, nid_restart)
       IF (ierr/=NF90_NOERR) THEN
-        write(6,*)' Pb d''ouverture du fichier '//filename
-        write(6,*)' ierr = ', ierr
-        CALL ABORT
+          write(*,*)'open_restartphy: problem creating file '//trim(filename)
+          write(*,*)trim(nf90_strerror(ierr))
+          CALL abort_physic("open_restartphy","Failed creating file",1)
       ENDIF
 
@@ -339,10 +353,10 @@
   
   SUBROUTINE close_restartphy
-  USE netcdf
-  USE mod_phys_lmdz_para
+  USE netcdf, ONLY: NF90_CLOSE
+  USE mod_phys_lmdz_para, ONLY: is_master
   IMPLICIT NONE
     INTEGER          :: ierr
 
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
       ierr = NF90_CLOSE (nid_restart)
     ENDIF
@@ -382,8 +396,11 @@
   
   SUBROUTINE put_field_rgen(field_name,title,field,field_size)
-  USE netcdf
-  USE dimphy
-  USE mod_grid_phy_lmdz
-  USE mod_phys_lmdz_para
+  USE netcdf, ONLY: NF90_REDEF, NF90_ENDDEF, NF90_DEF_VAR, NF90_PUT_ATT, &
+                    NF90_PUT_VAR, NF90_FLOAT, NF90_DOUBLE
+  USE dimphy, ONLY: klon, klev, klevp1
+  USE mod_grid_phy_lmdz, ONLY: klon_glo
+  USE mod_phys_lmdz_para, ONLY: is_master, gather
+  USE geometry_mod, ONLY: ind_cell_glo
+
   IMPLICIT NONE
   CHARACTER(LEN=*),INTENT(IN)    :: field_name
@@ -392,14 +409,24 @@
   REAL,INTENT(IN)                :: field(klon,field_size)
   
-  REAL                           :: field_glo(klon_glo,field_size)
+  REAL :: field_glo(klon_glo,field_size)
+  REAL :: field_glo_tmp(klon_glo,field_size)
+  INTEGER :: ind_cell_glo_glo(klon_glo) ! cell indexes on global grid
+  
   INTEGER                        :: ierr
   INTEGER                        :: nvarid
   INTEGER                        :: idim
+  INTEGER :: i
    
-   
-    CALL gather(field,field_glo)
-    
-    IF (is_mpi_root .AND. is_omp_root) THEN
-
+    ! gather indexes on global grid
+    CALL gather(ind_cell_glo,ind_cell_glo_glo)
+    ! gather field on master
+    CALL gather(field,field_glo_tmp)
+    
+    IF (is_master) THEN
+      ! reorder columns
+      DO i=1,klon_glo
+        field_glo(ind_cell_glo_glo(i),:)=field_glo_tmp(i,:)
+      ENDDO
+      
       IF (field_size==1) THEN
         idim=idim2
@@ -409,6 +436,6 @@
         idim=idim4
       ELSE
-        PRINT *, "erreur phyredem : probleme de dimension"
-        CALL ABORT
+        WRITE(*,*)"put_field_rgen error: issue with dimensions"
+        CALL abort_physic("put_field_rgen","wrong field dimensions",1)
       ENDIF
          
@@ -471,7 +498,7 @@
 
   SUBROUTINE put_var_rgen(var_name,title,var,var_size)
-  USE netcdf
-  USE dimphy
-  USE mod_phys_lmdz_para
+  USE netcdf, ONLY: NF90_REDEF, NF90_DEF_VAR, NF90_ENDDEF, NF90_PUT_VAR, &
+                    NF90_PUT_ATT, NF90_FLOAT, NF90_DOUBLE
+  USE mod_phys_lmdz_para, ONLY: is_master
   IMPLICIT NONE
      CHARACTER(LEN=*),INTENT(IN) :: var_name
@@ -483,9 +510,9 @@
      INTEGER :: nvarid
          
-    IF (is_mpi_root .AND. is_omp_root) THEN
+    IF (is_master) THEN
 
       IF (var_size/=length) THEN
-        PRINT *, "erreur phyredem : probleme de dimension"
-        CALL abort
+        WRITE(*,*)"put_var_rgen error: issue with dimensions"
+        CALL abort_physic("put_var_rgen","wrong field dimensions",1)
       ENDIF
       
Index: trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90	(revision 3714)
+++ trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90	(revision 3719)
@@ -1,18 +1,22 @@
-!
-! $Id $
-!
+module phyetat0_mod
+
+implicit none
+
+contains
+
 subroutine phyetat0(fichnom)
 ! Load initial state for the physics
 ! and do some resulting initializations
 
-      USE dimphy
-      USE mod_grid_phy_lmdz
-      USE mod_phys_lmdz_para
-      USE iophy
-      USE phys_state_var_mod
-      USE iostart
-      use geometry_mod, only: longitude_deg, latitude_deg
-      USE time_phylmdz_mod, only: itau_phy, raz_date, pdtphys
-      USE ioipsl_getin_p_mod, only: getin_p
+  use dimphy, only: klon
+  use iophy, only: init_iophy_new
+  use phys_state_var_mod, only: ftsol, ftsoil, age, dlw, falbe, fder, q2, &
+                                radsol, sollw, sollwdown, solsw, &
+                                ancien_ok, t_ancien, &
+                                zmea, zgam, zpic, zsig, zstd, zthe, zval
+  use iostart, only: get_var, get_field, open_startphy, close_startphy
+  use geometry_mod, only: longitude_deg, latitude_deg
+  use time_phylmdz_mod, only: itau_phy, raz_date, pdtphys
+  use ioipsl_getin_p_mod, only: getin_p
   use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd, &
                                 east_gwstress, west_gwstress
@@ -20,8 +24,4 @@
 implicit none
 !======================================================================
-! Auteur(s) Z.X. Li (LMD/CNRS) date: 19930818
-! Objet: Lecture de l'etat initial pour la physique
-!======================================================================
-!include "netcdf.inc"
 include "dimsoil.h"
 include "clesphys.h"
@@ -36,6 +36,7 @@
 REAL :: lon_startphy(klon), lat_startphy(klon)
 REAL :: surface_albedo
-
-! les variables globales lues dans le fichier restart
+character(len=8) :: modname="phyetat0"
+
+! global variables read in startphy.nc file
 
 ! open physics initial state file:
@@ -50,6 +51,6 @@
   CALL get_var("controle",tab_cntrl,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <controle> est absent'
-    CALL abort
+    write(*,*) modname//': Field <controle> is missing'
+    call abort_physic(modname,"Missing <controle>",1)
   ENDIF
        
@@ -63,6 +64,6 @@
   itau_phy = tab_cntrl(15)
 
-! Attention si raz_date est active :
-! il faut remettre a zero itau_phy apres phyetat0 !
+! Warning, if raz_date is active :
+! itau_phy must be re-set to zero after phyetat0 !
   IF (raz_date.eq.1) THEN
     itau_phy=0
@@ -81,13 +82,13 @@
   call get_field("latitude",lat_startphy,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <latitude> est absent'
-    CALL abort
+    write(*,*) modname//':: Field <latitude> is missing'
+    call abort_physic(modname,"Missing <latitude>",1)
   ENDIF
   DO i=1,klon
     IF (ABS(lat_startphy(i)-latitude_deg(i))>=0.01) THEN
-      WRITE(*,*) "phyetat0: Warning! Latitude discrepancy wrt startphy file:",&
+      WRITE(*,*) modname//": Warning! Latitude discrepancy wrt startphy file:",&
                  " i=",i," lat_startphy(i)=",lat_startphy(i),&
                  " latitude_deg(i)=",latitude_deg(i)
-      CALL abort
+      call abort_physic(modname,"<latitude> values discrepency",1)
     ENDIF
   ENDDO
@@ -96,13 +97,13 @@
   call get_field("longitude",lon_startphy,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <longitude> est absent'
-    CALL abort
+    write(*,*)'phyetat0: Field <longitude> is missing'
+    call abort_physic(modname,"Missing <longitude>",1)
   ENDIF
   DO i=1,klon
     IF (ABS(lon_startphy(i)-longitude_deg(i))>=0.01) THEN
-      WRITE(*,*) "phyetat0: Warning! Longitude discrepancy wrt startphy file:",&
+      WRITE(*,*) modname//": Warning! Longitude discrepancy wrt startphy file:",&
                  " i=",i," lon_startphy(i)=",lon_startphy(i),&
                  " longitude_deg(i)=",longitude_deg(i)
-      CALL abort
+      call abort_physic(modname,"<latitude> values discrepency",1)
     ENDIF
   ENDDO
@@ -115,10 +116,9 @@
   CALL get_field("TS",ftsol(:),found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <TS> est absent'
-    PRINT*, "phyetat0: Lecture echouee pour <TS>"
-    CALL abort
+    WRITE(*,*) modname//": Field <TS> is missing"
+    call abort_physic(modname,"Missing <TS>",1)
   ELSE
-    PRINT*, 'phyetat0: Le champ <TS> est present'
-    PRINT*,'Temperature du sol <TS>', minval(ftsol), maxval(ftsol)
+    WRITE(*,*) modname//": Field <TS> is present"
+    WRITE(*,*) 'Surface temperature <TS>', minval(ftsol), maxval(ftsol)
   ENDIF
 ELSE
@@ -131,12 +131,12 @@
   DO isoil=1, nsoilmx
     IF (isoil.GT.99) THEN
-       PRINT*, "Trop de couches"
-       CALL abort
+       WRITE(*,*) "Too many layers!"
+       call abort_physic(modname,"Too many subsurface layers",1)
     ENDIF
     WRITE(str2,'(i2.2)') isoil
     CALL get_field('Tsoil'//str2,ftsoil(:,isoil),found)
     IF (.not.found) THEN
-      PRINT*, "phyetat0: Le champ <Tsoil"//str2//"> est absent"
-      PRINT*, "          Il prend donc la valeur de surface"
+      WRITE(*,*) modname//": Field <Tsoil"//str2//"> is missing"
+      WRITE(*,*) "           it will be nitialized with surface value"
       DO i=1, klon
              ftsoil(i,isoil)=ftsol(i)
@@ -153,7 +153,6 @@
   CALL get_field("ALBE", falbe,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ALBE> est absent'
-    PRINT*, "phyetat0: Lecture echouee pour <ALBE>"
-    CALL abort
+    WRITE(*,*) modname//": Field <ALBE> is missing"
+    call abort_physic(modname,"Missing <ALBE>",1)
   ENDIF
 ELSE
@@ -163,12 +162,12 @@
   falbe(:)=surface_albedo
 ENDIF ! of IF (startphy_file)
-PRINT*,'Albedo du sol <ALBE>', minval(falbe), maxval(falbe)
-
-IF (startphy_file) THEN
-  ! Lecture rayonnement solaire au sol:
+WRITE(*,*) 'Surface albedo <ALBE>', minval(falbe), maxval(falbe)
+
+IF (startphy_file) THEN
+  ! Solar flux to the surface:
   CALL get_field("solsw",solsw,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <solsw> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <solsw> is missing"
+    WRITE(*,*) "set to zero"
     solsw = 0.
   ENDIF
@@ -177,12 +176,12 @@
   solsw(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Rayonnement solaire au sol solsw:', minval(solsw), maxval(solsw)
-
-IF (startphy_file) THEN
-  ! Lecture rayonnement IR au sol:
+WRITE(*,*) 'Solar flux to the surface solsw:', minval(solsw), maxval(solsw)
+
+IF (startphy_file) THEN
+  ! IR flux to the surface:
   CALL get_field("sollw",sollw,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <sollw> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <sollw> is missing"
+    WRITE(*,*) "set to zero"
     sollw = 0.
   ENDIF
@@ -191,12 +190,12 @@
   sollw(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Rayonnement IR au sol sollw:', minval(sollw), maxval(solsw)
-
-IF (startphy_file) THEN
-  ! Lecture derive des flux:
+WRITE(*,*) 'IR flux to the surface sollw:', minval(sollw), maxval(solsw)
+
+IF (startphy_file) THEN
+  ! Derivative of the sensible and latent fluxes:
   CALL get_field("fder",fder,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <fder> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <fder> is missing"
+    WRITE(*,*) "set to zero"
     fder = 0.
   ENDIF
@@ -205,12 +204,12 @@
   fder(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Derive des flux fder:', minval(fder), maxval(fder)
-
-IF (startphy_file) THEN
-  ! Lecture derive flux IR:
+WRITE(*,*) 'Derivative of the flux fder:', minval(fder), maxval(fder)
+
+IF (startphy_file) THEN
+  ! Derivative of the IR flux:
   CALL get_field("dlw",dlw,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <dlw> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <dlw> is missing"
+    WRITE(*,*) "set to zero"
     dlw = 0.
   ENDIF
@@ -219,12 +218,12 @@
   dlw(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Derive flux IR dlw:', minval(dlw), maxval(dlw)
-
-IF (startphy_file) THEN
-  ! Lecture rayonnement IR vers le bas au sol:
+WRITE(*,*) 'Derivative of the IR flux dlw:', minval(dlw), maxval(dlw)
+
+IF (startphy_file) THEN
+  ! Downward IR flux at the surface:
   CALL get_field("sollwdown",sollwdown,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <sollwdown> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <sollwdown> is missing"
+    WRITE(*,*) "set to zero"
     sollwdown = 0.
   ENDIF
@@ -233,12 +232,12 @@
   sollwdown(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Flux IR vers le bas au sol sollwdown:', minval(sollwdown), maxval(sollwdown)
-
-IF (startphy_file) THEN
-  ! Lecture du rayonnement net au sol:
+WRITE(*,*) 'Downward IR flux at the surface sollwdown:', minval(sollwdown), maxval(sollwdown)
+
+IF (startphy_file) THEN
+  ! Net flux at the surface:
   CALL get_field("RADS",radsol,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <RADS> est absent'
-    CALL abort
+    WRITE(*,*) modname//": Field <RADS> is missing"
+    call abort_physic(modname,"Missing <RADS>",1)
   ENDIF
 ELSE
@@ -246,5 +245,5 @@
   radsol(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Rayonnement net au sol radsol:', minval(radsol), maxval(radsol)
+WRITE(*,*) 'Net flux at the surface radsol:', minval(radsol), maxval(radsol)
 
 IF (startphy_file) THEN
@@ -252,6 +251,6 @@
   CALL get_field("ZMEA",zmea,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZMEA> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZMEA> is missing"
+    WRITE(*,*) "set to zero"
     zmea=0.
   ENDIF
@@ -259,5 +258,5 @@
   zmea(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zmea:', minval(zmea), maxval(zmea)
+WRITE(*,*) 'Subgrid scale orography zmea:', minval(zmea), maxval(zmea)
 
 IF (startphy_file) THEN
@@ -265,6 +264,6 @@
   CALL get_field("ZSTD",zstd,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZSTD> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZSTD> is missing"
+    WRITE(*,*) "set to zero"
     zstd=0.
   ENDIF
@@ -272,5 +271,5 @@
   zstd(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zstd:', minval(zstd), maxval(zstd)
+WRITE(*,*) 'Subgrid scale orography zstd:', minval(zstd), maxval(zstd)
 
 IF (startphy_file) THEN
@@ -278,6 +277,6 @@
   CALL get_field("ZSIG",zsig,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZSIG> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZSIG> is missing"
+    WRITE(*,*) "set to zero"
     zsig=0.
   ENDIF
@@ -285,5 +284,5 @@
   zsig(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zsig:', minval(zsig), maxval(zsig)
+WRITE(*,*) 'Subgrid scale orography zsig:', minval(zsig), maxval(zsig)
 
 IF (startphy_file) THEN
@@ -291,6 +290,6 @@
   CALL get_field("ZGAM",zgam,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZGAM> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZGAM> is missing"
+    WRITE(*,*) "set to zero"
     zgam=0.
   ENDIF
@@ -298,5 +297,5 @@
   zgam(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zgam:', minval(zgam), maxval(zgam)
+WRITE(*,*) 'Subgrid scale orography zgam:', minval(zgam), maxval(zgam)
 
 IF (startphy_file) THEN
@@ -304,6 +303,6 @@
   CALL get_field("ZTHE",zthe,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZTHE> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZTHE> is missing"
+    WRITE(*,*) "set to zero"
     zthe=0.
   ENDIF
@@ -311,5 +310,5 @@
   zthe(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zthe:', minval(zthe), maxval(zthe)
+WRITE(*,*) 'Subgrid scale orography zthe:', minval(zthe), maxval(zthe)
 
 IF (startphy_file) THEN
@@ -317,6 +316,6 @@
   CALL get_field("ZPIC",zpic,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZPIC> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZPIC> is missing"
+    WRITE(*,*) "set to zero"
     zpic=0.
   ENDIF
@@ -324,5 +323,5 @@
   zpic(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zpic:', minval(zpic), maxval(zpic)
+WRITE(*,*) 'Subgrid scale orography zpic:', minval(zpic), maxval(zpic)
 
 IF (startphy_file) THEN
@@ -330,6 +329,6 @@
   CALL get_field("ZVAL",zval,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <ZVAL> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <ZVAL> is missing"
+    WRITE(*,*) "set to zero"
     zval=0.
   ENDIF
@@ -337,5 +336,5 @@
   zval(:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'OROGRAPHIE SOUS-MAILLE zval:', minval(zval), maxval(zval)
+WRITE(*,*) 'Subgrid scale orography zval:', minval(zval), maxval(zval)
 
 IF (startphy_file) THEN
@@ -345,6 +344,6 @@
   CALL get_field("TANCIEN",t_ancien,found)
   IF (.not.found) THEN
-    PRINT*, "phyetat0: Le champ <TANCIEN> est absent"
-    PRINT*, "Depart legerement fausse. Mais je continue"
+    WRITE(*,*) modname//": Field <TANCIEN> is missing"
+    WRITE(*,*) "Slightly biaised start. But let's keep going."
     ancien_ok = .FALSE.
   ENDIF
@@ -368,6 +367,6 @@
   CALL get_field("Q2",q2,found)
   IF (.not.found) THEN
-    PRINT*, 'phyetat0: Le champ <Q2> est absent'
-    PRINT*, 'mis a zero'
+    WRITE(*,*) modname//": Field <Q2> is missing"
+    WRITE(*,*) "set to zero"
     q2(:,:)=0.
   ENDIF
@@ -376,5 +375,5 @@
   q2(:,:)=0
 ENDIF ! of IF (startphy_file)
-PRINT*,'Turbulent Kinetic Energy', minval(q2), maxval(q2)
+WRITE(*,*) 'Turbulent Kinetic Energy', minval(q2), maxval(q2)
 
 ! Non-orographic gravity waves 
@@ -415,2 +414,4 @@
 
 end subroutine phyetat0
+
+end module phyetat0_mod
Index: trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F	(revision 3714)
+++ trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F	(revision 3719)
@@ -92,4 +92,5 @@
       use comm_wrf
 #else 
+      use phyetat0_mod, only: phyetat0
       use iophy
       use write_field_phy
@@ -246,5 +247,4 @@
       EXTERNAL hgardfou      ! verifier les temperatures
 c     EXTERNAL orbite         ! calculer l'orbite 
-      EXTERNAL phyetat0      ! lire l'etat initial de la physique
       EXTERNAL phyredem      ! ecrire l'etat de redemarrage de la physique
       EXTERNAL radlwsw       ! rayonnements solaire et infrarouge
